此存儲庫包含“ Cortexjs.io”網站的源文件。
git submodule init
git submodule update
# Setup, make a dev build and start a server
npm start # Pick-up changes in the dependent modules
npm run update
# Generate .md files for API and launch local server
npm startnpm run stage
# Make a clean production build.
# Output goes inside submodules/cortex-js.github.io
npm run restart
# Validate that everything works well in the browser then...
npm run deploy
# submodules/cortex-js.github.io (a git submodule) gets pushed to cortex-js.github.io該網站使用GitHub頁面發布。使用GH頁面的主要好處是工作流程集成(在GH上進行Pobshing觸發了所服務網站的自動更新)
這些網站的內容主要是作為降價文件撰寫的,並以eleventy處理將其轉換為HTML/CSS。
主要的eleventy配置在config/eleventy.js文件中,包括要使用的降價的定義。
Markdown引擎是markdown-it它實現了Concommark。
mardown-it-attrs插件允許段落的樣式,例如
這是一個通知。 {.notice - info}
markdown-it-deflist插件支持PANDC樣式定義列表:
Term 1
: Definition 1
: Second definition
輸出在submodules/cortex-js.github.io目錄中。該目錄是git子模塊,鏈接到cortex-js.github.io repo。該存儲庫是GH頁面發布的(對於組織,只能發布整個存儲庫,對於項目,其中內容可以包含在A /docs目錄中)。
另請參見子模型。
cortex-js.github.io repo還必須包括兩個其他文件:
.nojekyllCNAME cortexjs.io內容這些文件是在運行npm run stage時創建的。
在cortex-js.github.io repo中使用“設置”選項卡,以指示使用自定義域。
此外, cortexjs.io的DNS條目必須包括以下內容:
www.cortex-js.io指向cortex-js.io cname記錄npm run build命令將API的文檔從Typecript .d.ts文件中build/目錄中的文檔。
構建過程使用typedoc工具來解析API標頭文件並在build/目錄中輸出json文件。
注意:要調試轉換器,請使用VSCODE調試器。選擇調試>開始調試以在VSCODE中開始調試會話。
然後, build-guides腳本將json文件轉換為./src/build build目錄中的降級,然後在npm run build或npm start時可以通過高架處理。
CSS樣式信息是在src/_sass/中定義的。
API文檔應遵循Google文檔樣式指南(https://developers.google.com/style/api-reference-comments)和https://developers.google.com/style
此外,打字稿代碼應遵循Google樣式指南:https://google.github.io/styleguide/jsguide.html#naming
該項目遵循用於命名項目腳本的GitHub標準。
進行本地構建:
npm start準備上演的構建:
npm run stage生成的站點的“測試”包括檢查鏈接,生成的HTML是有效的。