Skip to content

build(docsify): upgrade docs site to Docsify v5 - #768

Open
mcalihe wants to merge 2 commits into
microsoft:mainfrom
mcalihe:claude/web-permissions-policy-errors-b5e5ad
Open

mcalihe wants to merge 2 commits into
microsoft:mainfrom
mcalihe:claude/web-permissions-policy-errors-b5e5ad

Conversation

@mcalihe

@mcalihe mcalihe commented Oct 17, 2026 •

Copy link
Copy Markdown

Summary

The docs site at https://microsoft.github.io/AI-For-Beginners/ still runs Docsify v4 and logs Docsify v4 is no longer supported on every page load.

index.html loads docsify/lib/docsify.min.js without a version, so jsDelivr serves the newest package (5.0.0). Inside that package, however, lib/ only contains the legacy v4.13.1 build, kept for backwards compatibility. The actual v5 build is in dist/. This PR switches to docsify@5/dist/docsify.min.js, so the site runs v5 (Docsify.version returns 5.0.0).

Changes

  • index.html: upgrade to Docsify v5 following the official upgrade guide
    • Pin docsify@5 and load it from dist/
    • Replace docsify-themeable with the v5 core theme and its dark mode add-on
    • Add the sidebar-chevron-right body class
    • Use explicit https URLs for the CDN assets
  • README.md: add a blank line before the --- after the LangChain badges. Without it, the badges parse as a setext h2 heading instead of a paragraph followed by a horizontal rule. Docsify v5 lists that heading as an empty sidebar entry, and GitHub renders it as a heading as well.

Why replace docsify-themeable

docsify-themeable was last released in 2022 (0.9.0) and only supports Docsify v4. In v5 the sidebar toggle sets a show class on .sidebar instead of close on <body>, so with themeable the toggle does nothing. On mobile, where the sidebar is hidden by default, that leaves no way to open the navigation. The v5 core theme is the replacement the upgrade guide recommends.

Testing

I rendered the new index.html against the live site content in Chromium:

  • Docsify 5.0.0 loads with no console errors or warnings
  • The sidebar has the same 22 entries as the current site, with no empty item
  • Lesson pages (e.g. Perceptron) render and all images load
  • The sidebar toggle works on desktop and at 375px width
  • Dark mode follows prefers-color-scheme

Notes for reviewers

  • The look changes slightly, since the core theme replaces theme-simple.
  • Heading anchors (?id=) now follow GitHub's slug rules: emoji are dropped and separators are kept. For example, ?id=🌐-multi-language-support becomes ?id=-multi-language-support, and ?id=artificial-intelligence-for-beginners-a-curriculum becomes ?id=artificial-intelligence-for-beginners---a-curriculum. This affects 87 anchors on 31 pages. I compared v4 and v5 on all 68 non-translation pages: links within the site still resolve. Old external links to these sections still open the right page, but no longer scroll to the section.
  • The README fix sits between the CO-OP TRANSLATOR OTHER COURSES markers. If Co-op Translator regenerates that block, the blank line may need to go into its template.
  • Other console messages seen on the site are not caused by the site itself. The page sends no Permissions-Policy header, so the "Unrecognized feature" errors come from the browser. The unload violations come from browser extension content scripts.

The `---` line directly after the LangChain badge paragraph turned the
badges into an h2 heading (setext syntax) instead of a horizontal rule.
Docsify v5 lists that heading in the sidebar as an empty entry.

Add a blank line so it renders as a separator, matching the other
sections of the list.
The unpinned CDN path `docsify/lib/docsify.min.js` now serves the
legacy v4.13.1 build, which logs "Docsify v4 is no longer supported"
on every page load.

- Pin `docsify@5` and load it from the `dist/` path
- Replace docsify-themeable with the v5 core theme and its dark mode
  add-on; docsify-themeable does not support the v5 sidebar toggle,
  which breaks navigation on mobile
- Use explicit https URLs for the CDN assets

See https://docsify.js.org/#/v5-upgrade

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant