82 Commits

Author SHA1 Message Date
Joe Pea
b960519608
feat: output type definitions, and allow new Docsify(opts) to accept options for ESM usage (#2392)
This `new Docsify(opts)` API can be safely converted to a Custom Element constructor with backwards compatibility later.
2025-12-03 21:49:44 -08:00
Luffy
1abe3a9ea4
feat: add fallback default language support (#2607) 2025-10-15 17:46:51 +08:00
John Hildenbiddle
2e59b0f50c
feat: GitHub style callouts (#2487)
Co-authored-by: Koy Zhuang <koy@ko8e24.top>
Co-authored-by: Luffy <52o@qq52o.cn>
2025-09-01 12:53:59 +08:00
Luffy
b468bcd677
refactor: simplify auto header insertion logic (#2578) 2025-08-02 15:15:36 +08:00
Luffy
72569dee8d
fix: handle hash navigation to prevent duplicate callbacks (#2575) 2025-07-24 11:00:20 +08:00
Luffy
f6ed6d3f89
docs: changes in sync Chinese translation (#2548) 2025-05-08 15:43:44 +08:00
Luffy
5d9ea4f664
update: correct links and action to 'main' branch (#2547) 2025-05-06 17:19:25 +08:00
John Hildenbiddle
77d93fae78
feat: v5 style overhaul (#2469)
Style updates:

- New "core" theme serves as base for all other themes (official and third-party)
- New CSS custom properties for simplified customization of "core" theme
  **Note:** List of available properties will be made available in documentation by embedding soruce CSS in docs after merge. Merge is required because embedded CSS needs to be in `main` branch. For now, see `_vars.css` and `_vars-advanced.css` for details.
- New theme "add-ons" modify core theme properties and/or add custom declarations as needed.
- New Prism.js theme support
- New configurable sidebar toggle design
- New typography defaults to system sans-serif and monospace fonts instead of relying on external web font.
- New "Core Dark" theme addon provide dark theme styles. Can optionally be applied based on operating system's light/dark setting using `@media` attribute on `<link>` element.
- New "Vue" theme addon. Closely replicated popular v4 theme while allowing for v5 enhancements.
- New CSS class names available for adding loading indicators, adding sidebar expand/collapse icons, adding sidebar group styles, clamping sidebar links to a single line with ellipses, and changing the sidebar toggle icon.
- New auto-generated gradient background for cover page (ensure gradient hue is > 50 degree apart, use OKLCH color if supported, randomize grandient angle, reduce brightness in dark mode)
- New button styles (basic, primary, secondary)
- New form element styles (text input, radio, checkbox, )
- New "callouts" (previously "important" and "tip" helpers)
- New default syntax highlighting theme (from [docsify-themeable](https://jhildenbiddle.github.io/docsify-themeable/))
- New auto-generated theme color shade and tint colors
- New auto-generated monochromatic color palette
- New form element styles (fields, legend, text input, text area, checkbox, radio, toggles, and select)
- New "headerless" tables
- New `kbd` styles
- New task list style
- New merged navbar styles (consistent with sidebar nav styles)
- New search plugin styles and keyboard shortcut indicators
- Add ability restore previously focused content element after hiding sidebar
- Add "focus trap" when sidebar is visible on mobile (accessibility)
- Add ability for sidebar links to wrap by default (previous single-line w/ ellipsis display available as CSS class on `<body>` option)
- Add sidebar `page-link`, `group`, and `group-title` CSS classes to sidebar markup.
- Add reduced motion media query to set all animation/transition timings to zero
- Update Google Font imports (use new variable vs older fixed width fonts)
- Update primary/secondary button order on coverpage (primary should be first)
- Fix missing merged navbar when loading at desktop resolution then resizing to mobile
- Fix inverted open/close sidebar visibility state at desktop/mobile resolutions
- Fix overflow setting to prevent clipping of element focus ring
- Fix safe area inset margins on mobile in landscape orientation
- Fix inverted "tip" and "warn" class names
- Fix scroll padding to prevent headers from touching top edge of viewport when scrolled to
- Remove Stylus dependency (now using only PostCSS)
- Remove legacy themes "Buble", "Dark", "Dolphin", and "Pure".

Documentation updates:

- New "UI Kit" page showcasing all elements styled by Docsify
- Update "Quick Start" page template
- Update "Adding pages" page with information on how to properly create sidebar group titles and navbar drop-down menus
- Update "Themes" page with theme and class toggles
- Update "Configuration" page with deprecation warnings for `themeColor` and `topMargin`
- Move "Edit Page" link to footer
- Remove [docsify-themeable](https://jhildenbiddle.github.io/docsify-themeable/) endorsement (currently not compatible with v5 and future is unknown)

Miscellaneous updates:

- New search plugin options: `insertBefore` and `insertAfter`
- Add PostCSS config file
- Update BrowserSync config (disable "ghost" mode)
- Update tests
- Fix Jest + Prettier 3 conflict
- Fix `getAndRemoveDocisfyIgnoreConfig` name type (now `Docisfy` => `Docsify`)
- Fix execution of sidebar-generating code when `hiddenSidebar` is `true`
- Remove `inBrowser` constant (SSR deprecated, so no longer needed)
2024-07-19 15:34:51 +00:00
John Hildenbiddle
8ef9a3cd03
Fix: Vue text interpolation in code blocks. (#2430)
* Update Vue 3 depenency and docs. Remove Vue 2.

* Fix minor lint issue

* Remove Vue 2 reference

* Swap button positions

* Update Vue2 links

* Send HTML with _blank to avoid quirks mode

* Support Vue text interpolation in code blocks

Fix #1812
2024-05-19 11:49:33 -05:00
Luiz Carlos
806d37bdf0
docs: Update logo doc (#2347)
Co-authored-by: Lu Fei <52o@qq52o.cn>
2023-12-21 10:50:43 +08:00
John Hildenbiddle
cf61192f9a
feat: Keyboard bindings (#2279)
Co-authored-by: Lu Fei <52o@qq52o.cn>
2023-12-05 08:09:52 +08:00
John Hildenbiddle
50b84f74b2
feat: Add "Skip to main content" link and update nav behavior (#2253)
Co-authored-by: Joe Pea <trusktr@gmail.com>
Co-authored-by: Koy Zhuang <koy@ko8e24.top>
2023-11-30 13:11:21 +08:00
John Hildenbiddle
dac8e59bb7
Feat: Improved error handling and response status availability (#2303)
* Add response data to route object
* Display error status and description on content fetch error
* Fix issue where initial site render was incomplete on content fetch error
* Fix issue where empty markdown pages/routes were handled as 404 errors
* Fix incorrect `notFoundPage` default value
2023-11-17 07:27:09 -06:00
Lu Fei
6464cf533d
docs: fix missing references (#2163) 2023-08-08 00:20:23 +08:00
Koy
4c2e6304cb
update(doc): fix themeColor in configuration. (#2160) 2023-08-03 20:39:49 +08:00
Joe Pea
b18865d53b
Merge branch 'develop' into modernize-source-code 2023-07-16 10:30:01 -07:00
Joe Pea
b621e0e4e7 chore: update miscellaneous parts of the source to reasonably modern language alternatives, remove polyfills, improve some JSDoc comments, remove traces of IE
BREAKING: In a minority of cases syntax updates may break apps running in very old browsers (such as Internet Explorer), or apps that build Docsify in a custom way with old build tools. To upgrade, build Docsify for older browsers in a custom way, or update existing build tools to handle newer syntax.

DEPRECATED: `$docsify.themeColor` is deprecated and will be eventually removed, use a `--theme-color` CSS variable in your style sheet.
2023-07-03 01:50:00 -07:00
Joe Pea
e07060ad14 add a note about making an alias for _sidebar.md when using routerMode: 'history' 2023-01-22 19:51:33 -08:00
Joe Pea
3feebc0be6 add notes on "hash" vs "history" routing in the config docs 2023-01-22 19:32:44 -08:00
Joe Pea
ef6905b53a
fix: fix cross-origin links in history router mode (#1967) 2023-01-23 01:54:30 +08:00
Roy Sommer
8cbc7c8073
Virtual Routes Support (#1799)
* add first test

* new VirtualRoutes mixin that handles routes. fetch tries to use VirtualRoutes. default config updated

* cover all basic use cases

* regex matching in routes

* covered all virtual routes tests

* added hack to fix config test on firefox

* removed formatting regex matches into string routes

* added support for "next" function

* added docs

* navigate now supports both hash and history routerModes

* waiting for networkidle in navigateToRoute helper

* promiseless implementation

* remove firefox workaround from catchPluginErrors test, since we no longer use promises

* updated docs

* updated docs for "alias" as well

* minor rephrasing

* removed non-legacy code from exact-match; updated navigateToRoute helper to infer router mode from page

* moved endsWith from router utils to general utils; added startsWith util; refactored makeExactMatcher to use both

* updated docs per feedback

* moved navigateToRoute helper into the virtual-routes test file

* moved navigateToRoute to top of file

* updated docs per pr comments
2022-05-23 14:03:33 -07:00
John Hildenbiddle
6f4f09bd7e
docs: Update configuration options (#1773) 2022-03-18 10:52:29 -05:00
John Hildenbiddle
63b2535a45
feat: Plugin error handling (#1742) 2022-03-15 00:18:50 -05:00
John Hildenbiddle
35002c92b7
feat: Native emoji w/ image-based fallbacks and improved parsing (#1746)
* Render native emoji with image fallback

Fix #779

* Deprecate emoji plugin

* Add emoji tests

* Remove console.log statement

* Fix emoji image alt attribute

* Set nativeEmoji to false by default (non-breaking)

* Fix parsing emoji in HTML comments and script tags

* Add nativeEmoji and update noEmoji details

* Add Emoji plugin deprecation notice

* Fix ESLint issues

* Create build:emoji task

- Auto-generate emoji data from GitHub API
- Auto-generate emoji markdown for website
- Add emoji page to navigation

* Fix rendering of GitHub emoji without unicode

* Adjust and match size of native and image emoji

* Update emoji test snapshot

* Update docs test snapshot

* Fix ci/codesandbox error

* Update native emoji font-stack

* Fix rendering of native multi-character emoji

* Kick GitHub Workflow

* Replace rollup’s uglify plugin with terser

* Switch “npm ci” instead of “npm i” for stability

* Change emoji data from default to named export

* Revert "Replace rollup’s uglify plugin with terser"

This reverts commit 7ba85136361c72839516900d91cca806fac94fee.

* Revert "Switch “npm ci” instead of “npm i” for stability"

This reverts commit d52b476a387250740d934e8fd7df7ba274dd17a0.

* Revert "Change emoji data from default to named export"

This reverts commit 3f2dd467cf9c7a74d8c53c2ee52cc63837b00a3c.

* Specify codesandbox template and node version

* Update codesandbox config

* Revert "Revert "Replace rollup’s uglify plugin with terser""

This reverts commit e06fed49f0383c485e01f1758228849ad0085bc8.

* Revert "Revert "Revert "Replace rollup’s uglify plugin with terser"""

This reverts commit 27d49521f61976dedcbbf210e1811839853e0e47.

* Update codesandbox config

* Revert "Update codesandbox config"

This reverts commit 5120dd23d45fbd4b2c893db33acbf7014e57c023.

* Fix codesandbox uglify error

* Emoji docs tweaks

* Restore and update emoji plugin code

* Restore and update emoji plugin docs

* Prettier updates

* Match lowercase shortcodes only

Co-authored-by: Koy Zhuang <369491420@qq.com>
2022-03-05 22:25:09 -06:00
Joe Pea
760e0c7983
docs: update noCompileLinks documentation (#1666)
Co-authored-by: 沈唁 <52o@qq52o.cn>
2021-11-19 17:19:45 +08:00
2jun0
57dc8a9238
docs: Update nameLink in configuration.md (#1653)
Like [this commit](https://github.com/docsifyjs/docsify/pull/1651), thie configuration.md page needs to be updated.

Co-authored-by: 沈唁 <52o@qq52o.cn>
2021-10-22 09:50:34 +08:00
John Jago
97806cb757
docs: improve English wording (Getting Started/Customization) (#1617)
While referencing the documentation, I noticed a few phrases that could
be changed to sound more natural. I tried to keep the original meanings.
2021-07-30 10:18:00 +08:00
Mark Battistella
6c13bdb7bd
docs: Updated alias (#1511)
The expression in alias `(+*)` is invalid and a correct working method would be `(.*)`
2021-02-15 09:48:00 +08:00
John Hildenbiddle
7cf1e7c27a Update Vue-related descriptions and links 2020-11-19 15:42:51 -06:00
John Hildenbiddle
9a1935ac64 Add support for Vue shorthand directive syntax 2020-11-15 13:34:03 -06:00
John Hildenbiddle
a10fcbd9a6 Update Vue-related descriptions 2020-11-12 17:25:48 -06:00
John Hildenbiddle
69efae3c4f Fix typos 2020-11-11 16:27:14 -06:00
John Hildenbiddle
727ee8fc6d Rename vueMountOptions to vueMounts 2020-11-11 16:24:50 -06:00
John Hildenbiddle
421ef1d442 Update docs 2020-11-10 23:24:21 -06:00
John Hildenbiddle
86dae610de Rename vueOptions to vueMountOptions 2020-10-21 13:14:07 -05:00
John Hildenbiddle
5a2dde1624 Update docs 2020-10-20 17:45:34 -05:00
Koy
0ef6aa8ab3
docs: add crossOriginLinks configurations details. (#1386) 2020-10-08 07:00:08 +08:00
Bharat Patodi
1a64dc847f
chore: grammatical changes (#1296)
* Make grammatical changes

Minor changes.
Solely for improving readability.

* Update changes

Co-authored-by: 沈唁 <52o@qq52o.cn>
2020-07-26 14:49:02 +05:30
Joe Pea
809fda9591
Merge branch 'develop' into allow-config-function 2020-06-07 14:10:57 -07:00
Joe Pea
5a5b5aa932 update docs regarding configs as functions 2020-05-22 01:42:40 -07:00
Gabin Aureche
455f4c4a09 docs(configuration): mention active link pitfall for the homepage 2020-05-15 09:20:00 +02:00
Emerson Jair
d5a7507af2
Fix typo on externalLinkRel
Also, add a link explaining why that can be a security issue.
2020-05-04 07:57:24 -03:00
Joe Pea
b2e6123980
Update nameLink option docs (#1125) 2020-04-19 21:02:07 +05:30
Leonardo Rossi
b53ea1e304
Adds option to specify an header height (#1045)
* Adds option to specify an header height

When using a template that has a sticky-header, clicking on the sidebar will
scroll the page under the header.

I added the option `headerHeight` (default = `0`) so that the content div will
be scrolled down that amount of pixels.

* updates documentation and renames variable
2020-03-09 14:19:31 +05:30
Anix
b7547f151e
feat: new option hideSidebar (#1026)
* feat: new option hideSidebar

* chore: removed the console logs

* chore: linting fixes

* chore: test fix
2020-02-20 22:19:31 +05:30
Anix
a111df9980
chore: documented __colon__ tip (#1025) 2020-02-14 20:41:53 +05:30
Joe Pea
67a981b8d9
update docs for the name config option 2019-12-29 12:28:26 -08:00
cinwell.li
8416275e25 docs: about cache (#854) 2019-12-22 17:16:23 +05:30
Vaishak Kallore
11762cbb73 Merged upstream develop and resolved the conflict 2019-12-02 18:04:59 +05:30
Mt
e61410a757 add new config cornerExternalLinkTarget for the corner link target
rm   CNAME

add CNAME

add repo test

back to the origin index.html

fix: the Git corner displayed bigger when the externalLinkTarget = ''

[update] a new independent config for corner link target attribute.

[update doc] add the `cornerExternalLinkTarget` config in the doc.
2019-12-02 18:10:42 +08:00