Build the themes and vendor folders, and create the markdown-viewer.zip package:
# pick a release tag
git clone --depth 1 --branch firefox https://github.com/simov/markdown-viewer.git
# build
cd markdown-viewer/
sh build/package.sh firefox- node >= 18
- npm >= 10
- git
- zip
| Library | Build Strategy | Outputs | |
|---|---|---|---|
| bootstrap | π | npm install - copy file | - vendor/bootstrap.min.css |
| markdown-it | π¦ | npm install - bundle - minify | - vendor/markdown-it.min.js |
| marked | π¦ | npm install - bundle - minify | - vendor/marked.min.js |
| mathjax | π | npm install - copy files | - vendor/mathjax/ (folder) |
| mdc | π¦ | npm install - bundle - minify | - vendor/mdc.min.js - vendor/mdc.min.css |
| mermaid | π | npm install - copy file | - vendor/mermaid.min.js |
| mithril | π | npm install - copy file | - vendor/mithril.min.js |
| prism | πβ | npm install - copy files - minify .js files - minify .css files - one .js file modified - some .css files modified |
- vendor/prism.min.js - vendor/prism-autoloader.min.jsβ - vendor/prism/ (folder) - vendor/prism.min.css - vendor/prism-okaidia.min.css |
| remark | π¦ | npm install - bundle - minify | - vendor/remark.min.js |
| themes | π | npm install - git clone - copy files - minify .css files - some .css files modified |
- themes/ (folder) |
-
build: https://github.com/simov/markdown-viewer/tree/main/build/bootstrap
# π npm install - copy file sh build/bootstrap/build.sh -
output:
vendor/bootstrap.min.css== https://github.com/twbs/bootstrap/blob/v5.2.3/dist/css/bootstrap.min.css
-
source:
module version source bootstrap 5.2.3 https://github.com/twbs/bootstrap/tree/v5.2.3
-
build: https://github.com/simov/markdown-viewer/tree/main/build/markdown-it
# π¦ npm install - bundle - minify sh build/markdown-it/build.sh -
output:
vendor/markdown-it.min.js
-
source:
-
build: https://github.com/simov/markdown-viewer/tree/main/build/marked
# π¦ npm install - bundle - minify sh build/marked/build.sh -
output:
vendor/marked.min.js
-
source:
module version source marked 9.0.3 https://github.com/markedjs/marked/tree/v9.0.3 marked-gfm-heading-id 3.1.0 https://github.com/markedjs/marked-gfm-heading-id/tree/v3.1.0 marked-linkify-it 3.1.4 https://github.com/UziTech/marked-linkify-it/tree/v3.1.4 marked-smartypants 1.1.3 https://github.com/markedjs/marked-smartypants/tree/v1.1.3
-
build: https://github.com/simov/markdown-viewer/tree/main/build/mathjax
# π npm install - copy files sh build/mathjax/build.sh -
output:
vendor/mathjax/vendor/mathjax/tex-mml-chtml.js== https://github.com/mathjax/MathJax/blob/3.2.2/es5/tex-mml-chtml.jsvendor/mathjax/extensions/== https://github.com/mathjax/MathJax/tree/3.2.2/es5/input/tex/extensionsvendor/mathjax/fonts/== https://github.com/mathjax/MathJax/tree/3.2.2/es5/output/chtml/fonts/woff-v2
-
source:
module version source mathjax 3.2.2 https://github.com/mathjax/MathJax/tree/3.2.2
-
build: https://github.com/simov/markdown-viewer/tree/main/build/mdc
# π¦ npm install - bundle - minify sh build/mdc/build.sh -
output:
vendor/mdc.min.jsvendor/mdc.min.css
-
source:
module version source @material/button 0.37.1 https://github.com/material-components/material-components-web/tree/v0.37.1 @material/ripple 0.37.1 https://github.com/material-components/material-components-web/tree/v0.37.1 @material/switch 0.36.1 https://github.com/material-components/material-components-web/tree/v0.36.1 @material/tabs 0.37.1 https://github.com/material-components/material-components-web/tree/v0.37.1 @material/textfield 0.37.1 https://github.com/material-components/material-components-web/tree/v0.37.1
-
build: https://github.com/simov/markdown-viewer/tree/main/build/mermaid
# π npm install - copy file sh build/mermaid/build.sh -
output:
vendor/mermaid.min.js== (available on npm install only)
-
source:
module version source mermaid 9.2.2 https://github.com/mermaid-js/mermaid/tree/v9.2.2
-
build: https://github.com/simov/markdown-viewer/tree/main/build/mithril
# π npm install - copy file sh build/mithril/build.sh -
output:
vendor/mithril.min.js== https://github.com/MithrilJS/mithril.js/blob/v1.1.6/mithril.min.js
-
source:
module version source mithril 1.1.7 https://github.com/MithrilJS/mithril.js/tree/v1.1.7
-
build: https://github.com/simov/markdown-viewer/tree/main/build/prism
# π¦ npm install - copy files - minify .js files - minify .css files # one .js file modified - some .css files modified sh build/prism/build.sh
-
output:
vendor/prism.min.js== https://github.com/PrismJS/prism/blob/v1.29.0/prism.js (but minifed)vendor/prism-autoloader.min.js== https://github.com/PrismJS/prism/blob/v1.29.0/plugins/autoloader/prism-autoloader.js β (one line modified, and then minified)vendor/prism/(folder) == https://github.com/PrismJS/prism/tree/v1.29.0/components (all .min.js files)vendor/prism.min.css== https://github.com/PrismJS/prism/blob/v1.29.0/themes/prism.css (modified and minified)vendor/prism-okaidia.min.css== https://github.com/PrismJS/prism/blob/v1.29.0/themes/prism-okaidia.css (modified and minified)
-
source:
module version source prismjs 1.29.0 https://github.com/PrismJS/prism/tree/v1.29.0 -
details: β
- as explained in this issue PrismJS/prism#3654
- the
addScriptmethod needs to be exposed inside theprism-autoloader.jsfile https://github.com/simov/markdown-viewer/blob/main/build/prism/fix-autoloader.js
- addScript(getLanguagePath(lang), function () { + Prism.plugins.autoloader.addScript(lang, function () {
- so that it can be patched at runtime to load syntax definitions from a background page https://github.com/simov/markdown-viewer/blob/5.2/content/prism.js
-
build: https://github.com/simov/markdown-viewer/tree/main/build/remark
# π¦ npm install - bundle - minify sh build/remark/build.sh -
output:
vendor/remark.min.js
-
source:
module version source remark 14.0.2 https://github.com/remarkjs/remark/tree/14.0.2 remark-breaks 3.0.2 https://github.com/remarkjs/remark-breaks/tree/3.0.2 remark-gfm 3.0.1 https://github.com/remarkjs/remark-gfm/tree/3.0.1 remark-html 15.0.2 https://github.com/remarkjs/remark-html/tree/15.0.2 remark-slug 7.0.1 https://github.com/remarkjs/remark-slug/tree/7.0.1
-
build: https://github.com/simov/markdown-viewer/tree/main/build/themes
# π npm install - git clone - copy files - minify .css files # some .css files modified sh build/themes/build.sh
-
output:
themes/themes/github.css== https://github.com/sindresorhus/github-markdown-css/blob/v5.2.0/github-markdown-light.css (but minified)themes/github-dark.css== https://github.com/sindresorhus/github-markdown-css/blob/v5.2.0/github-markdown-dark.css (but minified)themes/... .css== https://github.com/gadenbuie/cleanrmd/tree/v0.1.0/inst/resources (almost all themes, but minified, some also modified)
-
source:
module version source cleanrmd 0.1.0 https://github.com/gadenbuie/cleanrmd/tree/v0.1.0 github-markdown-css 5.2.0 https://github.com/sindresorhus/github-markdown-css/tree/v5.2.0