-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add dev server functionality based on docsify #9347
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a Docsify-based local preview workflow for this docs repo, intended to help contributors browse content locally with navigation/search and validate links.
Changes:
- Add Docsify dev server (
npm run serve) and dependency ondocsify-cli. - Add a generated multi-section sidebar workflow (
build/generate-sidebar.js) and supporting navbar/landing READMEs. - Ignore generated sidebar files in
.gitignore.
Reviewed changes
Copilot reviewed 7 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
package.json |
Adds generate-sidebar and serve scripts; adds docsify-cli dev dependency. |
package-lock.json |
Locks the new docsify-cli dependency tree. |
index.html |
Introduces the Docsify app shell/config, including sidebar/navbar config, search, and custom plugins. |
build/generate-sidebar.js |
Generates _sidebar*.md files from existing TOC JSON and frontmatter metadata. |
_navbar.md |
Adds top-level navbar links for Docs/API/Blogs/Release Notes. |
blogs/README.md |
Adds a landing page for the /blogs/ route. |
release-notes/README.md |
Adds a landing page for the /release-notes/ route. |
CONTRIBUTING.md |
Documents how to run the local Docsify preview. |
.gitignore |
Ignores generated sidebar markdown files. |
.nojekyll |
Adds .nojekyll marker file (empty). |
Comments suppressed due to low confidence (2)
index.html:221
- Docsify scripts are loaded from jsDelivr using unpinned versions ("docsify@4") and without subresource integrity. For reproducibility/supply-chain safety, prefer pinning exact versions and adding integrity/crossorigin (or vendoring locally).
<script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/docsify.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/search.min.js"></script>
</body>
index.html:135
- The folder toggle click handler always calls preventDefault(). If the toggle element is an anchor, this will block normal navigation. Consider only preventing default for non-anchor toggles, or checking for an href before preventing navigation.
toggle.addEventListener('click', function (e) {
e.preventDefault();
e.stopPropagation();
this.parentElement.classList.toggle('open');
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Add a local documentation preview workflow using Docsify. The changes make it easier for contributors to preview and navigate the documentation site locally.
The website does not exactly match the production website in terms of style, but enables previewing content changes and verifying cross-linking.
To preview docs locally, run the following command in the terminal: