diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 81a77b7e3..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -name: Bug report -about: Create a report to help us fix an issue ---- - - - -## Bug Report - -#### Steps to reproduce - - - -#### Current behaviour - - - -#### Expected behaviour - - - -#### Other relevant information - -- Docsify version: - - - -- [ ] Bug still occurs when all/other plugins are disabled? - -- Docsify plugins (if the bug happens when plugins enabled, please try to isolate the issue): - - - - - -#### Please create a reproducible sandbox - -[![Edit 307qqv236](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/307qqv236) - -#### Mention the docsify version in which this bug was not present (if any) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..5326336cc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,61 @@ +name: Bug Report +description: Submit a bug report. +labels: ['bug', 'Triage'] + +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! **Please write in English**. + Before creating an issue please make sure you are using the latest version of Docsify. + + - type: textarea + attributes: + label: Description + description: A clear and concise description of what the bug is, and why you consider it to be a bug. + validations: + required: true + + - type: textarea + attributes: + label: Expected behavior + description: A description of what you expected to happen. + validations: + required: true + - type: textarea + attributes: + label: Actual behavior + description: A description of what is actually happening. + validations: + required: true + - type: textarea + attributes: + label: Steps to reproduce + description: | + A description with steps to reproduce the issue. + Provide a link to a public repository or create a reproducible [sandbox](https://codesandbox.io/s/307qqv236): + placeholder: | + 1. Step 1 + 2. Step 2 + validations: + required: true + + - type: textarea + attributes: + label: Environment + description: | + Please provide the following information if relevant to the issue: + ```markdown + - Your OS: + - Node.js version: + - npm/yarn version: + - Browser version: + - Docsify version: + - Docsify plugins (if the bug happens when plugins enabled, please try to isolate the issue): + ``` + + - type: checkboxes + attributes: + label: Additional Information + options: + - label: Bug still occurs when all/other plugins are disabled? diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index cb840f656..000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project ---- - - - -## Feature request - -#### Problem or desire - - - -#### Proposal - - - -#### Implementation - - diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000..50adeb402 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,33 @@ +name: Feature Request +description: Propose a new feature or improvement for this project. +labels: ['feature request', 'Triage'] + +body: + - type: markdown + attributes: + value: | + Thank you for suggesting a feature! Please provide as much detail as possible to help us understand your idea. **Write in English.** + + - type: textarea + attributes: + label: Problem or Desire + description: What problem or need will this feature address? Why is it important? + validations: + required: true + + - type: textarea + attributes: + label: Proposal + description: What is your proposed solution? How should this feature work? + validations: + required: true + + - type: textarea + attributes: + label: Implementation Details + description: If you have any ideas about how this feature could be implemented, please share them here. + + - type: textarea + attributes: + label: Additional Context + description: Add any other context, screenshots, or references that might help us understand your request. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 9e1aea115..e03dcea0c 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,15 +1,6 @@ - - ## Summary - + ## Related issue, if any: @@ -17,37 +8,28 @@ Provide **before/after** screenshots for any UI changes. ## What kind of change does this PR introduce? - - If you choose Other, describe it. ---> +- [ ] Bugfix +- [ ] Feature +- [ ] Code style update (formatting, renaming) +- [ ] Refactoring (no functional changes, no api changes) +- [ ] Build related changes +- [ ] Documentation content changes +- [ ] Other (please describe): ## For any code change, - - - [ ] Related documentation has been updated, if needed - [ ] Related tests have been added or updated, if needed ## Does this PR introduce a breaking change? - - -Yes -No - +- [ ] Yes +- [ ] No + ## Tested in the following browsers: - [ ] Chrome diff --git a/.github/workflows/emoji.yml b/.github/workflows/emoji.yml index 7e83197ef..77fb6ab1c 100644 --- a/.github/workflows/emoji.yml +++ b/.github/workflows/emoji.yml @@ -25,7 +25,7 @@ jobs: - name: Commit id: auto-commit-action - uses: stefanzweifel/git-auto-commit-action@v5 + uses: stefanzweifel/git-auto-commit-action@v6 with: commit_message: 'chore: Sync emoji data with GitHub emoji API' branch: sync-emoji diff --git a/.vscode/launch.json b/.vscode/launch.json index c9611c096..9d8baf872 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,15 +9,15 @@ "request": "launch", "name": "Run unit tests", "runtimeExecutable": "npm", - "runtimeArgs": ["test"], + "runtimeArgs": ["run", "test:jest"], "console": "integratedTerminal" }, { "type": "node", "request": "launch", "name": "Run current test file", - "runtimeExecutable": "npx", - "runtimeArgs": ["jest"], + "runtimeExecutable": "npm", + "runtimeArgs": ["run", "test:jest", "--"], "args": ["-i", "${relativeFile}", "--testPathIgnorePatterns"], "console": "integratedTerminal" }, @@ -26,9 +26,8 @@ "request": "launch", "name": "Run selected test name", "runtimeExecutable": "npm", - "runtimeArgs": ["run-script", "test"], + "runtimeArgs": ["run", "test:jest", "--"], "args": [ - "--", "-i", "${relativeFile}", "-t", @@ -41,8 +40,8 @@ "type": "node", "request": "launch", "name": "Update current test file snapshot(s)", - "runtimeExecutable": "npx", - "runtimeArgs": ["jest"], + "runtimeExecutable": "npm", + "runtimeArgs": ["run", "test:jest", "--"], "args": [ "-i", "${relativeFile}", @@ -55,10 +54,9 @@ "type": "node", "request": "launch", "name": "Update selected test name snapshot(s)", - "runtimeExecutable": "npx", - "runtimeArgs": ["jest"], + "runtimeExecutable": "npm", + "runtimeArgs": ["run", "test:jest", "--"], "args": [ - "--", "-i", "${relativeFile}", "-t", diff --git a/CHANGELOG.md b/CHANGELOG.md index 3db8d2c4e..963687d7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,19 @@ -# [5.0.0-rc.1](https://github.com/docsifyjs/docsify/compare/v4.13.1...v5.0.0-rc.1) (2025-05-27) +# Changelog + +## [5.0.0-rc.1](https://github.com/docsifyjs/docsify/compare/v4.13.1...v5.0.0-rc.1) (2025-05-27) ### Bug Fixes * auto header config heading generate func ([#2474](https://github.com/docsifyjs/docsify/issues/2474)) ([4bc5062](https://github.com/docsifyjs/docsify/commit/4bc5062fc13a3a43c7ed432f1b585fdab41f1447)) * carbon broken ([#2387](https://github.com/docsifyjs/docsify/issues/2387)) ([87fd55d](https://github.com/docsifyjs/docsify/commit/87fd55d7125539b929f3260fca92e666e988b6da)) -* **ci:** run test action for pull requsts ([#2445](https://github.com/docsifyjs/docsify/issues/2445)) ([15ed3b7](https://github.com/docsifyjs/docsify/commit/15ed3b76b00eac06cc4230b1f592993adf2a893b)) -* correct loadSider=false render structure issue ([#2470](https://github.com/docsifyjs/docsify/issues/2470)) ([7cbd532](https://github.com/docsifyjs/docsify/commit/7cbd5322d056bb87b4340bdb19909a9c32d19abb)) +* **ci:** run test action for pull requests ([#2445](https://github.com/docsifyjs/docsify/issues/2445)) ([15ed3b7](https://github.com/docsifyjs/docsify/commit/15ed3b76b00eac06cc4230b1f592993adf2a893b)) +* correct loadSidebar=false render structure issue ([#2470](https://github.com/docsifyjs/docsify/issues/2470)) ([7cbd532](https://github.com/docsifyjs/docsify/commit/7cbd5322d056bb87b4340bdb19909a9c32d19abb)) * dev mode hot reload and add sourcemaps ([#2402](https://github.com/docsifyjs/docsify/issues/2402)) ([947d8de](https://github.com/docsifyjs/docsify/commit/947d8decb8c5c62f3ce50d0c6ac0e27bb6c7a6b5)) * enhancement of isExternal ([#2093](https://github.com/docsifyjs/docsify/issues/2093)) ([7f13ba0](https://github.com/docsifyjs/docsify/commit/7f13ba0f9841776008d0707f027bd80c4e3cbf0c)) * fix cross-origin links in history router mode ([#1967](https://github.com/docsifyjs/docsify/issues/1967)) ([ef6905b](https://github.com/docsifyjs/docsify/commit/ef6905b53a5c1587c3ebf870f0d11ff111a2350d)) * fix dependabot.yml ([a321e83](https://github.com/docsifyjs/docsify/commit/a321e8373b3c6afc9d0b08714e34bd8bd68716d9)) -* fix docisify-render denpendency. ([#1915](https://github.com/docsifyjs/docsify/issues/1915)) ([c73f858](https://github.com/docsifyjs/docsify/commit/c73f8587b2f67e28c228e521518110ff504cefeb)) +* fix docsify-server-renderer dependency. ([#1915](https://github.com/docsifyjs/docsify/issues/1915)) ([c73f858](https://github.com/docsifyjs/docsify/commit/c73f8587b2f67e28c228e521518110ff504cefeb)) * fix id with pure number. ([#2021](https://github.com/docsifyjs/docsify/issues/2021)) ([f4f21a3](https://github.com/docsifyjs/docsify/commit/f4f21a3f74d265f16b1e658feda417bf851458da)) * genIndex error for search ([#1933](https://github.com/docsifyjs/docsify/issues/1933)) ([a8f9fc1](https://github.com/docsifyjs/docsify/commit/a8f9fc1d5f5c7808efe65e5ca9359f38014b1bcd)) * husky can not auto install issue after upgrade. ([#2325](https://github.com/docsifyjs/docsify/issues/2325)) ([cec43d7](https://github.com/docsifyjs/docsify/commit/cec43d71774556d38fa9746f4df4319a6ad768c2)) @@ -86,8 +88,8 @@ * Add escapeHtml for search ([#1551](https://github.com/docsifyjs/docsify/issues/1551)) ([c24f7f6](https://github.com/docsifyjs/docsify/commit/c24f7f6f0b87a87f6dd3755f69eb0969ebb029c9)) * allow also " inside of an embed ([ec16e4a](https://github.com/docsifyjs/docsify/commit/ec16e4a9d5718ac4f4c25bb3dcaea3b7551372e0)) * buble theme missing generic fallback font ([#1568](https://github.com/docsifyjs/docsify/issues/1568)) ([37d9f0e](https://github.com/docsifyjs/docsify/commit/37d9f0e1214276e93b2a11ed87390aafa1bdbcec)) -* Cannot read property 'classList' of null ([#1527](https://github.com/docsifyjs/docsify/issues/1527)) ([d6df2b8](https://github.com/docsifyjs/docsify/commit/d6df2b85a99371bb9a87402a10dd515bb734182e)), closes [/github.com/docsifyjs/docsify/pull/1527#issuecomment-793455105](https://github.com//github.com/docsifyjs/docsify/pull/1527/issues/issuecomment-793455105) -* Cannot read property 'tagName' of null ([#1655](https://github.com/docsifyjs/docsify/issues/1655)) ([c3cdadc](https://github.com/docsifyjs/docsify/commit/c3cdadc37137edcd9e219359973902d2fc8b66ff)), closes [#1154](https://github.com/docsifyjs/docsify/issues/1154) [/github.com/docsifyjs/docsify/blob/develop/src/core/router/history/html5.js#L25-L27](https://github.com//github.com/docsifyjs/docsify/blob/develop/src/core/router/history/html5.js/issues/L25-L27) [/github.com/docsifyjs/docsify/blob/develop/src/core/router/history/hash.js#L47-L49](https://github.com//github.com/docsifyjs/docsify/blob/develop/src/core/router/history/hash.js/issues/L47-L49) +* Cannot read property 'classList' of null ([#1527](https://github.com/docsifyjs/docsify/issues/1527)) ([d6df2b8](https://github.com/docsifyjs/docsify/commit/d6df2b85a99371bb9a87402a10dd515bb734182e)) +* Cannot read property 'tagName' of null ([#1655](https://github.com/docsifyjs/docsify/issues/1655)) ([c3cdadc](https://github.com/docsifyjs/docsify/commit/c3cdadc37137edcd9e219359973902d2fc8b66ff)) * upgrade debug from 4.3.2 to 4.3.3 ([#1692](https://github.com/docsifyjs/docsify/issues/1692)) ([40e7749](https://github.com/docsifyjs/docsify/commit/40e77490c68b4143c75dfaebcd0b7f640581306b)) * Upgrade docsify from 4.12.0 to 4.12.1 ([#1544](https://github.com/docsifyjs/docsify/issues/1544)) ([d607f6d](https://github.com/docsifyjs/docsify/commit/d607f6d71c35b50f586806a832f65061f5e3427e)) * upgrade dompurify from 2.2.6 to 2.2.7 ([#1552](https://github.com/docsifyjs/docsify/issues/1552)) ([407e4d4](https://github.com/docsifyjs/docsify/commit/407e4d4f3de78bebd639a3fdae751f8045728e57)) @@ -937,7 +939,7 @@ Fix the last release files has the old version marked... ### Bug Fixes -- get file path, fixed jrappen/sublime-distractionless/commit/81bfadd391428823191cc03eca956a2312e04d13#commitcomment-22427070 ([e8117e5](https://github.com/QingWei-Li/docsify/commit/e8117e5)), closes [jrappen/sublime-distractionless/commit/81bfadd391428823191cc03eca956a2312e04d13#commitcomment-22427070](https://github.com/jrappen/sublime-distractionless/commit/81bfadd391428823191cc03eca956a2312e04d13/issues/commitcomment-22427070) +- get file path ([e8117e5](https://github.com/QingWei-Li/docsify/commit/e8117e5)) ### Features @@ -1086,5 +1088,5 @@ Fix the last release files has the old version marked... ### Features - finish ssr ([3444884](https://github.com/QingWei-Li/docsify/commit/3444884)) -- init ocsify-server-renderer ([6dea685](https://github.com/QingWei-Li/docsify/commit/6dea685)) +- init docsify-server-renderer ([6dea685](https://github.com/QingWei-Li/docsify/commit/6dea685)) - support history mode ([f095eb8](https://github.com/QingWei-Li/docsify/commit/f095eb8)) diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 37b6f32cf..86ad48f6b 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -27,5 +27,5 @@ - [Embed Files](embed-files.md) - [UI Kit](ui-kit.md) -- [Awesome docsify](awesome.md) -- [Changelog](changelog.md) +* [Awesome docsify](awesome.md) +* [Changelog](changelog.md) diff --git a/docs/configuration.md b/docs/configuration.md index e4cc24e02..bb5df138c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -72,7 +72,9 @@ window.$docsify = { - Type: `Boolean` - Default: `false` -If `loadSidebar` and `autoHeader` are both enabled, for each link in `_sidebar.md`, prepend a header to the page before converting it to HTML. See [#78](https://github.com/docsifyjs/docsify/issues/78). +If `loadSidebar` and `autoHeader` are both enabled, for each link in `_sidebar.md`, prepend a header to the page before converting it to HTML — but only if the page does not already contain an H1 heading. + +For more details, see [#78](https://github.com/docsifyjs/docsify/issues/78). ```js window.$docsify = { @@ -917,7 +919,7 @@ If you have a link to the homepage in the sidebar and want it to be shown as act For more details, see [#1131](https://github.com/docsifyjs/docsify/issues/1131). -## themeColor ⚠️ +## themeColor ⚠️ :id=themecolor !> Deprecated as of v5. Use the `--theme-color` [theme property](themes#theme-properties) to [customize](themes#customization) your theme color. @@ -931,7 +933,7 @@ window.$docsify = { }; ``` -## topMargin ⚠️ +## topMargin ⚠️ :id=topmargin !> Deprecated as of v5. Use the `--scroll-padding-top` [theme property](themes#theme-properties) to specify a scroll margin when using a sticky navbar. diff --git a/docs/helpers.md b/docs/helpers.md index 57eaa41d0..5d0b03f7c 100644 --- a/docs/helpers.md +++ b/docs/helpers.md @@ -93,6 +93,10 @@ You will get `link`html. Do not worry, you can still set th ```md ![logo](https://docsify.js.org/_media/icon.svg ':class=someCssClass') + + + +![logo](https://docsify.js.org/_media/icon.svg ':class=someCssClass :class=anotherCssClass') ``` ### IDs diff --git a/docs/quickstart.md b/docs/quickstart.md index 4ee626970..e8f33d49c 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -124,7 +124,7 @@ If you want, you can show a loading dialog before docsify starts to render your
Please wait...
``` -You should set the `data-app` attribute if you changed `el`: +By default, the `id` attribute of the main container is `app`. If you want to use a different id, you must also set the `data-app` attribute, and [configure](configuration.md#el) the `el` parameter accordingly: ```html @@ -138,8 +138,6 @@ You should set the `data-app` attribute if you changed `el`: ``` -Compare [el configuration](configuration#el). -