Skip to content

Commit

Permalink
[optimize] separate the script files of 'docs' into a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
wangrunlin committed Feb 3, 2024
1 parent eb6e0eb commit 255f30b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
22 changes: 22 additions & 0 deletions pack-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# generate multilingual file
for file in ReadMe-*.md; do

typedoc --readme $file

mv docs/index.html ${file%.md}.html

done

# generate docs
typedoc source/

# copy html file to docs folder, replace link
for file in ReadMe-*.html; do

# example: mv ReadMe-zh.html docs/zh.html
mv $file docs/"${file#ReadMe-}"

# example: replace ReadMe-zh.md zh.html
replace "./${file%.html}.md" "./${file#ReadMe-}" docs/*.html

done
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@
"preview": "npm run clean && cd preview/ && parcel --dist-dir=../docs/preview/ --open",
"pack-preview": "rimraf .parcel-cache/ docs/preview/ && cd preview/ && parcel build --public-url=. --dist-dir=../docs/preview/",
"pack-dist": "parcel build source/index.ts",
"pack-docs": "npm run pre-pack-docs-language && typedoc source/ && npm run pack-docs-language",
"pre-pack-docs-language": "for file in ReadMe-*.md; do new_file=\"${file%.md}.html\"; typedoc --readme $file && mv docs/index.html $new_file; done",
"pack-docs-language": "for file in ReadMe-*.html; do new_file=\"${file#ReadMe-}\"; mv $file docs/\"$new_file\"; replace \"./${file%.html}.md\" \"./$new_file\" docs/*.html; done",
"pack-docs": "./pack-docs.sh",
"build": "npm run clean && npm run pack-dist && npm run pack-docs && npm run pack-preview",
"start": "npm run pack-docs && open-cli docs/index.html",
"prepublishOnly": "npm test && npm run build"
Expand Down

1 comment on commit 255f30b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for web-cell ready!

✅ Preview
https://web-cell-cnu1o4b4f-techquery.vercel.app

Built with commit 255f30b.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.