43 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
9cb76027cd Merge branch 'es-modules' into update-rollup
* es-modules:
  feat: add google analytics gtag.js plugin (#1702)
  chore: bump conventional-changelog-cli from 2.2.2 to 3.0.0 (#2085)
2023-07-02 12:48:13 -07:00
Joe Pea
d34fef3635 Merge branch 'develop' into es-modules 2023-07-02 12:17:19 -07:00
Joe Pea
103dde845f Merge branch 'develop' into delete-ssr
* develop:
  feat: add google analytics gtag.js plugin (#1702)
  chore: bump conventional-changelog-cli from 2.2.2 to 3.0.0 (#2085)
2023-06-29 19:55:12 -07:00
Joe Pea
7a972d402a chore: update rollup
Update rollup and plugins, and remove some plugins. We'll use Rollup for
now only to bundle and minify our code, but otherwise we'll write
reasonably modern code and not need a transform.
2023-06-29 19:20:15 -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
Eko Zhan
29f3c82faa
feat: add google analytics gtag.js plugin (#1702)
Co-authored-by: Joe Pea <joe@trusktr.io>
Co-authored-by: 沈唁 <52o@qq52o.cn>
Co-authored-by: John Hildenbiddle <jhildenbiddle@users.noreply.github.com>
Co-authored-by: zhanzhao <zhanzhao@megvii.com>
2023-06-27 10:54:16 +08: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
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
Mohammed Sahl
3673001a24
fix: Add error handling for missing dependencies (fixes #1210) (#1232)
* Add error handling for missing dependencies

* Informative error message

* Add error handling for missing dependencies

* Informative error message

* Add dependecy import location, error message changes
2020-06-23 22:03:22 +05:30
Joe Pea
88033b639e remove the DOCSIFY global made by Rollup, and move Docsify into a separate file where we can import it from tests while leaving the entry point for the bundle without any exports so that Rollup will not create a global variable from it 2020-06-07 11:09:06 -07:00
Joe Pea
7e002bf939 feat: update src/core/index.js to export all global APIs, deprecate old globals in favor of a single global DOCSIFY, and add tests for this 2020-05-23 14:10:00 -07:00
Joe Pea
b72cb3d94c add build error handling so builds don't silently fail 2020-05-22 23:59:25 -07:00
Andrey Chalkin
615205cfdb fix: npm audit issues (#934) 2019-10-16 09:20:54 -04:00
Anton Wilhelm
3f50381090 Add matomo plugin to build script 2019-05-05 18:12:13 +02:00
qingwei.li
2bc880d335 fix: ssr package dep, fixed #605 2018-10-31 21:11:06 +08:00
John Hildenbiddle
94bc415534 feat: Add docsify version to $window.docsify object (#641)
Fix #521

Please makes sure these boxes are checked before submitting your PR, thank you!

* [ x ] Make sure you are merging your commits to `master` branch.
* [ x ] Add some descriptions and refer relative issues for you PR.
* [ x ] DO NOT include files inside `lib` directory.
2018-10-23 15:26:55 +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
342438f2a7 fix: build config 2018-02-11 22:22:06 +08:00
cinwell.li
820abeb0fd chore: upgrade deps (#338) 2018-02-11 22:22:06 +08:00
qingwei.li
66c8fd501a fix: remove codesponsor 2017-12-13 10:29:53 +08:00
spiritree
9208e64939 feat: add gitalk plugin (#306) 2017-11-09 20:53:07 +08:00
qingwei.li
fd7d4e0e4e feat: add disqus plugin, closed #123 2017-11-04 13:54:37 +08:00
qingwei.li
ae3f74bfd4 chore: add build script 2017-09-20 09:01:31 +08:00
Kim Burgess
e54062f80d Remove unnecessary moduleName option from rollup config for plugins (#209) 2017-07-18 17:44:25 +08:00
qingwei.li
22b50f07c3
fix: auto replace version 2017-05-31 08:25:00 +08:00
qingwei.li
8b696cd99d bump: 3.4.0 2017-03-09 20:30:38 +08:00
qingwei.li
50fa6fcb89 feat(zoom-image): add plugin 2017-03-09 20:26:33 +08:00
qingwei.li
9e7d365872 bump: 3.3.0 2017-03-07 12:00:23 +08:00
Leopoldthecoder
1aa6636ba8 add external-script plugin 2017-03-06 23:57:28 +08:00
qingwei.li
855c450a97 feat(emoji): add emoji plugin 2017-02-22 22:30:07 +08:00
qingwei.li
dbb92782cf feat(front-matter): add front matter[WIP] 2017-02-19 14:38:38 +08:00
qingwei.li
079bd00395 refactor(plugins): update search plugin 2017-02-19 14:38:38 +08:00
qingwei.li
8bee8f0213 refactor(core): add render 2017-02-19 14:38:38 +08:00
cinwell.li
ac61bb0e75 feat(plugins): add Google Analytics plugin (#66) 2017-02-09 22:16:15 +08:00
qingwei.li
eb5ff3e987 feat: add search, close #43 2017-02-09 21:24:14 +08:00
cinwell.li
35d3bd1647 customize sidebar and navbar via markdown file, #6 (#8)
* Refactor: use iife

* Feat: customize sidebar and navbar via markdown file, #6

* Add changelog
2016-11-29 01:07:47 +08:00
qingwei.li
4f27fff283 Remove dynamic title 2016-11-26 18:51:44 +08:00
qingwei.li
681a51a52d fix build file 2016-11-26 14:28:21 +08:00
qingwei.li
8210a19dd3 Remove plugins 2016-11-26 14:09:06 +08:00
qingwei.li
6f89c530ed Remove test folder 2016-11-22 22:46:44 +08:00
qingwei.li
e82b5c58bc Add vue theme 2016-11-20 22:29:36 +08:00