├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── jest.config.js ├── package.json ├── renovate.json ├── src ├── module.ts ├── options.ts ├── runtime │ └── plugin.js └── types.ts ├── test ├── fixture │ ├── layouts │ │ └── default.vue │ ├── markdown │ │ └── hello.md │ ├── nuxt.config.js │ └── pages │ │ ├── $md.vue │ │ ├── import.vue │ │ ├── index.vue │ │ └── template.vue └── module.test.js ├── tsconfig.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_size = 2 6 | indent_style = space 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | coverage 3 | dist 4 | .nuxt 5 | *.log* 6 | src/runtime/plugin.js 7 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "@nuxtjs/eslint-config-typescript" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | ci: 13 | runs-on: ${{ matrix.os }} 14 | 15 | strategy: 16 | matrix: 17 | os: [ubuntu-latest] 18 | node: [14] 19 | 20 | steps: 21 | - uses: actions/setup-node@v2 22 | with: 23 | node-version: ${{ matrix.node }} 24 | 25 | - name: checkout 26 | uses: actions/checkout@master 27 | 28 | - name: Get yarn cache directory path 29 | id: yarn-cache-dir-path 30 | run: echo "::set-output name=dir::$(yarn cache dir)" 31 | 32 | - uses: actions/cache@v2 33 | id: yarn-cache 34 | with: 35 | path: ${{ steps.yarn-cache-dir-path.outputs.dir }} 36 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 37 | restore-keys: | 38 | ${{ runner.os }}-yarn- 39 | 40 | - name: Install dependencies 41 | if: steps.cache.outputs.cache-hit != 'true' 42 | run: yarn 43 | 44 | - name: Lint 45 | run: yarn lint 46 | 47 | - name: Build 48 | run: yarn build 49 | 50 | - name: Test 51 | run: yarn jest 52 | 53 | - name: Coverage 54 | uses: codecov/codecov-action@v1 55 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.iml 3 | .idea 4 | *.log* 5 | .nuxt 6 | .vscode 7 | .DS_Store 8 | coverage 9 | dist -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | ## 2.0.0 (2021-01-20) 6 | 7 | 8 | ### ⚠ BREAKING CHANGES 9 | 10 | * update module (#23) 11 | 12 | ### Features 13 | 14 | * update module ([#23](https://github.com/nuxt-community/markdownit-module/issues/23)) ([017b87e](https://github.com/nuxt-community/markdownit-module/commit/017b87e529839006a70c3d7417a71adf002fab44)) 15 | * **markdownit:** add types for `$md` util ([#376](https://github.com/nuxt-community/markdownit-module/issues/376)) ([9059fbd](https://github.com/nuxt-community/markdownit-module/commit/9059fbd02bee237cde1820e4008388d07a983209)) 16 | * **markdownit:** inject $md to app and vue instance ([#174](https://github.com/nuxt-community/markdownit-module/issues/174)) ([5d5f345](https://github.com/nuxt-community/markdownit-module/commit/5d5f345cb36976629d44fc3828d1e45746648a49)) 17 | 18 | 19 | ### Bug Fixes 20 | 21 | * **markdownit:** `preset` configuration value was ignored ([#340](https://github.com/nuxt-community/markdownit-module/issues/340)) ([bca0b63](https://github.com/nuxt-community/markdownit-module/commit/bca0b633d47a39b841a558ee7a1568a6ff03c57c)) 22 | * **markdownit:** intropDefault for plugin imports ([#347](https://github.com/nuxt-community/markdownit-module/issues/347)) ([3c20807](https://github.com/nuxt-community/markdownit-module/commit/3c20807f17c8bfed2e5a3ac207f3c8831783cd66)) 23 | * **markdownit:** prevent mutating options (fixes [#216](https://github.com/nuxt-community/markdownit-module/issues/216)) ([#348](https://github.com/nuxt-community/markdownit-module/issues/348)) ([44cf6e6](https://github.com/nuxt-community/markdownit-module/commit/44cf6e6684d0ad2f95827ba666b60efc855c41a9)) 24 | * **markdownit:** typo ([#351](https://github.com/nuxt-community/markdownit-module/issues/351)) ([44d6bfc](https://github.com/nuxt-community/markdownit-module/commit/44d6bfcbff946b801f1885c7365bbb75c91095aa)), closes [#349](https://github.com/nuxt-community/markdownit-module/issues/349) 25 | * correct homepage URLs ([#282](https://github.com/nuxt-community/markdownit-module/issues/282)) ([b93aed6](https://github.com/nuxt-community/markdownit-module/commit/b93aed6afa8bea33282723fdc34381d74f44d6c3)) 26 | 27 | ## [1.2.10](https://github.com/nuxt/modules/compare/@nuxtjs/markdownit@1.2.9...@nuxtjs/markdownit@1.2.10) (2020-07-14) 28 | 29 | **Note:** Version bump only for package @nuxtjs/markdownit 30 | 31 | 32 | 33 | 34 | 35 | ## [1.2.9](https://github.com/nuxt/modules/compare/@nuxtjs/markdownit@1.2.8...@nuxtjs/markdownit@1.2.9) (2020-02-26) 36 | 37 | 38 | ### Bug Fixes 39 | 40 | * **markdownit:** typo ([#351](https://github.com/nuxt/modules/issues/351)) ([cb8fea7](https://github.com/nuxt/modules/commit/cb8fea7afa550448b074a41298564cd0b3c00a9d)), closes [#349](https://github.com/nuxt/modules/issues/349) 41 | 42 | 43 | 44 | 45 | 46 | ## [1.2.8](https://github.com/nuxt/modules/compare/@nuxtjs/markdownit@1.2.7...@nuxtjs/markdownit@1.2.8) (2020-02-26) 47 | 48 | 49 | ### Bug Fixes 50 | 51 | * **markdownit:** `preset` configuration value was ignored ([#340](https://github.com/nuxt/modules/issues/340)) ([776ecd1](https://github.com/nuxt/modules/commit/776ecd1e9731d4c9a43554991a1ec48aff22fecc)) 52 | * **markdownit:** intropDefault for plugin imports ([#347](https://github.com/nuxt/modules/issues/347)) ([fdeef36](https://github.com/nuxt/modules/commit/fdeef360f5961b0ac22b7374d53b653ddb790e94)) 53 | * **markdownit:** prevent mutating options (fixes [#216](https://github.com/nuxt/modules/issues/216)) ([#348](https://github.com/nuxt/modules/issues/348)) ([152f3b9](https://github.com/nuxt/modules/commit/152f3b92f1959ccb2ebb397c339717b619c748ef)) 54 | 55 | 56 | 57 | 58 | 59 | ## [1.2.7](https://github.com/nuxt/modules/compare/@nuxtjs/markdownit@1.2.6...@nuxtjs/markdownit@1.2.7) (2019-10-07) 60 | 61 | **Note:** Version bump only for package @nuxtjs/markdownit 62 | 63 | 64 | 65 | 66 | 67 | ## [1.2.6](https://github.com/nuxt/modules/compare/@nuxtjs/markdownit@1.2.5...@nuxtjs/markdownit@1.2.6) (2019-07-13) 68 | 69 | **Note:** Version bump only for package @nuxtjs/markdownit 70 | 71 | 72 | 73 | 74 | 75 | ## [1.2.5](https://github.com/nuxt/modules/compare/@nuxtjs/markdownit@1.2.4...@nuxtjs/markdownit@1.2.5) (2019-05-28) 76 | 77 | 78 | ### Bug Fixes 79 | 80 | * correct homepage URLs ([#282](https://github.com/nuxt/modules/issues/282)) ([960f933](https://github.com/nuxt/modules/commit/960f933)) 81 | 82 | 83 | 84 | 85 | 86 | ## [1.2.4](https://github.com/nuxt/modules/compare/@nuxtjs/markdownit@1.2.3...@nuxtjs/markdownit@1.2.4) (2019-04-15) 87 | 88 | **Note:** Version bump only for package @nuxtjs/markdownit 89 | 90 | 91 | 92 | 93 | 94 | 95 | ## [1.2.3](https://github.com/nuxt/modules/compare/@nuxtjs/markdownit@1.2.2...@nuxtjs/markdownit@1.2.3) (2018-12-19) 96 | 97 | **Note:** Version bump only for package @nuxtjs/markdownit 98 | 99 | 100 | 101 | 102 | 103 | 104 | ## [1.2.2](https://github.com/nuxt/modules/compare/@nuxtjs/markdownit@1.2.1...@nuxtjs/markdownit@1.2.2) (2018-10-01) 105 | 106 | **Note:** Version bump only for package @nuxtjs/markdownit 107 | 108 | 109 | 110 | 111 | 112 | 113 | ## [1.2.1](https://github.com/nuxt/modules/compare/@nuxtjs/markdownit@1.2.0...@nuxtjs/markdownit@1.2.1) (2018-04-27) 114 | 115 | 116 | 117 | 118 | **Note:** Version bump only for package @nuxtjs/markdownit 119 | 120 | 121 | # [1.2.0](https://github.com/nuxt/modules/compare/@nuxtjs/markdownit@1.1.3...@nuxtjs/markdownit@1.2.0) (2017-11-27) 122 | 123 | 124 | ### Features 125 | 126 | * **markdownit:** inject $md to app and vue instance ([#174](https://github.com/nuxt/modules/issues/174)) ([35e2e9c](https://github.com/nuxt/modules/commit/35e2e9c)) 127 | 128 | 129 | 130 | 131 | 132 | ## [1.1.3](https://github.com/nuxt/modules/compare/@nuxtjs/markdownit@1.1.2...@nuxtjs/markdownit@1.1.3) (2017-11-20) 133 | 134 | 135 | 136 | 137 | **Note:** Version bump only for package @nuxtjs/markdownit 138 | 139 | 140 | ## [1.1.2](https://github.com/nuxt/modules/compare/@nuxtjs/markdownit@1.1.0...@nuxtjs/markdownit@1.1.2) (2017-08-29) 141 | 142 | 143 | ### Bug Fixes 144 | 145 | * **markdownit:** update for nuxt rc6 (#125) ([72f4d61](https://github.com/nuxt/modules/commit/72f4d61)), closes [#124](https://github.com/nuxt/modules/issues/124) 146 | 147 | 148 | 149 | 150 | 151 | ## [0.0.2](https://github.com/nuxt/modules/compare/@nuxtjs/markdownit@0.0.1...@nuxtjs/markdownit@0.0.2) (2017-06-06) 152 | 153 | 154 | 155 | 156 | 157 | ## 0.0.1 (2017-06-04) 158 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Nuxt Community 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Markdownit for Nuxt 2 2 | [![npm](https://img.shields.io/npm/dt/@nuxtjs/markdownit.svg?style=flat-square)](https://npmjs.com/package/@nuxtjs/markdownit) 3 | [![npm (scoped with tag)](https://img.shields.io/npm/v/@nuxtjs/markdownit/latest.svg?style=flat-square)](https://npmjs.com/package/@nuxtjs/markdownit) 4 | 5 | Using [markdownit-loader](https://github.com/nuxt-community/markdownit-loader) and [markdown-it](https://github.com/markdown-it/markdown-it) 6 | 7 | 8 | ## Setup 9 | - Add `@nuxtjs/markdownit` dependency using yarn or npm to your project 10 | - Add `@nuxtjs/markdownit` to `modules` section of `nuxt.config.js` 11 | ```js 12 | { 13 | modules: [ 14 | '@nuxtjs/markdownit' 15 | ], 16 | 17 | // [optional] markdownit options 18 | // See https://github.com/markdown-it/markdown-it 19 | markdownit: { 20 | preset: 'default', 21 | linkify: true, 22 | breaks: true, 23 | use: [ 24 | 'markdown-it-div', 25 | 'markdown-it-attrs' 26 | ] 27 | } 28 | } 29 | ``` 30 | 31 | ## Usage 32 | 33 | ### Using `.vue` files 34 | **TIP** You can also write Vue logic inside `