+ +
@@ -191,7 +195,7 @@ text with spaCy. ### Tokenization {#annotations-token} -import Tokenization101 from 'usage/101/\_tokenization.md' +import Tokenization101 from 'usage/101/_tokenization.md'
)
-export const Pre = props => {
+export const Pre = (props) => {
return {props.children}} @@ -101,7 +101,7 @@ function replacePrompt(line, prompt, isFirst = false) { } function parseArgs(raw) { - let args = raw.split(' ').filter(arg => arg) + let args = raw.split(' ').filter((arg) => arg) const result = {} while (args.length) { let opt = args.shift() @@ -168,7 +168,7 @@ function formatCode(html, lang, prompt) { const lines = html .trim() .split('\n') - .map(line => + .map((line) => line .split(' | ') .map((l, i) => convertLine(l, i)) @@ -234,17 +234,8 @@ export class Code extends React.Component { } render() { - const { - lang, - title, - executable, - github, - prompt, - wrap, - highlight, - className, - children, - } = this.props + const { lang, title, executable, github, prompt, wrap, highlight, className, children } = + this.props const codeClassNames = classNames(classes.code, className, `language-${lang}`, { [classes.wrap]: !!highlight || !!wrap || lang === 'cli', [classes.cli]: lang === 'cli', @@ -264,7 +255,7 @@ export class Code extends React.Component { } const codeText = Array.isArray(children) ? children.join('') : children || '' - const highlightRange = highlight ? rangeParser.parse(highlight).filter(n => n > 0) : [] + const highlightRange = highlight ? rangeParser.parse(highlight).filter((n) => n > 0) : [] const rawHtml = ['none', 'cli'].includes(lang) ? codeText : highlightCode(lang, codeText, highlightRange) diff --git a/website/src/components/github.js b/website/src/components/github.js index 1653ca459..4d1f7b1e6 100644 --- a/website/src/components/github.js +++ b/website/src/components/github.js @@ -27,11 +27,11 @@ const GitHubCode = ({ url, lang, errorMsg = defaultErrorMsg, className }) => { if (!initialized) { setCode(null) fetch(rawUrl) - .then(res => res.text().then(text => ({ text, ok: res.ok }))) + .then((res) => res.text().then((text) => ({ text, ok: res.ok }))) .then(({ text, ok }) => { setCode(ok ? text : errorMsg) }) - .catch(err => { + .catch((err) => { setCode(errorMsg) console.error(err) }) diff --git a/website/src/components/juniper.js b/website/src/components/juniper.js index 09ab0cba6..1d0bf165c 100644 --- a/website/src/components/juniper.js +++ b/website/src/components/juniper.js @@ -14,7 +14,7 @@ export default class Juniper extends React.Component { state = { kernel: null, renderers: null, fromStorage: null } componentDidMount() { - const renderers = standardRendererFactories.filter(factory => + const renderers = standardRendererFactories.filter((factory) => factory.mimeTypes.includes('text/latex') ? window.MathJax : true ) @@ -52,7 +52,7 @@ export default class Juniper extends React.Component { this.log(() => console.info('building', { binderUrl })) return new Promise((resolve, reject) => { const es = new EventSource(binderUrl) - es.onerror = err => { + es.onerror = (err) => { es.close() this.log(() => console.error('failed')) reject(new Error(err)) @@ -92,7 +92,7 @@ export default class Juniper extends React.Component { window.localStorage.setItem(this.props.storageKey, json) } const serverSettings = ServerConnection.makeSettings(settings) - return Kernel.startNew({ type: this.props.kernelType, serverSettings }).then(kernel => { + return Kernel.startNew({ type: this.props.kernelType, serverSettings }).then((kernel) => { this.log(() => console.info('ready')) return kernel }) @@ -116,7 +116,7 @@ export default class Juniper extends React.Component { } if (this.props.useBinder) { return this.requestBinder(this.props.repo, this.props.branch, this.props.url).then( - settings => this.requestKernel(settings) + (settings) => this.requestKernel(settings) ) } return this.requestKernel(this.props.serverSettings) @@ -173,12 +173,8 @@ export default class Juniper extends React.Component { name: 'stdout', text: `${action} Docker container on ${url}...`, }) - new Promise((resolve, reject) => - this.getKernel() - .then(resolve) - .catch(reject) - ) - .then(kernel => { + new Promise((resolve, reject) => this.getKernel().then(resolve).catch(reject)) + .then((kernel) => { this.setState({ kernel }) this.renderResponse(outputArea, code) }) @@ -203,7 +199,7 @@ export default class Juniper extends React.Component {