sway/scripts/highlightjs/build.sh
Chris-san e5d3185abf
forc doc: Generate dependency documentation (#4546)
## Description

Generates the documentation for dependencies & small improvements to the
API.

These changes **DO NOT** create links between dependency docs and the main docs, but generates the dependency docs and ensures there are no conflicts when generating these docs.

What's new so far:
- [x] Programs get their own folders, just like `cargo doc`
- [x] Generates documentation for dependencies by default: Closes #4533 
- [x] Fixes possible conflict with `assets` folder: Closes #4545 
- [x] Removes old docs before generating new ones: Closes #4544 

## Checklist

- [x] I have linked to any relevant issues. 
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: Chris O'Brien <eureka@noctua.attlocal.net>
2023-05-22 21:27:32 +03:00

23 lines
627 B
Bash
Executable file

#!/bin/bash
project="highlight.js"
sway="sway.js"
if ! test -d ./${project}; then
git clone --depth 1 --branch 11.3.1 git@github.com:highlightjs/highlight.js.git
fi
cp ${sway} ${project}/src/languages
cd ${project}
npm ci
rm -rf build
node tools/build.js sway rust ini bash shell json
cp build/highlight.min.js ../../../docs/reference/theme/highlight.js
cp build/highlight.min.js ../../../docs/book/theme/highlight.js
cp build/highlight.min.js ../../../forc-plugins/forc-doc/src/static.files/highlight.js
# add "keep" in order to keep highlight.js repo
if [[ ${1} != "keep" ]]; then
cd ../
rm -rf ${project}
fi