diff --git a/website/docs/img b/website/docs/img new file mode 120000 index 0000000000..d0a8b9d64a --- /dev/null +++ b/website/docs/img @@ -0,0 +1 @@ +../static/img \ No newline at end of file diff --git a/website/docs/img/bcc2020_img1.png b/website/docs/img/bcc2020_img1.png deleted file mode 100644 index 939fac69e7..0000000000 Binary files a/website/docs/img/bcc2020_img1.png and /dev/null differ diff --git a/website/docs/img/bcc2020_img2.png b/website/docs/img/bcc2020_img2.png deleted file mode 100644 index 5dd18a81d6..0000000000 Binary files a/website/docs/img/bcc2020_img2.png and /dev/null differ diff --git a/website/docs/img/bcc2020_img3.png b/website/docs/img/bcc2020_img3.png deleted file mode 100644 index be6d26813d..0000000000 Binary files a/website/docs/img/bcc2020_img3.png and /dev/null differ diff --git a/website/docs/img/bcc2020_jbrowse_help.png b/website/docs/img/bcc2020_jbrowse_help.png deleted file mode 100644 index 02a3de764b..0000000000 Binary files a/website/docs/img/bcc2020_jbrowse_help.png and /dev/null differ diff --git a/website/docs/img/bcc2020_network_success.png b/website/docs/img/bcc2020_network_success.png deleted file mode 100644 index de0204c54f..0000000000 Binary files a/website/docs/img/bcc2020_network_success.png and /dev/null differ diff --git a/website/docs/img/favicon.ico b/website/docs/img/favicon.ico deleted file mode 100644 index 74d9a84d2c..0000000000 Binary files a/website/docs/img/favicon.ico and /dev/null differ diff --git a/website/docs/img/logo.svg b/website/docs/img/logo.svg deleted file mode 100644 index 3caf3393b1..0000000000 --- a/website/docs/img/logo.svg +++ /dev/null @@ -1 +0,0 @@ -jbrowse_logo \ No newline at end of file diff --git a/website/docs/tex_parser.js b/website/docs/tex_parser.js index 121ec965e2..d36e4f93ce 100755 --- a/website/docs/tex_parser.js +++ b/website/docs/tex_parser.js @@ -1,15 +1,15 @@ /* eslint-disable no-console,no-continue */ const readline = require('readline') +const acorn = require('acorn') +const jsx = require('acorn-jsx') const rl = readline.createInterface({ input: process.stdin, // or fileStream }) - +const parser = acorn.Parser.extend(jsx()) let readingHeader = false let title = '' let topLevel = false -let figure = '' -let caption = '' ;(async () => { for await (const line of rl) { @@ -33,29 +33,24 @@ let caption = '' } continue } - if (line.startsWith('![]')) { - const res = line.match(/\(([^)]+)\)/) - if (res) { - figure = res[1].replace('/jb2', '..') - continue - } - } - if (figure) { - if (line.trim() !== '') { - caption += `${line} ` - continue - } else { - console.log(`![${caption}](${figure})\n\n`) - figure = '' - caption = '' - continue - } + if (line.startsWith(' attr.name.name === 'src', + ) + const caption = res.body[0].expression.openingElement.attributes.find( + attr => attr.name.name === 'caption', + ) + + // chop off leading absolute figure / + const srcval = src.value.value.slice(1) + const captionval = caption.value.value + console.log(`![${captionval}](${srcval})\n\n`) + continue } + if (readingHeader === false) { console.log(line) } } - if (figure && caption) { - console.log(`![${caption}](${figure})\n\n`) - } })() diff --git a/website/package.json b/website/package.json index a2468607e1..952a586a91 100644 --- a/website/package.json +++ b/website/package.json @@ -18,6 +18,8 @@ "@docusaurus/core": "^2.0.0-alpha.72", "@docusaurus/preset-classic": "^2.0.0-alpha.72", "@material-ui/core": "^4.9.13", + "acorn": "^8.1.1", + "acorn-jsx": "^5.3.1", "clsx": "^1.1.1", "react": "^16.8.4", "react-dom": "^16.8.4" diff --git a/website/yarn.lock b/website/yarn.lock index 3540c56675..59dc9be2b5 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -2983,6 +2983,11 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" +acorn-jsx@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" + integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== + acorn-walk@^8.0.0: version "8.0.2" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.0.2.tgz#d4632bfc63fd93d0f15fd05ea0e984ffd3f5a8c3" @@ -2998,6 +3003,11 @@ acorn@^8.0.4: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.1.0.tgz#52311fd7037ae119cbb134309e901aa46295b3fe" integrity sha512-LWCF/Wn0nfHOmJ9rzQApGnxnvgfROzGilS8936rqN/lfcYkY9MYZzdMqN+2NJ4SlTc+m5HiSa+kNfDtI64dwUA== +acorn@^8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.1.1.tgz#fb0026885b9ac9f48bac1e185e4af472971149ff" + integrity sha512-xYiIVjNuqtKXMxlRMDc6mZUhXehod4a3gbZ1qRlM7icK4EbxUFNLhWoPblCvFtB2Y9CIqHP3CF/rdxLItaQv8g== + address@1.1.2, address@^1.0.1: version "1.1.2" resolved "https://registry.yarnpkg.com/address/-/address-1.1.2.tgz#bf1116c9c758c51b7a933d296b72c221ed9428b6"