diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 0bd565e..0000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,2 +0,0 @@ - \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..35d6b90 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + + + + + +## Bug Report + +#### Steps to reproduce + + + +#### What is current behaviour + + + +#### What is the expected behaviour + + + +#### Other relevant information + + +- [ ] Bug does still occur when all/other plugins are disabled? + +- Your OS: +- Node.js version: +- npm/yarn version: +- Browser version: +- Docsify version: +- Docsify plugins: + + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..501e4de --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,25 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + + + + + +## Feature request + +#### What problem does this feature solve? + + + +#### What does the proposed API look like? + + + +#### How should this be implemented in your opinion? + + + +#### Are you willing to work on this yourself? diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 79a5281..bb31bd4 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,54 @@ -Please makes sure these boxes are checked before submitting your PR, thank you! + + + + + + +**Summary** + +**What kind of change does this PR introduce?** (check at least one) + +- [ ] Bugfix +- [ ] Feature +- [ ] Code style update +- [ ] Refactor +- [ ] Docs +- [ ] Build-related changes +- [ ] Other, please describe: + +If changing the UI of default theme, please provide the **before/after** screenshot: + +**Does this PR introduce a breaking change?** (check one) + +- [ ] Yes +- [ ] No + +If yes, please describe the impact and migration path for existing applications: + +**The PR fulfills these requirements:** + +- [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number) + +You have tested in the following browsers: (Providing a detailed version will be better.) + +- [ ] Chrome +- [ ] Firefox +- [ ] Safari +- [ ] Edge +- [ ] IE + +If adding a **new feature**, the PR's description includes: + +- [ ] A convincing reason for adding this feature +- [ ] Related documents have been updated +- [ ] Related tests have been updated + +To avoid wasting your time, it's best to open a **feature request issue** first and wait for approval before working on it. + + +**Other information:** + +--- -* [ ] Make sure you are merging your commits to `master` branch. -* [ ] Add some descriptions and refer relative issues for you PR. * [ ] DO NOT include files inside `lib` directory. + diff --git a/.gitignore b/.gitignore index 556ff6c..ea4b5b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ *.log .DS_Store -/themes/* -!.gitkeep +.idea node_modules -/lib/ -.idea \ No newline at end of file +themes/ +lib/ + +# exceptions +!.gitkeep \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7da95ca..267d402 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,61 @@ + +## [4.9.4](https://github.com/docsifyjs/docsify/compare/v4.9.2...v4.9.4) (2019-05-05) + + + + +## [4.9.2](https://github.com/docsifyjs/docsify/compare/v4.9.1...v4.9.2) (2019-04-21) + + +### Bug Fixes + +* re-render gitalk when router changed ([11ea1f8](https://github.com/docsifyjs/docsify/commit/11ea1f8)) + + +### Features + +* allows relative path, fixed [#590](https://github.com/docsifyjs/docsify/issues/590) ([31654f1](https://github.com/docsifyjs/docsify/commit/31654f1)) + + + + +## [4.9.1](https://github.com/docsifyjs/docsify/compare/v4.9.0...v4.9.1) (2019-02-21) + + +### Bug Fixes + +* github assets url ([#774](https://github.com/docsifyjs/docsify/issues/774)) ([140bf10](https://github.com/docsifyjs/docsify/commit/140bf10)) + + + + +# [4.9.0](https://github.com/docsifyjs/docsify/compare/v4.8.6...v4.9.0) (2019-02-19) + + +### Bug Fixes + +* task list rendering (Fix [#749](https://github.com/docsifyjs/docsify/issues/749)) ([#757](https://github.com/docsifyjs/docsify/issues/757)) ([69ef489](https://github.com/docsifyjs/docsify/commit/69ef489)) +* upgrade npm-run-all ([049726e](https://github.com/docsifyjs/docsify/commit/049726e)) + + +### Features + +* **search-plugin:** add namespace option ([#706](https://github.com/docsifyjs/docsify/issues/706)) ([28beff8](https://github.com/docsifyjs/docsify/commit/28beff8)) +* Add new theme "dolphin" ([#735](https://github.com/docsifyjs/docsify/issues/735)) ([c3345ba](https://github.com/docsifyjs/docsify/commit/c3345ba)) +* Provide code fragments feature ([#748](https://github.com/docsifyjs/docsify/issues/748)) ([1447c8a](https://github.com/docsifyjs/docsify/commit/1447c8a)) + + + + +## [4.8.6](https://github.com/docsifyjs/docsify/compare/v4.8.5...v4.8.6) (2018-11-12) + + +### Bug Fixes + +* IE10 compatibility ([#691](https://github.com/docsifyjs/docsify/issues/691)) ([4db8cd6](https://github.com/docsifyjs/docsify/commit/4db8cd6)) + + + ## [4.8.5](https://github.com/docsifyjs/docsify/compare/v4.8.4...v4.8.5) (2018-11-02) diff --git a/README.md b/README.md index a1ae1c8..b8da0d8 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ ## Links +- [`develop` branch preview](https://docsifyjs.netlify.com/) - [Documentation](https://docsify.js.org) - [CLI](https://github.com/docsifyjs/docsify-cli) - CDN: [UNPKG](https://unpkg.com/docsify/) | [jsDelivr](https://cdn.jsdelivr.net/npm/docsify/) | [cdnjs](https://cdnjs.com/libraries/docsify) @@ -40,7 +41,7 @@ - Smart full-text search plugin - Multiple themes - Useful plugin API -- Compatible with IE10+ +- Compatible with IE11 - Support SSR ([example](https://github.com/docsifyjs/docsify-ssr-demo)) - Support embedded files @@ -54,7 +55,7 @@ Look at [this tutorial](https://docsify.js.org/#/quickstart) These projects are using docsify to generate their sites. Pull requests welcome :blush: -Move to [awesome-docsify](https://github.com/docsifyjs/awesome-docsify) +Move to [awesome-docsify](https://github.com/docsifyjs/awesome-docsify#showcase) ## Similar projects diff --git a/build/build.js b/build/build.js index b9068b9..7b61224 100644 --- a/build/build.js +++ b/build/build.js @@ -55,6 +55,7 @@ const buildAllPlugin = function () { var plugins = [ {name: 'search', input: 'search/index.js'}, {name: 'ga', input: 'ga.js'}, + {name: 'matomo', input: 'matomo.js'}, {name: 'emoji', input: 'emoji.js'}, {name: 'external-script', input: 'external-script.js'}, {name: 'front-matter', input: 'front-matter/index.js'}, diff --git a/build/release.sh b/build/release.sh old mode 100644 new mode 100755 index da15a38..a328322 --- a/build/release.sh +++ b/build/release.sh @@ -29,7 +29,6 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then # commit git add -A - git add -f lib/ -A git commit -m "[build] $VERSION $RELEASE_TAG" npm --no-git-tag-version version $VERSION --message "[release] $VERSION $RELEASE_TAG" diff --git a/docs/README.md b/docs/README.md index d27f1ae..e625420 100644 --- a/docs/README.md +++ b/docs/README.md @@ -16,12 +16,12 @@ See the [Quick start](quickstart.md) guide for more details. - Multiple themes - Useful plugin API - Emoji support -- Compatible with IE10+ +- Compatible with IE11 - Support server-side rendering ([example](https://github.com/docsifyjs/docsify-ssr-demo)) ## Examples -Check out the [Showcase](https://github.com/docsifyjs/docsify/#showcase) to see docsify in use. +Check out the [Showcase](https://github.com/docsifyjs/awesome-docsify#showcase) to see docsify in use. ## Donate diff --git a/docs/_coverpage.md b/docs/_coverpage.md index b41ef22..1decbd6 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -1,6 +1,6 @@  -# docsify 4.8.5 +# docsify 4.9.4 > A magical documentation site generator. diff --git a/docs/_media/example.js b/docs/_media/example.js new file mode 100644 index 0000000..7b6f668 --- /dev/null +++ b/docs/_media/example.js @@ -0,0 +1,16 @@ +import fetch from 'fetch' + +const URL = 'https://example.com' +const PORT = 8080 + +/// [demo] +const result = fetch(`${URL}:${PORT}`) + .then(function(response) { + return response.json(); + }) + .then(function(myJson) { + console.log(JSON.stringify(myJson)); + }); +/// [demo] + +result.then(console.log).catch(console.error) diff --git a/docs/configuration.md b/docs/configuration.md index 830748f..ba48475 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -150,6 +150,46 @@ window.$docsify = { }; ``` +## relativePath + +- Type: `Boolean` +- Default: `false` + +If **true** links are relative to the current context. + +For example, the directory structure is as follows: + +```text +. +βββ docs + βββ README.md + βββ guide.md + βββ zh-cn + βββ README.md + βββ guide.md + βββ config + βββ example.md +``` + +With relative path **enabled** and current URL `http://domain.com/zh-cn/README`, given links will resolve to: + +```text +guide.md => http://domain.com/zh-cn/guide +config/example.md => http://domain.com/zh-cn/config/example +../README.md => http://domain.com/README +/README.md => http://domain.com/README +``` + +```js +window.$docsify = { + // Relative path enabled + relativePath: true, + + // Relative path disabled (default value) + relativePath: false +}; +``` + ## coverpage - Type: `Boolean|String|String[]|Object` diff --git a/docs/deploy.md b/docs/deploy.md index fdf0167..a879f2e 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -15,7 +15,7 @@ It is recommended that you save your files to the `./docs` subfolder of the `mas  !> You can also save files in the root directory and select `master branch`. -You'll need to place a `.nojekyll` file in the deploy location (such as `/docs` or the gh-pages branch +You'll need to place a `.nojekyll` file in the deploy location (such as `/docs` or the gh-pages branch) ## GitLab Pages @@ -87,3 +87,45 @@ When using the HTML5 router, you need to set up redirect rules that redirect all ```sh /* /index.html 200 ``` + +## AWS Amplify + +1. Set the routerMode in the Docsify project `index.html` to *history* mode. + +```html + +``` + +2. Login to your [AWS Console](https://aws.amazon.com). +3. Go to the [AWS Amplify Dashboard](https://aws.amazon.com/amplify). +4. Choose the **Deploy** route to setup your project. +5. When prompted, keep the build settings empty if you're serving your docs within the root directory. If you're serving your docs from a different directory, customise your amplify.yml + +```yml +version: 0.1 +frontend: + phases: + build: + commands: + - echo "Nothing to build" + artifacts: + baseDirectory: /docs + files: + - '**/*' + cache: + paths: [] + +``` + +6. Add the following Redirect rules in their displayed order. + +| Source address | Target address | Type | +|----------------|----------------|---------------| +| /<*>.md | /<*>.md | 200 (Rewrite) | +| /<*> | /index.html | 200 (Rewrite) | + diff --git a/docs/embed-files.md b/docs/embed-files.md index a935dd3..dab2efe 100644 --- a/docs/embed-files.md +++ b/docs/embed-files.md @@ -39,6 +39,21 @@ You will get it [filename](_media/example.md ':include :type=code') +## Embedded code fragments +Sometimes you don't want to embed a whole file. Maybe because you need just a few lines but you want to compile and test the file in CI. + +```markdown +[filename](_media/example.js ':include :type=code :fragment=demo') +``` + +In your code file you need to surround the fragment between `/// [demo]` lines (before and after the fragment). +Alternatively you can use `### [demo]`. + +Example: + +[filename](_media/example.js ':include :type=code :fragment=demo') + + ## Tag attribute If you embed the file as `iframe`, `audio` and `video`, then you may need to set the attributes of these tags. diff --git a/docs/index.html b/docs/index.html index e07c79e..6d0e008 100644 --- a/docs/index.html +++ b/docs/index.html @@ -44,6 +44,10 @@ maxLevel: 4, subMaxLevel: 2, ga: 'UA-106147152-1', + matomo: { + host: '//matomo.thunderwave.de', + id: 6 + }, name: 'docsify', search: { noData: { @@ -84,6 +88,7 @@ + diff --git a/docs/markdown.md b/docs/markdown.md index d03d5ec..c506e17 100644 --- a/docs/markdown.md +++ b/docs/markdown.md @@ -36,6 +36,7 @@ window.$docsify = { // // +var num = 0; mermaid.initialize({ startOnLoad: false }); window.$docsify = { @@ -44,7 +45,7 @@ window.$docsify = { code: function(code, lang) { if (lang === "mermaid") { return ( - '