31 Commits

Author SHA1 Message Date
Joe Pea
7bbf13d9bd
Ensure code format (#2138)
* chore: add missing Vue support for Vercel builds

* refactor: move some functions and module-level state into classes as private methods and properties to start to encapsulate Docsify

Also some small tweaks:

- move initGlobalAPI out of Docsify.js to start to encapsulate Docsify
- move ajax to utils folder
- fix some type definitions and improve content in some JSDoc comments
- use concise class field syntax
- consolidate duplicate docsify-ignore comment removal code

This handles a task in [Simplify and modernize Docsify](https://github.com/docsifyjs/docsify/issues/2104), as well as works towards [Encapsulating Docsify](https://github.com/docsifyjs/docsify/issues/2135).

* chore: add prettier code format check to our lint script, and add a prettier script for manually formatting the whole code base

* chore: update issue/pr templates

* chore: apply our format to the whole code base


---------

Co-authored-by: Koy <koy@ko8e24.top>
Co-authored-by: i544693 <369491420@qq.com>
2023-08-09 17:53:30 +08: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
62d756c447 refactor: convert to ES Modules and remove traces of CommonJS except in Rollup config because some dependencies are still CommonJS
BREAKING: The new project layout might break in some tooling setups.

We've added an exports field to `package.json` to specify where
statements like `import ... from 'docsify'` will import from, and left
the `main` and `unpkg` fields as-is for backwards compatibility with the
global <script> import method. Most people who use a non-module
`<script>` tag to import Docsify will not notice a difference. Anyone
else who is importing Docsify into a specilized build setup using
`import` statements has a chance of being broken, so we've marked this
as BREAKING.
2023-06-29 19:02:08 -07:00
Joe Pea
8d5d20480a refactor: delete the experimental and incomplete SSR feature
BREAKING: SSR removed

Anyone depending on SSR will need to stay on an old Docsify version for
now, move forward without SSR, or maintain SSR against a fork of updated
Docsify. We have ideas on a better way to implement SSR, but these ideas
have not been implemented yet.
2023-06-25 12:03:44 -07:00
Julien Wajsberg
3fbb9b299a
Fix the end condition for the embed content handling loop (#1824)
Co-authored-by: Koy Zhuang <koy@ko8e24.top>
2023-05-18 14:13:56 +08:00
John Hildenbiddle
c49c39a4a2
refactor: Update test environments and lint configuration (#1736)
* Update test environments and lint configuration

Update Jest (unit + integration) and Playwright (e2e) test environments. Includes stability improvements for e2e tests using newer, more stable methods per the Playwright docs.

- Update Jest 26 => 27
- Update Jest-related libs (babel parser)
- Update Playwright 1.8 => Playwright Test 1.18
- Update GitHub CI (action versions, job parallelization, and matrices)
- Update ESLint 5 => 8
- Update ESLint-related libs (parser, prettier, Jest, Playwright)
- Fix test failures on M1-based Macs
- Fix e2e stability issues by replacing PW $ method calls
- Fix ESLint errors
- Fix incorrect CI flag on Jest runs (-ci => --ci)
- Refactor e2e test runner from Jest to Playwright Test
- Refactor e2e test files for Playwright Test
- Refactor fix-lint script name to lint:fix for consistency
- Refactor npm scripts order for readability
- Remove unnecessary configs and libs
- Remove example image snapshots
2022-01-30 21:40:21 -06:00
John Hildenbiddle
06cbebfc0d
fix: Use legacy-compatible methods for IE11 (#1495) 2021-02-07 10:44:18 -06:00
John Hildenbiddle
0afbf96701
Fix eslint warnings (#1388) 2020-10-08 21:58:30 -05:00
Snyk bot
086c2859ad
[Snyk] Security upgrade marked from 0.7.0 to 1.1.1 (#1313)
* fix: package.json & package-lock.json to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-MARKED-584281

* fix: fix CompileError

* fix: embed files error

Co-authored-by: Koy <369491420@qq.com>
Co-authored-by: 沈唁 <52o@qq52o.cn>
2020-08-14 07:53:23 +08:00
Anix
5ea28c465a
Merge pull request #1102 from tschaible/bugfix/multiple-embeds
fix: updated the insertion of embedded tokens for async returns (fixes #970)
2020-05-22 15:29:10 +05:30
Anix
3d662a5bf7 fix: fixed target and rel issue (fixes #1183) 2020-05-20 11:14:26 +00:00
Sytone
b05949a161 Add front matter to dev page
Update embeded files documentation
Add example with front matter
Add various comments I used to understand code
Updated front matter to have installed flag
Added function to parse front matter
Added intercept to remove front matter for embed
2020-04-27 12:24:24 -07:00
Tom Schaible
ea17dcc66c updated the insertion of embedded tokens so it correctly handles embedded token results returning in any order
fixes #970
2020-04-07 08:21:24 -04:00
Anix
9afa66607d chore: removed circular dep and css.escape 2020-03-09 20:33:07 +05:30
Martin Mihálek
291c99bc38
Migrate relative links to absolute in embedded markdown (#867)
Signed-off-by: Martin Mihálek <aenniw@gmail.com>
2020-03-09 14:21:46 +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
75c72e917b
chore: added new linter config (#1028)
* chore: added new linter config

* chore: linting fixes

* chore: refactore in linting config and minor linting fixes
2020-02-20 14:01:04 +05:30
Muhammad Surya
7fb50b95f1 strip indent when embedding code fragment 2020-01-05 11:28:38 +07:00
Giulio Ambrogi
db97a1d22a Eslint fixes for v4x (#989)
* UPDATE .eslintrc

* UPDATE lint task

* FIX lint errors

* CLEANUP

* FIX no-eq-null warning

* FIX many jsdoc warnings

* FIX jsdoc issues

* FIX jsdoc warnings

* FIX jsdoc

* FIX eqeq and no-eq-null

* ADD lint to travis

* UPDATE test env for eslint
2019-12-30 22:01:46 +05:30
Anton Wilhelm
1447c8a40a feat: Provide code fragments feature (#748) 2019-01-23 10:54:50 +08:00
程康
5fcf210dd1 fix: use copy of cached value (#668) 2018-11-01 08:04:25 +08:00
qingwei.li
4f588e0af4 fix(compiler): extra quotes for codeblock 2018-10-31 21:19:35 +08:00
cinwell.li
a39b214733
feat: upgrade marked to 0.5.x, fixed #645, close #644 (#662) 2018-10-31 20:34:56 +08:00
Carlos García
42ea8af245 feat(compiler): support embedded mermaid (#629) 2018-10-23 15:29:14 +08:00
cinwell.li
feea7f9b48
fix: loading embed files synchronously, fixed #525, fixed #527 (#544)
* fix: loading embed files synchronously, fixed #525, fixed #527

* fix
2018-06-29 21:27:07 +08:00
cinwell.li
8352a1e489
refactor: build config (#408)
* refactor: build config

* chore: fix conflict

* fix: 404 page path
2018-03-03 22:51:27 +08:00
qingwei.li
45a7464d23 fix(embed): broken in IE, fixed #389, fixed #391 2018-02-14 13:16:38 +08:00
qingwei.li
890a7bf9b6 fix(embed): init value 2018-02-12 16:45:24 +08:00
qingwei.li
4aafde85fb chore: remove console.log 2018-02-12 16:25:28 +08:00
qingwei.li
dc0c3ced4e fix(embed): compatible ssr 2018-02-12 16:25:28 +08:00
qingwei.li
62ce447fc3 refactor(embed): async fetch embed files, fixed #387 2018-02-12 16:25:28 +08:00