-
Notifications
You must be signed in to change notification settings - Fork 106
Migrate docs to docusaurus #1943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
289c2b3
chore: migrate docs from mdbook to docusaurus
Keinberger 9334c29
chore(Makefile): add serve-docs command and implement checking for NP…
Keinberger 30f3501
docs(README): add section explaining external documentation
Keinberger f34f127
chore(docs): convert .json docusaurus category files to yml format
Keinberger 0d55cf5
fix(docs): fix broken links
Keinberger 4435f8d
chore: use specific ref for trigger-deploy-docs.yml workflow
Keinberger e476e35
docs: implement custom styling
Keinberger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: build-docs | ||
|
|
||
| # Limits workflow concurrency to only the latest commit in the PR. | ||
| concurrency: | ||
| group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" | ||
| cancel-in-progress: true | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, next] | ||
| paths: | ||
| - "docs/**" | ||
| - ".github/workflows/build-docs.yml" | ||
| pull_request: | ||
| types: [opened, reopened, synchronize] | ||
| paths: | ||
| - "docs/**" | ||
| - ".github/workflows/build-docs.yml" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build-docs: | ||
| name: Build Documentation | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "20" | ||
| cache: "npm" | ||
| cache-dependency-path: docs/package-lock.json | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: ./docs | ||
| run: npm ci | ||
|
|
||
| - name: Build documentation | ||
| working-directory: ./docs | ||
| run: npm run build:dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| name: Trigger Aggregator Docs Rebuild | ||
|
|
||
| on: | ||
| push: | ||
| branches: [next] | ||
|
|
||
| jobs: | ||
| notify: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Send repository_dispatch to aggregator | ||
| uses: peter-evans/repository-dispatch@a628c95fd17070f003ea24579a56e6bc89b25766 | ||
| with: | ||
| # PAT that can access the central aggregator repository | ||
| token: ${{ secrets.DOCS_REPO_TOKEN }} | ||
| repository: ${{ vars.DOCS_AGGREGATOR_REPO }} | ||
| event-type: rebuild | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| book | ||
| .docusaurus/ | ||
| build/ | ||
| node_modules/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| import type { Config } from "@docusaurus/types"; | ||
| import { themes as prismThemes } from "prism-react-renderer"; | ||
|
|
||
| // If your content lives in docs/src, set DOCS_PATH='src'; else '.' | ||
| const DOCS_PATH = | ||
| process.env.DOCS_PATH || (require("fs").existsSync("src") ? "src" : "."); | ||
|
|
||
| const config: Config = { | ||
| title: "Docs Dev Preview", | ||
| url: "http://localhost:3000", | ||
| baseUrl: "/", | ||
| trailingSlash: false, | ||
|
|
||
| // Minimal classic preset: docs only, autogenerated sidebars, same math plugins as prod | ||
| presets: [ | ||
| [ | ||
| "classic", | ||
| { | ||
| docs: { | ||
| path: DOCS_PATH, // '../docs' is implied because we are already inside docs/ | ||
| routeBasePath: "/", // mount docs at root for quick preview | ||
| sidebarPath: "./sidebars.ts", | ||
| remarkPlugins: [require("remark-math")], | ||
| rehypePlugins: [require("rehype-katex")], | ||
| versions: { | ||
| current: { | ||
| label: `unstable`, | ||
| }, | ||
| }, | ||
| }, | ||
| blog: false, | ||
| pages: false, | ||
| theme: { | ||
| customCss: "./styles.css", | ||
| }, | ||
| }, | ||
| ], | ||
| ], | ||
|
|
||
| plugins: [ | ||
| [ | ||
| "@cmfcmf/docusaurus-search-local", | ||
| { | ||
| // whether to index docs pages | ||
| indexDocs: true, | ||
|
|
||
| // whether to index blog pages | ||
| indexBlog: false, | ||
|
|
||
| // whether to index static pages | ||
| indexPages: false, | ||
|
|
||
| // language of your documentation, see next section | ||
| language: "en", | ||
|
|
||
| // setting this to "none" will prevent the default CSS to be included. The default CSS | ||
| // comes from autocomplete-theme-classic, which you can read more about here: | ||
| // https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-theme-classic/ | ||
| style: undefined, | ||
|
|
||
| // lunr.js-specific settings | ||
| lunr: { | ||
| // When indexing your documents, their content is split into "tokens". | ||
| // Text entered into the search box is also tokenized. | ||
| // This setting configures the separator used to determine where to split the text into tokens. | ||
| // By default, it splits the text at whitespace and dashes. | ||
| // | ||
| // Note: Does not work for "ja" and "th" languages, since these use a different tokenizer. | ||
| tokenizerSeparator: /[\s\-]+/, | ||
| // https://lunrjs.com/guides/customising.html#similarity-tuning | ||
| // | ||
| // This parameter controls the importance given to the length of a document and its fields. This | ||
| // value must be between 0 and 1, and by default it has a value of 0.75. Reducing this value | ||
| // reduces the effect of different length documents on a term's importance to that document. | ||
| b: 0.75, | ||
| // This controls how quickly the boost given by a common word reaches saturation. Increasing it | ||
| // will slow down the rate of saturation and lower values result in quicker saturation. The | ||
| // default value is 1.2. If the collection of documents being indexed have high occurrences | ||
| // of words that are not covered by a stop word filter, these words can quickly dominate any | ||
| // similarity calculation. In these cases, this value can be reduced to get more balanced results. | ||
| k1: 1.2, | ||
| // By default, we rank pages where the search term appears in the title higher than pages where | ||
| // the search term appears in just the text. This is done by "boosting" title matches with a | ||
| // higher value than content matches. The concrete boosting behavior can be controlled by changing | ||
| // the following settings. | ||
| titleBoost: 5, | ||
| contentBoost: 1, | ||
| tagsBoost: 3, | ||
| parentCategoriesBoost: 2, // Only used when indexing is enabled for categories | ||
| }, | ||
| }, | ||
| ], | ||
| ], | ||
|
|
||
| themeConfig: | ||
| /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ | ||
| { | ||
| colorMode: { | ||
| defaultMode: "light", | ||
| disableSwitch: true, | ||
| }, | ||
| prism: { | ||
| theme: prismThemes.oneLight, | ||
| darkTheme: prismThemes.oneDark, | ||
| additionalLanguages: ["rust", "solidity", "toml", "yaml"], | ||
| }, | ||
| navbar: { | ||
| logo: { | ||
| src: "img/logo.png", | ||
| alt: "Miden Logo", | ||
| height: 240, | ||
| }, | ||
| title: "MIDEN", | ||
| items: [ | ||
| { | ||
| type: "docsVersionDropdown", | ||
| position: "left", | ||
| dropdownActiveClassDisabled: true, | ||
| }, | ||
| { | ||
| href: "https://github.com/0xMiden/", | ||
| label: "GitHub", | ||
| position: "right", | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| }; | ||
| export default config; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.