├── .github └── workflows │ ├── build-docs.yml │ ├── npm-publish-core.yml │ ├── npm-publish-create.yml │ ├── npm-publish-publisher.yml │ ├── npm-publish-server.yml │ └── npm-publish-themes.yml ├── .gitignore ├── LICENSE ├── README.md ├── docs_src ├── .gitignore ├── exlibris │ ├── Button.svelte │ ├── Counter.svelte │ ├── Input.svelte │ ├── Modal.svelte │ ├── chota.js │ └── spoiler.md ├── package-lock.json ├── package.json ├── src │ ├── examples.css │ ├── includes │ │ ├── error.md │ │ ├── github.svelte │ │ ├── logo.md │ │ ├── opengraph.svelte │ │ ├── sidebar.md │ │ └── topbar.md │ ├── pages │ │ ├── builtins │ │ │ ├── example.md │ │ │ └── properties.md │ │ ├── config │ │ │ ├── aliases.md │ │ │ ├── basepath.md │ │ │ ├── file.md │ │ │ ├── pathes.md │ │ │ ├── preprocess.md │ │ │ ├── theme.md │ │ │ └── title.md │ │ ├── getting-started.md │ │ ├── index.md │ │ ├── introduction.md │ │ ├── publishing │ │ │ └── ghpages.md │ │ ├── theming.md │ │ ├── theming │ │ │ ├── custom-theme.md │ │ │ ├── examples.md │ │ │ ├── list │ │ │ │ ├── default.md │ │ │ │ └── light.md │ │ │ └── theme-tuning.md │ │ └── writing │ │ │ ├── includes.md │ │ │ ├── mdsv.md │ │ │ ├── routing.md │ │ │ ├── settings.md │ │ │ ├── static.md │ │ │ └── structure.md │ ├── static │ │ ├── favicon.png │ │ ├── great-success.png │ │ ├── logo.svg │ │ └── social.png │ └── theme.css └── svelte-docs.config.js ├── package-lock.json ├── package.json ├── packages ├── core │ ├── App.svelte │ ├── aliases │ │ └── rollup_plugin_aliases.js │ ├── builtins │ │ ├── Example │ │ │ ├── Example.svelte │ │ │ ├── iframe.js │ │ │ └── replacer.js │ │ ├── Properties │ │ │ ├── parser.js │ │ │ └── replacer.js │ │ ├── blockparser.js │ │ ├── rollup_plugin_builtins.js │ │ ├── rollup_plugin_examples.js │ │ └── svelte_preprocess_builtins.js │ ├── config.js │ ├── constants.js │ ├── examples.main.js │ ├── fixidents │ │ └── rollup_plugin_fixidents.js │ ├── highlight.js │ ├── indexer │ │ └── rollup_plugin_indexer.js │ ├── main.js │ ├── navigation.js │ ├── package-lock.json │ ├── package.json │ ├── pages │ │ ├── rollup_plugin_pages.js │ │ └── routes.js │ ├── replacer │ │ └── rollup_plugin_replacer.js │ ├── rollup.config.js │ ├── stores.js │ ├── syncer │ │ └── rollup_plugin_syncer.js │ ├── themes.js │ ├── utils.js │ └── watcher.js ├── create │ ├── cli.js │ ├── package-lock.json │ └── package.json ├── publisher │ ├── package-lock.json │ ├── package.json │ └── publisher.js ├── server │ ├── package-lock.json │ ├── package.json │ └── server.js └── themes │ ├── default │ ├── assets │ │ ├── burger.svg │ │ └── fonts │ │ │ ├── fira-mono-400.woff2 │ │ │ ├── overpass-300.woff2 │ │ │ ├── overpass-400.woff2 │ │ │ └── overpass-600.woff2 │ ├── components │ │ ├── Document.svelte │ │ ├── Example.svelte │ │ ├── Layout.svelte │ │ ├── Properties.svelte │ │ ├── Sections.svelte │ │ └── Topbar.svelte │ ├── info.md │ ├── style.css │ └── styles │ │ ├── fonts.css │ │ ├── highlight.css │ │ ├── layout.css │ │ └── typography.css │ ├── light │ ├── components │ │ ├── Example.svelte │ │ ├── Layout.svelte │ │ └── Properties.svelte │ ├── info.md │ ├── style.css │ └── styles │ │ ├── highlight.css │ │ ├── layout.css │ │ └── typography.css │ ├── package-lock.json │ ├── package.json │ └── utils.js ├── scripts ├── clean.js ├── install.js └── link.js └── template ├── .gitignore ├── package.json ├── src ├── examples.css ├── includes │ ├── error.md │ ├── logo.md │ ├── sidebar.md │ └── topbar.md ├── pages │ ├── components │ │ └── button.md │ ├── getting-started.md │ └── index.md ├── static │ ├── favicon.png │ └── great-success.png └── theme.css └── svelte-docs.config.js /.github/workflows/build-docs.yml: -------------------------------------------------------------------------------- 1 | name: Build Documentation 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | paths: 8 | - '.github/workflows/build-docs.yml' 9 | - 'docs_src/*' 10 | - 'docs_src/*/*' 11 | - 'docs_src/*/*/*' 12 | - 'docs_src/*/*/*/*' 13 | - 'docs_src/*/*/*/*/*' 14 | 15 | jobs: 16 | docs-build-deploy: 17 | runs-on: ubuntu-18.04 18 | steps: 19 | - uses: actions/checkout@master 20 | 21 | - name: Setup Node 22 | uses: actions/setup-node@v1 23 | with: 24 | node-version: 12.x 25 | 26 | - name: Build 27 | run: cd docs_src && npm i && npm run build 28 | 29 | - name: Deploy 30 | uses: peaceiris/actions-gh-pages@v2.4.0 31 | env: 32 | ACTIONS_DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} 33 | PUBLISH_BRANCH: gh-pages 34 | PUBLISH_DIR: ./docs_src/__DOCS__/dist/svelte-docs -------------------------------------------------------------------------------- /.github/workflows/npm-publish-core.yml: -------------------------------------------------------------------------------- 1 | name: Publish @svelte-docs/core 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | paths: 8 | - '.github/workflows/npm-publish-core.yml' 9 | - 'packages/core/package.json' 10 | 11 | jobs: 12 | publish-npm: 13 | runs-on: ubuntu-18.04 14 | steps: 15 | - uses: actions/checkout@v1 16 | - name: Setup Node 17 | uses: actions/setup-node@v1 18 | with: 19 | node-version: 12 20 | registry-url: https://registry.npmjs.org/ 21 | - name: Installing NPM deps 22 | run: npm --prefix packages/core install 23 | - name: Copy Readme file 24 | run: cp README.md packages/core/README.md 25 | - name: Building & publishing on NPM 26 | run: cd packages/core && npm publish 27 | env: 28 | NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} -------------------------------------------------------------------------------- /.github/workflows/npm-publish-create.yml: -------------------------------------------------------------------------------- 1 | name: Publish create-svelte-docs 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | paths: 8 | - '.github/workflows/npm-publish-create.yml' 9 | - 'packages/create/package.json' 10 | 11 | jobs: 12 | publish-npm: 13 | runs-on: ubuntu-18.04 14 | steps: 15 | - uses: actions/checkout@v1 16 | - name: Setup Node 17 | uses: actions/setup-node@v1 18 | with: 19 | node-version: 12 20 | registry-url: https://registry.npmjs.org/ 21 | - name: Installing NPM deps 22 | run: npm --prefix packages/create install 23 | - name: Copy Readme file 24 | run: cp README.md packages/create/README.md 25 | - name: Building & publishing on NPM 26 | run: cd packages/create && npm publish 27 | env: 28 | NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} -------------------------------------------------------------------------------- /.github/workflows/npm-publish-publisher.yml: -------------------------------------------------------------------------------- 1 | name: Publish @svelte-docs/publisher 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | paths: 8 | - '.github/workflows/npm-publish-publisher.yml' 9 | - 'packages/publisher/package.json' 10 | 11 | jobs: 12 | publish-npm: 13 | runs-on: ubuntu-18.04 14 | steps: 15 | - uses: actions/checkout@v1 16 | - name: Setup Node 17 | uses: actions/setup-node@v1 18 | with: 19 | node-version: 12 20 | registry-url: https://registry.npmjs.org/ 21 | - name: Installing NPM deps 22 | run: npm --prefix packages/publisher install 23 | - name: Building & publishing on NPM 24 | run: cd packages/publisher && npm publish 25 | env: 26 | NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} -------------------------------------------------------------------------------- /.github/workflows/npm-publish-server.yml: -------------------------------------------------------------------------------- 1 | name: Publish @svelte-docs/server 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | paths: 8 | - '.github/workflows/npm-publish-server.yml' 9 | - 'packages/server/package.json' 10 | 11 | jobs: 12 | publish-npm: 13 | runs-on: ubuntu-18.04 14 | steps: 15 | - uses: actions/checkout@v1 16 | - name: Setup Node 17 | uses: actions/setup-node@v1 18 | with: 19 | node-version: 12 20 | registry-url: https://registry.npmjs.org/ 21 | - name: Installing NPM deps 22 | run: npm --prefix packages/server install 23 | - name: Building & publishing on NPM 24 | run: cd packages/server && npm publish 25 | env: 26 | NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} -------------------------------------------------------------------------------- /.github/workflows/npm-publish-themes.yml: -------------------------------------------------------------------------------- 1 | name: Publish @svelte-docs/themes 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | paths: 8 | - '.github/workflows/npm-publish-themes.yml' 9 | - 'packages/themes/package.json' 10 | 11 | jobs: 12 | publish-npm: 13 | runs-on: ubuntu-18.04 14 | steps: 15 | - uses: actions/checkout@v1 16 | - name: Setup Node 17 | uses: actions/setup-node@v1 18 | with: 19 | node-version: 12 20 | registry-url: https://registry.npmjs.org/ 21 | - name: Installing NPM deps 22 | run: npm --prefix packages/themes install 23 | - name: Building & publishing on NPM 24 | run: cd packages/themes && npm publish 25 | env: 26 | NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | __DOCS__ 4 | template/src/theme 5 | __DEV__ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Alexey Schebelev 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 | # Svelte-Docs 2 | 3 | **Sorry, but current version of Svelte-Docs will not be developing anymore. I will rework whole project with `svelte-kit` as it will be released.** 4 | 5 | Svelte-Docs is a rapid way to write documentation for your Svelte components. 6 | 7 | ![](https://github.com/AlexxNB/svelte-docs/workflows/Publish%20create-svelte-docs/badge.svg) 8 | ![](https://github.com/AlexxNB/svelte-docs/workflows/Publish%20@svelte-docs/core/badge.svg) 9 | ![](https://github.com/AlexxNB/svelte-docs/workflows/Publish%20@svelte-docs/publisher/badge.svg) 10 | ![](https://github.com/AlexxNB/svelte-docs/workflows/Publish%20@svelte-docs/server/badge.svg) 11 | 12 | > **It is an early alpha version of the Svelte-Docs so probably buggy and unstable. It also means that future versions may include breakable changes.** 13 | 14 | ## Features 15 | 16 | * Based on MDSv format, which allows write documentation in Markdown mixed with Svelte's features. 17 | * Import and use any Svelte components right inside a markup 18 | * Documentation building as static files, so you can publish it everywhere 19 | * Customizable themes 20 | * Built-in deploy on Github Pages 21 | 22 | ## Getting Started 23 | 24 | Just run: 25 | 26 | ```bash 27 | npm init svelte-docs 28 | ``` 29 | 30 | Then [write](https://alexxnb.github.io/svelte-docs/writing/mdsv) the documentation and [build](https://alexxnb.github.io/svelte-docs/start) it into static site. 31 | 32 | ## Documentation 33 | 34 | For more info see the [Documentation](https://alexxnb.github.io/svelte-docs). 35 | -------------------------------------------------------------------------------- /docs_src/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | __DOCS__ -------------------------------------------------------------------------------- /docs_src/exlibris/Button.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs_src/exlibris/Counter.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | count--}>- 7 | {count} 8 | count++}>+ 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs_src/exlibris/Input.svelte: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs_src/exlibris/Modal.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 | {#if open} 7 |
8 |
open=false}/> 9 | 10 |
11 | {/if} 12 | 13 | -------------------------------------------------------------------------------- /docs_src/exlibris/chota.js: -------------------------------------------------------------------------------- 1 | export {default as Button} from './Button.svelte'; -------------------------------------------------------------------------------- /docs_src/exlibris/spoiler.md: -------------------------------------------------------------------------------- 1 | > *MDSv is really cool!* -------------------------------------------------------------------------------- /docs_src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "svelte-docs-template", 4 | "version": "0.2.0", 5 | "dependencies": { 6 | "@svelte-docs/server": "^0.1.6" 7 | }, 8 | "devDependencies": { 9 | "@svelte-docs/core": "^0.10.13", 10 | "@svelte-docs/publisher": "^0.2.3", 11 | "@svelte-docs/themes": "^1.0.1", 12 | "npm-run-all": "^4.1.5", 13 | "rollup": "^2.35.1" 14 | }, 15 | "scripts": { 16 | "build": "rollup -c node_modules/@svelte-docs/core/rollup.config.js", 17 | "autobuild": "rollup -c node_modules/@svelte-docs/core/rollup.config.js -w", 18 | "dev": "run-p start:dev start:pagewatch autobuild", 19 | "start": "node node_modules/@svelte-docs/server", 20 | "start:dev": "node node_modules/@svelte-docs/server --dev --single", 21 | "start:pagewatch": "node node_modules/@svelte-docs/core/watcher", 22 | "deploy": "npm run build && node node_modules/@svelte-docs/publisher" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /docs_src/src/examples.css: -------------------------------------------------------------------------------- 1 | /* Styling of the examples view */ 2 | 3 | body { 4 | color: #333; 5 | margin: 0; 6 | padding: 8px; 7 | box-sizing: border-box; 8 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; 9 | } 10 | 11 | a { 12 | color: rgb(0,100,200); 13 | text-decoration: none; 14 | } 15 | 16 | a:hover { 17 | text-decoration: underline; 18 | } 19 | 20 | a:visited { 21 | color: rgb(0,80,160); 22 | } 23 | 24 | label { 25 | display: block; 26 | } 27 | 28 | input, button, select, textarea { 29 | font-family: inherit; 30 | font-size: inherit; 31 | padding: 0.4em; 32 | margin: 0 0 0.5em 0; 33 | box-sizing: border-box; 34 | border: 1px solid #ccc; 35 | border-radius: 2px; 36 | } 37 | 38 | input:disabled { 39 | color: #ccc; 40 | } 41 | 42 | input[type="range"] { 43 | height: 0; 44 | } 45 | 46 | button { 47 | background-color: #f4f4f4; 48 | outline: none; 49 | } 50 | 51 | button:active { 52 | background-color: #ddd; 53 | } 54 | 55 | button:focus { 56 | border-color: #666; 57 | } -------------------------------------------------------------------------------- /docs_src/src/includes/error.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: 'no_sidebar' 3 | --- 4 | # Page not found! # 5 | 6 | [Go to start page](/) 7 | 8 | -------------------------------------------------------------------------------- /docs_src/src/includes/github.svelte: -------------------------------------------------------------------------------- 1 | 34 | 35 | 37 | 38 | {#if hover}Github{/if} 39 | 40 | -------------------------------------------------------------------------------- /docs_src/src/includes/logo.md: -------------------------------------------------------------------------------- 1 | import {current_page} from '@svelte-docs/get/routes'; 2 | 3 | 4 | {#if $current_page.url !== ''} 5 | # [![LOGO](static/logo.svg)](/) # 6 | {/if} 7 | 8 | -------------------------------------------------------------------------------- /docs_src/src/includes/opengraph.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs_src/src/includes/sidebar.md: -------------------------------------------------------------------------------- 1 | * [Introduction](introduction) 2 | * [Getting Started](getting-started) 3 | * Writing docs 4 | - [What is MDSv](writing/mdsv) 5 | - [Structure](writing/structure) 6 | - [Includes](writing/includes) 7 | - [Routing](writing/routing) 8 | - [Static files](writing/static) 9 | - [Page settings](writing/settings) 10 | * [Configuration](config/file) 11 | - [basepath](config/basepath) 12 | - [theme](config/theme) 13 | - [title](config/title) 14 | - [pathes](config/pathes) 15 | - [aliases](config/aliases) 16 | - [preprocess](config/preprocess) 17 | * Builtins 18 | - [Example](builtins/example) 19 | - [Properties](builtins/properties) 20 | * Styling 21 | - [Theme tuning](theming/theme-tuning) 22 | - [Examples view](theming/examples) 23 | - [Custom theme](theming/custom-theme) 24 | - List of themes 25 | - [Default](theming/list/default) 26 | - [Light](theming/list/light) 27 | * Publishing 28 | - [GitHub Pages](publishing/ghpages) -------------------------------------------------------------------------------- /docs_src/src/includes/topbar.md: -------------------------------------------------------------------------------- 1 | import Github from './github.svelte'; 2 | import Opengraph from './opengraph.svelte'; 3 | 4 | 5 | 6 | * [Docs](getting-started) 7 | * -------------------------------------------------------------------------------- /docs_src/src/pages/builtins/example.md: -------------------------------------------------------------------------------- 1 | # Example code block 2 | 3 | When you document your Svelte component you want show it in action. You can do it with *Example code block*. 4 | 5 | ```markdown 6 | ```example 7 | 10 | 11 | 12 | 13 | 16 | ``` 17 | ``` 18 | 19 | ```example 20 | 23 | 24 | 25 | 26 | 29 | ``` 30 | 31 | ### Hide script and/or style blocks 32 | 33 | Sometimes no need to show what is inside the *style* or *script* blocks. You can use `script:hide` and `style:hide` modifiers. 34 | 35 | ```markdown 36 | ```example script:hide style:hide 37 | 40 | 41 | 42 | 43 | 46 | ``` 47 | ``` 48 | 49 | ```example script:hide style:hide 50 | 53 | 54 | 55 | 56 | 59 | ``` 60 | 61 | ### Set fixed height of the example 62 | 63 | By default result part of the example has flexible height, which changing within content. But you can lock height with `height:` modifier. 64 | 65 | ```markdown 66 | ```example height:200 67 | ... 68 | ``` 69 | ``` 70 | 71 | ```example height:200 72 | 76 | 77 | 78 | 79 | 80 |

Hello!

81 |

I'm modal.

82 |
83 | ``` 84 | 85 | ### Import in examples 86 | 87 | You can import any installed NPM package or local file as you usually do inside ordinary `*.svelte` file. 88 | 89 | ```example 90 | 93 | 94 | 95 | ``` 96 | 97 | Also you can import any local file by relative path according documents directory root: 98 | 99 | ```example 100 | 103 | 104 | 105 | ``` 106 | 107 | Other way to import local files - using aliases (see [config.aliases](config/aliases)). 108 | 109 | ```javascript 110 | // svelte-docs.config.js 111 | ... 112 | aliases:{ 113 | './Button.svelte': './../mylib/Button.svelte', 114 | 'my-button-package': './../mylib/Button.svelte' 115 | }, 116 | ... 117 | ``` 118 | 119 | 120 | ```example 121 | 125 | 126 | 127 | Button2 128 | ``` 129 | 130 | ### Styling 131 | 132 | Styles of the documentation site doesn't affect on the Example's result. Examples have their own global styles(which will be used by all examples). You can read more in the [Theming examples](theming/examples) section.It is stored in `src/theme/examples.css` file. -------------------------------------------------------------------------------- /docs_src/src/pages/builtins/properties.md: -------------------------------------------------------------------------------- 1 | # Properties 2 | 3 | Usually all components you want to document have some properties, which should be described. Properties code block allows do it as easy as possible. 4 | 5 | Suppose you have a *Input.svelte* component with following properties: 6 | 7 | ```html 8 | 14 | ``` 15 | 16 | There are four properties: 17 | 18 | 1. *name* - it hasn't default value, so it is not optional. Probably it should be string type, but who knows. 19 | 2. *type* - it is string value, optional because has default value. What other values may be used? 20 | 3. *disabled* - it is simple: optional, type bool, false by default. 21 | 4. *size* - easy: optional, type number, 1 by default. Nope! Also it could be string like '20px'. 22 | 23 | So lets create fancy table of properties for this component: 24 | 25 | ```markdown 26 | ```properties 27 | name | Name of the input | string 28 | type | Type of the input | 'text','number','range','date'('text) 29 | disabled | Should the input be disabled | bool(false) 30 | size | Size of the input | number/string(1) 31 | ``` 32 | ``` 33 | 34 | ```properties 35 | name | Name of the input | string 36 | type | Type of the input | 'text','number','range','date'('text) 37 | disabled | Should the input be disabled | bool(false) 38 | size | Size of the input | number/string(1) 39 | ``` 40 | 41 | Now user of your component will know all about its properties. 42 | 43 | ### Describing property 44 | 45 | * Each line of the *properties* code block must have three parts separated by `|` sign: *name* of the property, *description* and *type* of the property. 46 | 47 | * If property may have one of the defined values, list them separated by commas: `'a','b','c'` 48 | 49 | * If property may be various types - list them with `/` separator: `number/string/bool`,`'a','b','c'/bool` 50 | 51 | * If property has default value add it in `(...)` right after *types*: `bool(true)`, `string/number('foo')` 52 | 53 | ### Autogenerated properties 54 | 55 | Another way to describre properties, retrieve it right from the Svelte component with [JSDoc @type](https://devdocs.io/jsdoc/tags-type) comments. Let's change our *Input.svelte* and add comment for each properties: 56 | 57 | ```html 58 | // ./../mylib/Input.svelte 59 | 72 | ``` 73 | 74 | You should write only description and types in the comments. Property name and default value will be parsed automaticly. 75 | 76 | Then just place a path to the this component inside Properties code block: 77 | 78 | ```markdown 79 | ```properties 80 | ./../mylib/Input.svelte 81 | ``` 82 | ``` 83 | 84 | And get the result: 85 | 86 | ```properties 87 | ./exlibris/Input.svelte 88 | ``` -------------------------------------------------------------------------------- /docs_src/src/pages/config/aliases.md: -------------------------------------------------------------------------------- 1 | # aliases option 2 | 3 | Option `aliases` is the list of aliases for you local component's paths. 4 | 5 | Suppose you have following structure of your project: 6 | 7 | ```javascript 8 | my-project 9 | ├── docs_src 10 | │ └── ... 11 | ├── mycomponent 12 | │ └── Counter.svelte 13 | └── ... 14 | ``` 15 | 16 | And you want to import `mycomponents/Counter.svelte` in your Example code block(or just in the page), you may use relative path(from the docs root) like this: 17 | 18 | ```markdown 19 | ```example 20 | 23 | 24 | ``` 25 | ``` 26 | 27 | But it is not looks good, especially when you will publish your components on NPM and want to teach users how to use it . 28 | 29 | So you can add *virtual package* using `aliases` option: 30 | 31 | ```javascript 32 | aliases:{ 33 | ... 34 | "my-counter-package": "./../mycomponent/Counter.svelte", 35 | ... 36 | } 37 | ``` 38 | 39 | And then you can import this *virtual package* inside of the Example: 40 | 41 | ```markdown 42 | ```example 43 | 46 | 47 | ``` 48 | ``` -------------------------------------------------------------------------------- /docs_src/src/pages/config/basepath.md: -------------------------------------------------------------------------------- 1 | # Basepath option 2 | 3 | Option `basepath` is a part of URL to the root documentation site. 4 | 5 | By default `basepath` is equal `'/'`, it is mean that documentation will be available by URL like https://mydocs.com or https://docs.mysite.com. 6 | 7 | When you need to place documentation in the subdirectory of your existing site, you should change `basepath` to the value like `/subdir/`. In this case your documentation will be available by URL like https://mysite.com/subdir. 8 | 9 | > If you plan to publish documentation at the Github Pages of your repository, then set `basepath: '/name-of-your-repo/'`. -------------------------------------------------------------------------------- /docs_src/src/pages/config/file.md: -------------------------------------------------------------------------------- 1 | # Configuration 2 | 3 | At the root of the documents sources directory you can find find `svelte-docs.config.js` file. For more info, see the description of each option by the link on the sidebar. 4 | -------------------------------------------------------------------------------- /docs_src/src/pages/config/pathes.md: -------------------------------------------------------------------------------- 1 | # Pathes option 2 | 3 | There are two pathes you can change. 4 | 5 | * `pathes.dev` - directory, where builded site is stored in development mode when you run command `npm run dev`. It is nonoptimized version with additional code for debugging during development process. **Don't use this files in production!** 6 | 7 | * `pathes.build` - directory, where stored files of the builded site for production when you run command `npm run build`. You can deploy these files to the any service, which is support serving of the static files. 8 | 9 | > In most cases you don't need to change these options. 10 | -------------------------------------------------------------------------------- /docs_src/src/pages/config/preprocess.md: -------------------------------------------------------------------------------- 1 | # Preprocess option 2 | 3 | You can use any Svelte preprocessor for your Examples code block. Just install it from NPM, import in the `svelte-docs.config.file` and add to the `preprocess` option same way you do in `rollup.config.js`. 4 | 5 | 6 | ```javascript 7 | const markdown = require('svelte-preprocess-markdown'); 8 | 9 | module.exports={ 10 | ... 11 | preprocess: [ 12 | ... 13 | markdown({filetype: 'svelte'}), 14 | ... 15 | ] 16 | ... 17 | } 18 | ``` 19 | 20 | Then all your examples will be preprocessed: 21 | 22 | ```markdown 23 | ```example 24 | 27 | 28 | # Hello, {name}! 29 | ``` 30 | ``` -------------------------------------------------------------------------------- /docs_src/src/pages/config/theme.md: -------------------------------------------------------------------------------- 1 | # Theme option 2 | 3 | Choose theme for documentation site. List of avialable themes you can find on the sidebar. 4 | 5 | ```js 6 | ... 7 | theme: 'default', 8 | ... 9 | ``` 10 | 11 | Also you can write path to the local dir here: 12 | 13 | ```js 14 | ... 15 | theme: './src/my-own-theme', 16 | ... 17 | ``` 18 | 19 | > In this case, it should be directory with [valid theme content](theming/custom-theme). -------------------------------------------------------------------------------- /docs_src/src/pages/config/title.md: -------------------------------------------------------------------------------- 1 | # Title option 2 | 3 | There are two properties which can be changed: 4 | 5 | * `title.main` - this is constant part of the page's title. 6 | 7 | * `title.header` - if `true`, content of the first header on the page will be added before `title.main` in the page's title. It will look up for 1 and 2 level markdown or HTML headers on the current page. 8 | -------------------------------------------------------------------------------- /docs_src/src/pages/getting-started.md: -------------------------------------------------------------------------------- 1 | # Getting started 2 | 3 | ### Initialize Svelte-docs 4 | 5 | Just run this command in the root directory of your project: 6 | 7 | ```bash 8 | npm init svelte-docs 9 | ``` 10 | 11 | It will ask you about the destination directory for the documents' sources. Then it will download template and theme into the specified directory and install required NPM packages. 12 | 13 | ### Edit your docs 14 | 15 | Switch to the created directory, ex.: 16 | 17 | ```bash 18 | cd docs_srv 19 | ``` 20 | 21 | Run docs in development mode on the local server: 22 | 23 | ```bash 24 | npm run dev 25 | ``` 26 | 27 | Point your browser on [http://localhost:5000](http://localhost:5000) to see your docs in action. 28 | 29 | Now you can edit files in `src/pages` directory and browser will be reloaded on each save. 30 | 31 | ### Build the documentation site 32 | 33 | As soon as documentation ready for release you need to run the build: 34 | 35 | ```bash 36 | npm run build 37 | ``` 38 | 39 | All needed files will be builded into the `__DOCS__/build` directory(see [config.pathes](config/pathes)). You can upload it to any service which supports static file serving. For convenience, Svelte-Docs have built-in ability to publish site on Github Pages. 40 | -------------------------------------------------------------------------------- /docs_src/src/pages/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: 'no_sidebar' 3 | title: false 4 | --- 5 | 6 |
7 | 14 | 15 |
16 | Introduction 17 | Getting Started 18 |
19 |
20 | 21 | 64 | -------------------------------------------------------------------------------- /docs_src/src/pages/introduction.md: -------------------------------------------------------------------------------- 1 | # Introducing 2 | 3 | ## Features 4 | 5 | Svelte-Docs is a rapid way to write documentation for your [Svelte](https://svelte.dev) components. 6 | 7 | > **
It is an early alpha version of the Svelte-Docs so probably buggy and unstable. It also means that future versions may include breakable changes.
** 8 | 9 | * Based on [MDSv](writing/mdsv) format, which allows writing documentation in Markdown mixed with Svelte's features. 10 | 11 | * Import and use any Svelte components right inside a markup 12 | 13 | * Documentation building as static files, so you can publish it everywhere 14 | 15 | * Customizable [themes](theming) 16 | 17 | * Built-in [deploy](publishing/ghpages) on Github Pages 18 | 19 | ## Zero-config 20 | 21 | Just run: 22 | 23 | ```bash 24 | npm init svelte-docs 25 | ``` 26 | 27 | Then [write](writing/mdsv) the documentation and [build](start) it into static site. 28 | 29 | 30 | ## Built-ins 31 | 32 | ### Examples 33 | 34 | Example block shows how your components work. It provides an encapsulated CSS environment, virtual imports and ability to use any Svelte preprocessor. 35 | 36 | ```example 37 | 38 | ``` 39 | 40 | ### Properties 41 | 42 | Properties block provides a simple way to document properties of your components. It can be written manually or *auto-generated* from the component's `*.svelte` file. 43 | 44 | ```properties 45 | type | Type of the button | 'default','error','warning'('default') 46 | disabled | Should the button be disabled | bool(false) 47 | ``` 48 | 49 | 54 | -------------------------------------------------------------------------------- /docs_src/src/pages/publishing/ghpages.md: -------------------------------------------------------------------------------- 1 | # Publishing on Github Pages 2 | 3 | Svelte-docs has built-in publishing tool to deploy builded documentation into *gh-pages* branch of your current project. 4 | 5 | To do it just run command in you documents source directory at any time: 6 | 7 | ```bash 8 | npm run deploy 9 | ``` 10 | 11 | Then you should confirm publishing and wait some time while documents will be deployed to the GitHub. 12 | 13 | > Your document sources directory or any parent directory should contents `.git` folder with initialized Github repository. 14 | 15 | > You must set the [config.basepath](config/basepath) too the value equal `/you-repository-name/`; -------------------------------------------------------------------------------- /docs_src/src/pages/theming.md: -------------------------------------------------------------------------------- 1 | # Theming 2 | 3 | Svelte-docs supports the customizable appearance. All you need for applying changes to almost every visual aspect of your documentation is located in `src/theme` dir. 4 | 5 | ### Themes 6 | 7 | At the moment we have only one default theme which is made as a copy of the official [Svelte documentation](https://svelte.dev/docs) theme. But feel free to [add](https://github.com/alexxnb/svelte-docs/pulls) your fantastic theme to this repository. 8 | 9 | ### Colors 10 | 11 | To tune the colors of the current theme just edit custom properties in the `src/theme/styles.css` file. 12 | 13 | ### Styles 14 | 15 | All styles of the site are in the `src/theme/styles` directory. Any of this `*.css` files should be imported in the `src/theme/styles.css` file. 16 | 17 | ### Layout 18 | 19 | You can find Svelte components in the `src/theme/components` directory. It is the barebone of the documentation site. Change it only if you know what you do. -------------------------------------------------------------------------------- /docs_src/src/pages/theming/custom-theme.md: -------------------------------------------------------------------------------- 1 | # Custom theme 2 | 3 | You can make your own theme and use its directory path as [config.theme](config/theme) value. There are several files which must exist: 4 | 5 | ```bash 6 | themedir 7 | ├── components 8 | | ├── Layout.svelte # Page layout 9 | | ├── Error.svelte # Error page layout 10 | | ├── Example.svelte # Example component 11 | | └── Properties.svelte # Properties component 12 | ├── info.md # Some info about the theme 13 | └── style.css # CSS Styles 14 | ``` 15 | 16 | The simplest way is to copy one of the defaut themes and change it as you want. You can find them in the `./node_modules/@svelte-docs/themes` directory or downaload from the [Github](https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/AlexxNB/svelte-docs/tree/master/packages/themes) -------------------------------------------------------------------------------- /docs_src/src/pages/theming/examples.md: -------------------------------------------------------------------------------- 1 | # Examples view CSS 2 | 3 | Examples view(where the result shows) use CSS styles which are isolated from theme of the site. They are situated in the `src/examples.css` file. 4 | 5 | ## import styles 6 | 7 | You can include CSS file from the local directory, npm package or from CDN: 8 | 9 | ```css 10 | @import './../mystyles.css'; 11 | @import './node_modules/my-favorite-css-framework'; 12 | @import 'https://anycdn.com/my-favorite-css-framework'; 13 | ``` 14 | 15 | > When you use `:global()` or `@import` keywords in one example, they will affect on the all examples, because all examples styles bundeled in the single CSS file. -------------------------------------------------------------------------------- /docs_src/src/pages/theming/list/default.md: -------------------------------------------------------------------------------- 1 | import Info from '@CWD/../packages/themes/default/info.md'; 2 | 3 | # Default 4 | -------------------------------------------------------------------------------- /docs_src/src/pages/theming/list/light.md: -------------------------------------------------------------------------------- 1 | import Info from '@CWD/../packages/themes/light/info.md'; 2 | 3 | # Light 4 | -------------------------------------------------------------------------------- /docs_src/src/pages/theming/theme-tuning.md: -------------------------------------------------------------------------------- 1 | # Theme tuning 2 | 3 | Each theme allows to tune some predefined CSS variables which are listed in themes descriptions. 4 | 5 | Add values you want to change into the `src/theme.css` as shown below: 6 | 7 | ```css 8 | :root{ 9 | --primary: #009225; 10 | --secondary: #3f3f70; 11 | } 12 | ``` 13 | 14 | Also you may write your own CSS styles there, they will overwrite default styles for same selectors: 15 | 16 | ```css 17 | h1{ 18 | color: red; 19 | text-transform: uppercase; 20 | } 21 | ``` -------------------------------------------------------------------------------- /docs_src/src/pages/writing/includes.md: -------------------------------------------------------------------------------- 1 | # Includes 2 | 3 | In the `src/includes` directory live little MDSv components which you can include in any page you want. There are some default files used by theme: 4 | 5 | ### sidebar.md 6 | 7 | This file contains list of content on the left sidebar. This is your documentation's structure reflected in markdown code. 8 | 9 | Let's look on example: 10 | 11 | ```markdown 12 | * Getting Started 13 | ‎‎‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎- [Install](install) 14 | * [Components](components/list) 15 | ‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ - [Button](components/button) 16 | ‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ - [Input](components/input) 17 | * [Github](https://github.com/me/my-svelte-lib) 18 | ``` 19 | 20 | Usually it is just a list of links or strings. You can freely arrange items as you want, no necessary to reproduce a file structure of the `src/pages` directory. 21 | 22 | URL of local pages is an a path to corresponding `*.md` file. In the example above `components/button` will link to the page described in `src/pages/components/button.md` file. Please see [Routing](writing/routing) section for more info about URL. 23 | 24 | External URLs will be opened in new window. 25 | 26 | ### logo.md 27 | 28 | Commonly used for showing any logotype. Just write something like: 29 | 30 | ```markdown 31 | # MyComponent # 32 | ``` 33 | 34 | Or you can use an image as your logotype: 35 | 36 | ```markdown 37 | # ![Logo](static/logo.png) # 38 | ``` 39 | 40 | ### topbar.md 41 | 42 | Play with right section of the topbar. For example add some links there: 43 | 44 | ```markdown 45 | * [Home](/) 46 | * [Github](https://github.com/me/my-svelte-lib) 47 | ``` 48 | 49 | ### error.md 50 | 51 | Just an error message which will be shown when user requests unexistent URL. 52 | 53 | ## Custom includes 54 | 55 | You are free to create any `*.md` files which you can to include on any page you want using special import path: 56 | 57 | ```html 58 | 61 | 62 | 63 | ``` -------------------------------------------------------------------------------- /docs_src/src/pages/writing/mdsv.md: -------------------------------------------------------------------------------- 1 | 8 | 9 | # What is MDSv 10 | 11 | MDSv is a Svelte component written in Markdown syntax. You can import and use any Svelte components right inside the markdown markup. 12 | 13 | For more info please visit the [svelte-preprocess-markdown](https://alexxnb.github.io/svelte-preprocess-markdown/) site. 14 | 15 | Markdown is a fast and comfortable way to write documentation, but MDSv providing full power of Svelte to your docs. 16 | 17 | This document also wrote in MDSv format, so we can do this right inside the document... 18 | 19 | ```svelte 20 | 25 | ... 26 | {#each item as item} 27 | * {item} 28 | {/each} 29 | 30 | 31 | 32 | ``` 33 | 34 | ... and get the result: 35 | 36 | {#each items as item} 37 | * {item} 38 | {/each} 39 | 40 | 41 | 42 | 43 | Or we can import any Svelte component and use it where we want: 44 | 45 | ```markdown 46 | 49 | 50 | *The counter:* 51 | ``` 52 | 53 | ... and it will work: 54 | 55 | *The counter:* 56 | 57 | You even can import other `*.md` files: 58 | 59 | ```markdown 60 | 61 | > *MDSv is really cool!* 62 | 63 | 64 | 65 | 68 | 69 | **Spoiler:** 70 | 71 | ``` 72 | 73 | ... and it will be included in the specified place: 74 | 75 | **Spoiler:** 76 | -------------------------------------------------------------------------------- /docs_src/src/pages/writing/routing.md: -------------------------------------------------------------------------------- 1 | # Routing 2 | 3 | *Svelte-Docs* has built-in routing system based on files structure in the `src/pages` directory: 4 | 5 | ```bash 6 | src # URL path part: 7 | └── pages # 8 | ├── components # 9 | │ ├── list.md # components/list 10 | │ ├── button.md # components/button 11 | │ └── input.md # components/input 12 | ├── install.md # install 13 | └── index.md # / 14 | 15 | ``` 16 | 17 | You can make links anywhere in your docs with URL part based on file hierarchy. For example, if you want create link to the `src/pages/components/button.md` use `components/button` as a href attribute of the `a` element - `components/button`. Or in markdown write - `[Button](component/button)`. -------------------------------------------------------------------------------- /docs_src/src/pages/writing/settings.md: -------------------------------------------------------------------------------- 1 | # Pages configuration 2 | 3 | You can configure every pages with few parameters in markdown's metatags block at the top of needed pages. 4 | 5 | ```markdown 6 | --- 7 | parameter1: value1 8 | parameter2: value2 9 | --- 10 | ... 11 | ``` 12 | 13 | ### title 14 | 15 | You can specify title of current page. It is overwrite [`title.header`](config/title) config option. 16 | 17 | ```markdown 18 | --- 19 | title: 'My page' 20 | --- 21 | ... 22 | ``` 23 | 24 | 25 | ### layout 26 | 27 | Every theme have various layouts which can be with this property. If no layout specified will be used `default` layout. You can find list of available layouts in the themes descriptions. 28 | 29 | In this example, page will render in fullscreen layout without sidebar on the left side(assume default theme): 30 | 31 | ```markdown 32 | --- 33 | layout: 'no_sidebar' 34 | --- 35 | ... 36 | ``` -------------------------------------------------------------------------------- /docs_src/src/pages/writing/static.md: -------------------------------------------------------------------------------- 1 | # Static files 2 | 3 | Any static files used in documents such as images, icons or files for download are stored in `src/static` directory. 4 | 5 | For example, if you placed image in the `src/static/great-success.png` then you can include it by following code: 6 | 7 | ```markdown 8 | ![Great Success](static/great-success.png); 9 | ``` 10 | 11 | ... and get image on your page: 12 | 13 | ![Great Success](static/great-success.png); -------------------------------------------------------------------------------- /docs_src/src/pages/writing/structure.md: -------------------------------------------------------------------------------- 1 | # Structure 2 | 3 | Let's see the structure of the doc's project directory: 4 | 5 | ```bash 6 | src 7 | ├── includes 8 | ├── pages 9 | ├── static 10 | ├── examples.css 11 | └── theme.css 12 | ... 13 | svelte-docs.config.js 14 | ``` 15 | 16 | It is very simple, sources of you documentation are live in `src` directory: 17 | 18 | * **includes** - there are small pieces of the MDSv code that can be reusable within any document page 19 | * **pages** - all pages of your documentation are stored in this directory 20 | * **static** - place here any static assets using in your documentation (files, images, icons and etc.) 21 | * **examples.css** - it is styles using within examples 22 | * **theme.css** - tune current documentation theme with variables, add new styles or `@import` any css file. -------------------------------------------------------------------------------- /docs_src/src/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexxNB/svelte-docs/f360de962c015dc3af471b7944e7677e9adcbbd4/docs_src/src/static/favicon.png -------------------------------------------------------------------------------- /docs_src/src/static/great-success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexxNB/svelte-docs/f360de962c015dc3af471b7944e7677e9adcbbd4/docs_src/src/static/great-success.png -------------------------------------------------------------------------------- /docs_src/src/static/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 57 | 61 | 66 | 71 | 72 | 77 | 81 | 85 | 89 | 93 | 97 | 101 | 102 | 107 | 111 | 115 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /docs_src/src/static/social.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexxNB/svelte-docs/f360de962c015dc3af471b7944e7677e9adcbbd4/docs_src/src/static/social.png -------------------------------------------------------------------------------- /docs_src/src/theme.css: -------------------------------------------------------------------------------- 1 | /* Theme tunning: for full list ov variables visit the https://alexxnb.github.io/svelte-docs/theming */ 2 | -------------------------------------------------------------------------------- /docs_src/svelte-docs.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // if you will serve docs in subderictory use '/subdir/' 3 | basepath: '/svelte-docs/', 4 | 5 | theme: 'default', 6 | 7 | title: { 8 | // constant part of page title 9 | main: 'Svelte-Docs Reference', 10 | 11 | // use first header's content in the window title 12 | // looking for `# Header` and `## Header` on the current page 13 | header: true, 14 | }, 15 | 16 | // URL to your favicon 17 | favicon: 'static/favicon.png', 18 | 19 | // URL to your social link preview image (best is 1200×630) 20 | preview: 'https://alexxnb.github.io/svelte-docs/static/social.png', 21 | 22 | pathes: { 23 | // directory for files, generated in development mode 24 | dev: '__DOCS__/dev', 25 | 26 | // directory for builted documentaton 27 | build: '__DOCS__/dist', 28 | }, 29 | 30 | aliases:{ 31 | // Virtual packages in Examples 32 | // : , 33 | // 34 | // Ex1: './Button.svelte': './../dist/Button.svelte', 35 | // Ex2: 'mylib': './../dist/index.js', (don't miss `index` and `.js` at the end!) 36 | // 37 | // Then you can use in Example: 38 | // import Button from './Button.svelte'; 39 | // import { Input } from 'mylib'; 40 | 'svelte-chota': './exlibris/chota.js', 41 | './../mylib/Button.svelte': './exlibris/Button.svelte', 42 | './Button.svelte': './exlibris/Button.svelte', 43 | './Modal.svelte': './exlibris/Modal.svelte', 44 | 'my-button-package': './exlibris/Button.svelte', 45 | }, 46 | 47 | preprocess: [ 48 | // preprocessors for Svelte if needed in Examples 49 | // syntax same as for `preprocess` option in `rollup-plugin-svelte` 50 | // Ex: Import preprocessor at top of the config file: 51 | // import {markdown} from 'svelte-preprocess-markdown'; 52 | // Then add it here: 53 | // markdown({filetype: 'svelte'}), 54 | 55 | ] 56 | 57 | } -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "lockfileVersion": 1, 4 | "requires": true, 5 | "dependencies": { 6 | "balanced-match": { 7 | "version": "1.0.0", 8 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 9 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 10 | "dev": true 11 | }, 12 | "better-path-resolve": { 13 | "version": "1.0.0", 14 | "resolved": "https://registry.npmjs.org/better-path-resolve/-/better-path-resolve-1.0.0.tgz", 15 | "integrity": "sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==", 16 | "dev": true, 17 | "requires": { 18 | "is-windows": "^1.0.0" 19 | } 20 | }, 21 | "brace-expansion": { 22 | "version": "1.1.11", 23 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 24 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 25 | "dev": true, 26 | "requires": { 27 | "balanced-match": "^1.0.0", 28 | "concat-map": "0.0.1" 29 | } 30 | }, 31 | "concat-map": { 32 | "version": "0.0.1", 33 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 34 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 35 | "dev": true 36 | }, 37 | "fs-extra": { 38 | "version": "8.1.0", 39 | "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", 40 | "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", 41 | "dev": true, 42 | "requires": { 43 | "graceful-fs": "^4.2.0", 44 | "jsonfile": "^4.0.0", 45 | "universalify": "^0.1.0" 46 | } 47 | }, 48 | "fs.realpath": { 49 | "version": "1.0.0", 50 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 51 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 52 | "dev": true 53 | }, 54 | "glob": { 55 | "version": "7.1.5", 56 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.5.tgz", 57 | "integrity": "sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ==", 58 | "dev": true, 59 | "requires": { 60 | "fs.realpath": "^1.0.0", 61 | "inflight": "^1.0.4", 62 | "inherits": "2", 63 | "minimatch": "^3.0.4", 64 | "once": "^1.3.0", 65 | "path-is-absolute": "^1.0.0" 66 | } 67 | }, 68 | "graceful-fs": { 69 | "version": "4.2.3", 70 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", 71 | "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", 72 | "dev": true 73 | }, 74 | "inflight": { 75 | "version": "1.0.6", 76 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 77 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 78 | "dev": true, 79 | "requires": { 80 | "once": "^1.3.0", 81 | "wrappy": "1" 82 | } 83 | }, 84 | "inherits": { 85 | "version": "2.0.4", 86 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 87 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 88 | "dev": true 89 | }, 90 | "is-windows": { 91 | "version": "1.0.2", 92 | "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", 93 | "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", 94 | "dev": true 95 | }, 96 | "jsonfile": { 97 | "version": "4.0.0", 98 | "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", 99 | "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", 100 | "dev": true, 101 | "requires": { 102 | "graceful-fs": "^4.1.6" 103 | } 104 | }, 105 | "make-dir": { 106 | "version": "3.0.0", 107 | "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", 108 | "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", 109 | "dev": true, 110 | "requires": { 111 | "semver": "^6.0.0" 112 | } 113 | }, 114 | "minimatch": { 115 | "version": "3.0.4", 116 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 117 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 118 | "dev": true, 119 | "requires": { 120 | "brace-expansion": "^1.1.7" 121 | } 122 | }, 123 | "once": { 124 | "version": "1.4.0", 125 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 126 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 127 | "dev": true, 128 | "requires": { 129 | "wrappy": "1" 130 | } 131 | }, 132 | "path-is-absolute": { 133 | "version": "1.0.1", 134 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 135 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 136 | "dev": true 137 | }, 138 | "rename-overwrite": { 139 | "version": "2.0.2", 140 | "resolved": "https://registry.npmjs.org/rename-overwrite/-/rename-overwrite-2.0.2.tgz", 141 | "integrity": "sha512-XodkUmbg11ZzZoAkYfJYEmj8FscfeRL2KHGALeDSB76ia8A1zqQq0+WkcepXm7QkuzmW0CE3uiFUBr/UJfin+w==", 142 | "dev": true, 143 | "requires": { 144 | "graceful-fs": "^4.1.11", 145 | "rimraf": "^3.0.0" 146 | } 147 | }, 148 | "rimraf": { 149 | "version": "3.0.0", 150 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", 151 | "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", 152 | "dev": true, 153 | "requires": { 154 | "glob": "^7.1.3" 155 | } 156 | }, 157 | "semver": { 158 | "version": "6.3.0", 159 | "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 160 | "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", 161 | "dev": true 162 | }, 163 | "std-pour": { 164 | "version": "1.1.0", 165 | "resolved": "https://registry.npmjs.org/std-pour/-/std-pour-1.1.0.tgz", 166 | "integrity": "sha1-EQKd2I3OzjOWFtK/hsHA+oiL6oI=", 167 | "dev": true 168 | }, 169 | "symlink-dir": { 170 | "version": "3.1.1", 171 | "resolved": "https://registry.npmjs.org/symlink-dir/-/symlink-dir-3.1.1.tgz", 172 | "integrity": "sha512-i8+cBpaAFDWIlNT8qkpH1QPBCTEFhIPnA2w/pfndTebe4E2YysMg4XNfdaVM+qf5iyYfyHk/JY4PHmxZ00OmRA==", 173 | "dev": true, 174 | "requires": { 175 | "better-path-resolve": "^1.0.0", 176 | "graceful-fs": "^4.1.11", 177 | "make-dir": "^3.0.0", 178 | "rename-overwrite": "^2.0.1" 179 | } 180 | }, 181 | "universalify": { 182 | "version": "0.1.2", 183 | "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", 184 | "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", 185 | "dev": true 186 | }, 187 | "wrappy": { 188 | "version": "1.0.2", 189 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 190 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 191 | "dev": true 192 | } 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "0.2.0", 4 | "scripts": { 5 | "postinstall": "node scripts/install", 6 | "link": "node scripts/link", 7 | "clean": "node scripts/clean", 8 | "dev": "npm --prefix __DEV__ run dev", 9 | "build": "npm --prefix __DEV__ run build", 10 | "start": "npm --prefix __DEV__ run start", 11 | "init": "node ./packages/create/cli.js" 12 | }, 13 | "keywords": [], 14 | "author": "Alexey Schebelev", 15 | "license": "MIT", 16 | "devDependencies": { 17 | "fs-extra": "^8.1.0", 18 | "std-pour": "^1.1.0", 19 | "symlink-dir": "^3.1.1" 20 | }, 21 | "dependencies": {} 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/App.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /packages/core/aliases/rollup_plugin_aliases.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import fs from 'fs'; 3 | import { ERR } from './../utils.js'; 4 | import config from './../config'; 5 | 6 | // handle imports of virtual packages 7 | export default function() { 8 | return { 9 | name: 'rollup_plugin_aliases', 10 | 11 | resolveId(id,importer) { 12 | if(id.endsWith('.svelte') && config.aliases[id] !== undefined){ 13 | return this.resolve(config.aliases[id],importer); 14 | } 15 | return config.aliases[id] ? id : null; 16 | }, 17 | load(id) { 18 | if(config.aliases[id] !== undefined){ 19 | const pkgpath = path.resolve(config.aliases[id]); 20 | if (!fs.existsSync(pkgpath)) ERR('Config.aliases: No such file',pkgpath); 21 | 22 | if(pkgpath.endsWith('.svelte')) 23 | return `export {default} from '${pkgpath}';`; 24 | else 25 | return `export * from '${pkgpath}';`; 26 | 27 | }else 28 | return null; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /packages/core/builtins/Example/Example.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 | 43 | 44 | 45 | 46 | 55 |
{@html code.trim()}
56 |
57 | 58 | 67 | -------------------------------------------------------------------------------- /packages/core/builtins/Example/iframe.js: -------------------------------------------------------------------------------- 1 | import { addListener } from 'resize-detector'; 2 | 3 | let iframe_id = 0; 4 | 5 | function getHeight(){ 6 | return document.documentElement.offsetHeight 7 | } 8 | 9 | window.addEventListener('message', function (event) { 10 | if (event.data.hasOwnProperty("COMPONENT")) { 11 | const Example = app[event.data.COMPONENT]; 12 | iframe_id = event.data.iframe_id; 13 | 14 | 15 | addListener(document.body, (e)=>{ 16 | event.source.postMessage({ 'HEIGHT': getHeight(), iframe_id }, "*"); 17 | }); 18 | 19 | new Example({ 20 | target: document.body, 21 | props: {} 22 | }); 23 | } 24 | }); -------------------------------------------------------------------------------- /packages/core/builtins/Example/replacer.js: -------------------------------------------------------------------------------- 1 | import highlight from './../../highlight'; 2 | import { ExamplesStore } from './../../stores'; 3 | 4 | export default (content,params,name) => () => { 5 | ExamplesStore.set(name,content); 6 | 7 | if(params.script && params.script === 'hide'){ 8 | content = content.replace(/^[\t ]*`; 67 | } 68 | 69 | if(used.has('Example')) touch(EX_INDEX); 70 | 71 | return text; 72 | } 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /packages/core/config.js: -------------------------------------------------------------------------------- 1 | import importCWD from 'import-cwd'; 2 | 3 | const config = importCWD('./svelte-docs.config.js'); 4 | 5 | export default config; -------------------------------------------------------------------------------- /packages/core/constants.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import config from './config'; 3 | import {getThemePath} from './themes'; 4 | 5 | export const CWD = process.cwd(); 6 | export const CORE = path.resolve(path.join(CWD,'node_modules','@svelte-docs','core')); 7 | 8 | export const DEVPATH = path.join(CWD,config.pathes.dev); 9 | export const BUILDPATH = path.join(CWD,config.pathes.build); 10 | export const INDEX = path.join(CORE,'main.js'); 11 | 12 | export const SRC = path.join(CWD,'src'); 13 | export const PAGES = path.join(SRC,'pages'); 14 | export const INCLUDES = path.join(SRC,'includes'); 15 | export const THEME = getThemePath(); 16 | export const STATIC = path.join(SRC,'static'); 17 | export const STARTPAGE = path.join(PAGES,'index.md'); 18 | export const ERRORPAGE = path.join(INCLUDES,'error.md'); 19 | 20 | export const PROPS_CMP = path.join(THEME,'components','Properties.svelte'); 21 | export const EX_LAYOUT = path.join(THEME,'components','Example.svelte'); 22 | export const EX_CSS = path.join(SRC,'examples.css'); 23 | export const EX_CMP = path.join(CORE,'builtins','Example','Example.svelte'); 24 | export const EX_IFRAME = path.join(CORE,'builtins','Example','iframe.js'); 25 | export const EX_INDEX = path.join(CORE,'examples.main.js'); 26 | -------------------------------------------------------------------------------- /packages/core/examples.main.js: -------------------------------------------------------------------------------- 1 | export * from 'examples_src.js'; -------------------------------------------------------------------------------- /packages/core/fixidents/rollup_plugin_fixidents.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import fs from 'fs-extra'; 3 | 4 | // this will remove idents inside
 tags in builted bundle;
 5 | export default function () {
 6 |     
 7 |     const ident_remover = function(text) {
 8 |         return text.replace(/(]+>)\\n\\t\\t\\t/,'$1').replace(/\\t\\t\\t/g,'');
 9 |     }
10 | 
11 |     let FILE = '';
12 |     return {
13 |         name: 'rollup_plugin_fixident',
14 |         writeBundle: async (opts, bundle) => {
15 |            fs.writeFileSync(opts.file, bundle[path.basename(opts.file)].code.replace(/innerHTML=''/g,ident_remover));
16 |         }
17 |     }
18 | }
19 | 


--------------------------------------------------------------------------------
/packages/core/highlight.js:
--------------------------------------------------------------------------------
 1 | import hljs from 'highlight.js';
 2 | import hljs_svelte from 'highlightjs-svelte';
 3 | 
 4 | hljs_svelte(hljs);
 5 | 
 6 | export default function(text,lang,interpolation=false) {
 7 |     lang = (lang || 'svelte');
 8 | 
 9 |     const result = hljs.highlight(lang,text);
10 | 
11 |     let code = result.value
12 |             .replace(/{/g,'{')
13 |             .replace(/}/g,'}');
14 |             
15 |     if(interpolation){
16 |         code = code
17 |             .replace(/"/g,'\\"')
18 |             .replace(/\n/g,'\\n');
19 |     }
20 |     
21 |     return code;
22 |   }


--------------------------------------------------------------------------------
/packages/core/indexer/rollup_plugin_indexer.js:
--------------------------------------------------------------------------------
 1 | import path from 'path';
 2 | import fs from 'fs-extra';
 3 | import { PAGES } from './../constants';
 4 | import config from './../config';
 5 | 
 6 | 
 7 | export default function (dev=false) {
 8 | 
 9 |     return {
10 |         name: 'rollup_plugin_indexer',
11 |         writeBundle(opts) { 
12 |             const dir = opts.dir || path.dirname(opts.file);
13 | 
14 |             fs.outputFileSync(path.join(dir,'index.html'),getTemplate());
15 | 
16 |             if(!dev) goTree(PAGES);               
17 |         }
18 |     }
19 | }
20 | 
21 | function goTree(dir,slug='') {
22 |     fs.readdirSync(dir).forEach( file => {
23 |         const filepath = path.join(dir,file);
24 |         if(fs.statSync(filepath).isDirectory()){
25 |             if(!file.startsWith('_')){
26 |                goTree(filepath,path.join(slug,file));
27 |             }
28 |         }else{
29 |             const match = file.match(/^([^_][\S]+)\.(?:md|svelte)$/);
30 |             if(match){
31 |                 fs.outputFileSync(path.join(config.pathes.build,config.basepath,slug,match[1],'index.html'),getTemplate());
32 |             }
33 |         }
34 |     });
35 | }
36 | 
37 | function getTemplate(){
38 |     
39 |     return `
40 | 
41 | 
42 |     
43 |     
44 |     
45 |     ${config.title.main}
46 |     ${config.favicon ? `` : ''}
47 |     
48 |     
49 | 
50 | 
51 | 
52 | 
53 | `
54 | }


--------------------------------------------------------------------------------
/packages/core/main.js:
--------------------------------------------------------------------------------
1 | import App from './App.svelte';
2 | 
3 | const app = new App({
4 | 	target: document.body,
5 | 	props: {}
6 | });
7 | 
8 | export default app;


--------------------------------------------------------------------------------
/packages/core/navigation.js:
--------------------------------------------------------------------------------
 1 | import {writable} from 'svelte/store';
 2 | 
 3 | export const url = writable(getURL());
 4 | 
 5 | export function go(href){
 6 |     history.pushState({}, '', href === '' ? getBasepath() : href);
 7 |     url.set(href.split('#')[0]);
 8 | }
 9 | 
10 | export function initNavigation() {
11 |     addEventListener('click', click);
12 |     addEventListener('popstate', gohistory);
13 |     
14 |     return function() {
15 |         removeEventListener('click', click);
16 |         removeEventListener('popstate', gohistory);
17 |     }
18 | }
19 | 
20 | function gohistory(){
21 |     url.set(getURL());
22 | }
23 | 
24 | function getURL() {
25 |     let path = location.pathname;
26 |     path = cleanURL(path);
27 |     return path;
28 | }
29 | 
30 | function click (event) {
31 | 
32 |     const a = event.target.closest('a');
33 |     if(!a) return;
34 | 
35 |     const href = a.getAttribute('href');
36 |     
37 |     if(!href) return;
38 |     
39 |     // Open external links in new tab
40 |     if(/^\w+:\/\//.test(href)) {
41 |         a.setAttribute('target','_blank');
42 |         return;
43 |     }
44 |     
45 |     event.preventDefault();
46 | 
47 |     if(/^\/$/.test(href)) {
48 |         return go('')
49 |     }
50 |     return go(href);
51 | }
52 | 
53 | function cleanURL(url){
54 |     const basepath = getBasepath();
55 |     if(url.startsWith(basepath)) url = url.slice(basepath.length);
56 |     if(url.startsWith('/')) url = url.slice(1);
57 |     if(url.endsWith('/')) url = url.slice(0,-1);
58 |     return url;
59 | }
60 | 
61 | function getBasepath(){
62 |     let basepath = (document.querySelector('base') || {}).href.replace(window.location.origin,'').slice(0,-1);
63 |     return basepath === '' ? '/' : basepath;
64 | }
65 | 


--------------------------------------------------------------------------------
/packages/core/package.json:
--------------------------------------------------------------------------------
 1 | {
 2 |   "name": "@svelte-docs/core",
 3 |   "version": "0.10.13",
 4 |   "description": "Core of Svelte-docs builder",
 5 |   "dependencies": {
 6 |     "@rollup/plugin-commonjs": "^11.1.0",
 7 |     "@rollup/plugin-node-resolve": "^7.1.3",
 8 |     "chalk": "^2.4.2",
 9 |     "espree": "^6.1.2",
10 |     "fs-extra": "^8.1.0",
11 |     "hasha": "^5.2.2",
12 |     "highlight.js": "^10.4.1",
13 |     "highlightjs-svelte": "^1.0.6",
14 |     "import-cwd": "^3.0.0",
15 |     "ini": "^2.0.0",
16 |     "node-watch": "^0.6.4",
17 |     "postcss-import": "^12.0.1",
18 |     "resize-detector": "^0.2.2",
19 |     "rollup": "^2.35.1",
20 |     "rollup-plugin-livereload": "^1.3.0",
21 |     "rollup-plugin-postcss": "^2.9.0",
22 |     "rollup-plugin-svelte": "^7.0.0",
23 |     "rollup-plugin-terser": "^7.0.2",
24 |     "svelte": "^3.31.0",
25 |     "svelte-preprocess-markdown": "^2.7.3",
26 |     "sync-folders": "^2.0.0",
27 |     "touch": "^3.1.0"
28 |   },
29 |   "keywords": [],
30 |   "repository": {
31 |     "type": "git",
32 |     "url": "git+https://github.com/AlexxNB/svelte-docs.git"
33 |   },
34 |   "author": "Alexey Schebelev",
35 |   "license": "MIT",
36 |   "bugs": {
37 |     "url": "https://github.com/AlexxNB/svelte-docs/issues"
38 |   },
39 |   "homepage": "https://alexxnb.github.io/svelte-docs"
40 | }
41 | 


--------------------------------------------------------------------------------
/packages/core/pages/rollup_plugin_pages.js:
--------------------------------------------------------------------------------
 1 | import getRoutes from './routes';
 2 | import config from './../config';
 3 | 
 4 | const imports = {
 5 |     "@svelte-docs/get/routes": getRoutes,
 6 |     "@svelte-docs/get/maintitle": ()=>`export default '${config.title.main}'`,
 7 | }
 8 | 
 9 | export function pages() {
10 |     return {
11 |         name: 'rollup_plugin_pages',
12 |         resolveId(id) { return imports[id] !== undefined ? id : null },
13 |         load(id) { 
14 |             if(imports[id] !== undefined) return imports[id](); 
15 |             return null;
16 |         }
17 |     }
18 | }


--------------------------------------------------------------------------------
/packages/core/pages/routes.js:
--------------------------------------------------------------------------------
  1 | import path from 'path';
  2 | import fs from 'fs';
  3 | 
  4 | import {PAGES,STARTPAGE,ERRORPAGE} from './../constants';
  5 | import config from './../config';
  6 | 
  7 | 
  8 | export default function () {
  9 |     const pages = getRoutes(PAGES);
 10 | 
 11 |     const strImports = pages.map(item =>`import {default as ${item.component}, META as ${item.component}_META} from '${item.path}'`).join(";\n");
 12 |     const strRoutes = pages.map(item =>`{
 13 |         url: '${item.route}', 
 14 |         component:${item.component}, 
 15 |         title: (${item.component}_META.hasOwnProperty('title')) ? ${item.component}_META.title : ${item.title ? `'${item.title}'` : null},
 16 |         meta:${item.component}_META
 17 |     }`).join(",\n");
 18 | 
 19 |     return `${strImports}
 20 | 
 21 |     import {derived} from 'svelte/store';
 22 |     import {url} from '@svelte-docs/core/navigation'
 23 |     
 24 |     const routes = [
 25 |         ${strRoutes}
 26 |     ]
 27 | 
 28 |     const error_route = routes.filter(r => r.url === 'sd:error')[0];
 29 | 
 30 |     export const current_page = derived(url,$url => {
 31 | 
 32 |         const route = routes.filter(r => r.url === $url);
 33 |         
 34 |         if(route.length > 0)
 35 |             return route[0];
 36 |         else
 37 |             return error_route;
 38 |     });
 39 |     `;
 40 | }
 41 | 
 42 | function getRoutes(dir,slug='') {
 43 |     slug = `${slug}/`;
 44 | 
 45 |     let pages = [];
 46 |     if(slug==='/') {
 47 |         pages.push({
 48 |             component:'Startpage',
 49 |             route:'',
 50 |             path:STARTPAGE,
 51 |             title:retrieveTitleFromHeader(STARTPAGE)
 52 |         });
 53 | 
 54 |         pages.push({
 55 |             component:'Errorpage',
 56 |             route:'sd:error',
 57 |             path:ERRORPAGE,
 58 |             title:retrieveTitleFromHeader(ERRORPAGE)
 59 |         });
 60 |     }
 61 | 
 62 |     fs.readdirSync(dir).forEach( file => {
 63 |         const filepath = path.join(dir,file);
 64 |         if(isDir(filepath)){
 65 |             if(!file.startsWith('_')){
 66 |                const subpages = getRoutes(filepath,slug+formatSlug(file));
 67 |                pages = pages.concat(subpages);
 68 |             }
 69 |         }else{
 70 |             const match = file.match(/^([^_][\S]+)\.(?:md|svelte)$/);
 71 |             if(match){
 72 |                 const compname = formatComponentName(match[1]);
 73 |                 const url = slug+formatSlug(match[1]);
 74 |                 pages.push({
 75 |                     component:compname,
 76 |                     route:url.slice(1),
 77 |                     path:filepath,
 78 |                     title:retrieveTitleFromHeader(filepath)
 79 |                 });
 80 |             }
 81 |         }
 82 |     });
 83 | 
 84 |     return pages;
 85 | }
 86 | 
 87 | function isDir(filepath) {
 88 |     return fs.statSync(filepath).isDirectory()
 89 | }
 90 | 
 91 | function formatComponentName(text){
 92 |     return formatSlug(text)
 93 |         .split('-')
 94 |         .reduce(
 95 |             (name,word) => {
 96 |                return name + word.charAt(0).toUpperCase() + word.slice(1);
 97 |             },'');
 98 | }
 99 | 
100 | function formatSlug(text){
101 |     return text.replace(/[^\w\d\-]/g,'-');
102 | }
103 | 
104 | function retrieveTitleFromHeader(filename){
105 |     if(config.title.header !== true) return null;
106 | 
107 |     let source = fs.readFileSync(filename,'utf-8');
108 | 
109 |     let re = /^\s*(#{1,2}(?!#)|)((.+)(\1|<\/h\2>)|(.+)$)/mi;
110 |     let result = source.match(re);
111 |     return (result) ? String(result[4] || result[6]).trim() : null;
112 | }


--------------------------------------------------------------------------------
/packages/core/replacer/rollup_plugin_replacer.js:
--------------------------------------------------------------------------------
 1 | import {CWD,SRC,INCLUDES,THEME} from './../constants';
 2 | 
 3 | const vars = {
 4 |     "@CWD": CWD,
 5 |     "@SRC": SRC,
 6 |     "@INCLUDES": INCLUDES,
 7 |     "@THEME": THEME,
 8 | }
 9 | 
10 | export default function () {
11 |     return {
12 |         name: 'rollup_plugin_replacer',
13 |         resolveId(id) { 
14 |             return Object.keys(vars).reduce((str,v) => {
15 |                 return (id.startsWith(v)) ? id.replace(v,vars[v]) : str;
16 |             },null);
17 |         }
18 |     }
19 | }


--------------------------------------------------------------------------------
/packages/core/rollup.config.js:
--------------------------------------------------------------------------------
  1 | import fs from 'fs-extra';
  2 | import path from 'path';
  3 | import svelte from 'rollup-plugin-svelte';
  4 | import resolve from '@rollup/plugin-node-resolve';
  5 | import commonjs from '@rollup/plugin-commonjs';
  6 | import livereload from 'rollup-plugin-livereload';
  7 | import { terser } from 'rollup-plugin-terser';
  8 | import {markdown} from 'svelte-preprocess-markdown';
  9 | import postcss from 'rollup-plugin-postcss';
 10 | import postcssImport from 'postcss-import';
 11 | 
 12 | import replacer from './replacer/rollup_plugin_replacer';
 13 | import aliases from './aliases/rollup_plugin_aliases';
 14 | import indexer from './indexer/rollup_plugin_indexer';
 15 | import syncer from './syncer/rollup_plugin_syncer';
 16 | import fixidents from './fixidents/rollup_plugin_fixidents';
 17 | import {pages} from './pages/rollup_plugin_pages';
 18 | import {example_component, examples_sources,examples_index} from './builtins/rollup_plugin_examples';
 19 | import {builtins} from './builtins/svelte_preprocess_builtins';
 20 | 
 21 | import {INDEX,DEVPATH,BUILDPATH,EX_INDEX,SRC} from './constants';
 22 | import highlight from './highlight';
 23 | import config from './config';
 24 | 
 25 | const production = !process.env.ROLLUP_WATCH;
 26 | 
 27 | const DIR = production ? path.join(BUILDPATH,config.basepath) : path.join(DEVPATH,config.basepath);
 28 | 
 29 | fs.removeSync(DIR);
 30 | 
 31 | export default [{
 32 | 	input: INDEX,
 33 | 	output: {
 34 | 		sourcemap: !production,
 35 | 		format: 'iife',
 36 | 		name: 'app',
 37 | 		file: path.join(DIR,'bundle.js')
 38 | 	},
 39 | 	plugins: [
 40 | 		replacer(),
 41 | 		aliases(),
 42 | 		indexer(!production),
 43 | 		syncer(!production),
 44 | 		pages(),
 45 | 		example_component(),
 46 | 		svelte({
 47 | 			dev: !production,
 48 | 			emitCss:true,
 49 | 			extensions: ['.svelte','.md'],
 50 | 			preprocess: [
 51 | 				builtins(),
 52 | 				markdown({highlight,headerIds:true})
 53 | 			]
 54 | 		}),
 55 | 		postcss({
 56 |             extract: true,
 57 |             minimize: production,
 58 | 			sourceMap: !production,
 59 | 			plugins:[
 60 | 				postcssImport()
 61 | 			]
 62 |         }),
 63 | 		resolve({
 64 | 			browser: true,
 65 | 			dedupe: importee => importee === 'svelte' || importee.startsWith('svelte/')
 66 | 		}),
 67 | 		commonjs(),
 68 | 		!production && livereload(DIR),
 69 | 		production && terser(),
 70 | 		production && fixidents(),
 71 | 	],
 72 | 	watch: {
 73 | 		clearScreen: false,
 74 | 		exclude: [SRC]
 75 | 	}
 76 | },
 77 | // Examples bundle
 78 | {
 79 | 	input: EX_INDEX,
 80 | 	output: {
 81 | 		sourcemap: false,
 82 | 		format: 'iife',
 83 | 		name: 'app',
 84 | 		file: path.join(DIR,'examples.js')
 85 | 	},
 86 | 	plugins: [
 87 | 		aliases(),
 88 | 		examples_index(),
 89 | 		examples_sources(),
 90 | 		production && fixidents(),
 91 | 		svelte({
 92 | 			dev: production,
 93 | 			emitCss:true,
 94 | 			extensions: ['.svelte'],
 95 | 			preprocess: config.preprocess
 96 | 		}),
 97 | 		postcss({
 98 |             extract: true,
 99 |             minimize: production,
100 | 			sourceMap: false,
101 | 			plugins:[
102 | 				postcssImport()
103 | 			]
104 |         }),
105 | 		resolve({
106 | 			browser: true,
107 | 			dedupe: importee => importee === 'svelte' || importee.startsWith('svelte/')
108 | 		}),
109 | 		commonjs(),
110 | 		production && terser()
111 | 	],
112 | 	watch: {
113 | 		clearScreen: false,
114 | 		exclude: [SRC]
115 | 	}
116 | }];


--------------------------------------------------------------------------------
/packages/core/stores.js:
--------------------------------------------------------------------------------
 1 | let STORES = {};
 2 | 
 3 | export const ExamplesStore = init_store();
 4 | 
 5 | function init_store() {
 6 |     const id = {};
 7 |     STORES[id] = {};
 8 |     return {
 9 |         set: (name,value) => {
10 |             STORES[id][name] = value
11 |         },
12 |         get: (name) => {
13 |             if(name){
14 |                 let list = {};
15 |                 if(name instanceof RegExp){
16 |                     Object.keys(STORES[id]).forEach(item => {
17 |                         if(name.test(item)) list[item]= STORES[id][item];
18 |                     });
19 |                     return list;
20 |                 }else{
21 |                     return STORES[id][name];
22 |                 }
23 |             }
24 | 
25 |             return STORES[id];
26 |         },
27 |         length: () => {
28 |             return STORES[id].length;
29 |         },
30 |         clear: () => {
31 |             STORES[id] = {};
32 |         },
33 |         delete: (name) => {
34 |             if(name instanceof RegExp){
35 |                 Object.keys(STORES[id]).forEach(item => {
36 |                     if(name.test(item)) delete STORES[id][item];
37 |                 });
38 |             }else{
39 |                 delete STORES[id][name];
40 |             }
41 |         }
42 |     }
43 | }
44 | 
45 | 
46 | 


--------------------------------------------------------------------------------
/packages/core/syncer/rollup_plugin_syncer.js:
--------------------------------------------------------------------------------
 1 | import path from 'path';
 2 | import fs from 'fs-extra';
 3 | import syncFolders from 'sync-folders';
 4 | 
 5 | import {STATIC,THEME} from './../constants';
 6 | 
 7 | const assets = [
 8 |     path.join(THEME,'assets'),
 9 |     STATIC,
10 | ]
11 | 
12 | export default function (dev=false) {
13 |     const options = {
14 |         type: dev ? 'hardlink' : 'copy'
15 |     }
16 | 
17 |     return {
18 |         name: 'rollup_plugin_syncer',
19 |         generateBundle(opts, bundle) { 
20 |             const dir = opts.dir || path.dirname(opts.file);
21 |             assets.forEach(asset => {
22 |                 const filepath = path.resolve(asset)
23 |                 if(fs.pathExistsSync(filepath)){
24 |                     syncFolders(filepath, dir, options);
25 |                 }
26 |             })
27 |         }
28 |     }
29 | }
30 | 


--------------------------------------------------------------------------------
/packages/core/themes.js:
--------------------------------------------------------------------------------
 1 | import fs from 'fs-extra';
 2 | import path from 'path';
 3 | import config from './config';
 4 | 
 5 | const CWD = process.cwd();
 6 | 
 7 | export function getThemePath(){
 8 |     if(!config.theme) throw new Error('No theme option in the `svelte-docs.config.js`');
 9 |     
10 | 
11 |     // Check if theme is present in default pack
12 |     const package_path = path.join(CWD,'node_modules','@svelte-docs','themes',config.theme);
13 |     if(fs.existsSync(package_path)) return package_path;
14 | 
15 |     // Check if user set option to the local path
16 |     const local_path = path.resolve(config.theme);
17 |     if(fs.existsSync(local_path)) return local_path;
18 | 
19 |     throw new Error('Unknown theme option value in the `svelte-docs.config.js`');
20 | }
21 | 


--------------------------------------------------------------------------------
/packages/core/utils.js:
--------------------------------------------------------------------------------
 1 | import chalk from 'chalk';
 2 | import path from 'path';
 3 | import fs from 'fs-extra';
 4 | import config from './config';
 5 | 
 6 | export function ERR(text,comment) {
 7 |     console.log(chalk.bold.red('(!)',text));
 8 |     if(comment !== undefined) console.log(chalk.red(comment));
 9 |     process.exit(1);
10 | }
11 | 
12 | export function getRealImportedPath(filepath){
13 | //0. is path exists
14 |     if(fs.pathExistsSync(filepath)) return filepath;
15 |     const alias = config.aliases[filepath];
16 | 
17 |     if (alias) {
18 |         let pieces = alias.split('/');
19 |         let mdl = pieces[0];
20 |         let rel = pieces
21 | 
22 | //1. plain search in virtual modules
23 |         if(alias !== undefined){
24 |             filepath = path.resolve(alias);
25 |             if(fs.pathExistsSync(filepath)) return filepath;
26 |         }
27 | //2. relative search in virtual modules
28 |         if(config.aliases[mdl] !== undefined) {
29 |             filepath = path.resolve(path.join(config.aliases[mdl],rel));
30 |             if(fs.pathExistsSync(filepath)) return filepath;
31 |         }
32 |     }
33 | 
34 | //3. relative search in nodemodules
35 |     const nodepath = path.resolve(path.join('.','node_modules',filepath))
36 |     if(fs.pathExistsSync(nodepath)) return nodepath;
37 | 
38 |     return undefined;
39 | }
40 | 


--------------------------------------------------------------------------------
/packages/core/watcher.js:
--------------------------------------------------------------------------------
 1 | const path = require('path');
 2 | const touch = require('touch');
 3 | const watch = require('node-watch');
 4 | 
 5 | const watch_path = [
 6 |     path.resolve('./src'),
 7 | ]
 8 | 
 9 | const touch_path = path.resolve('./node_modules/@svelte-docs/core/App.svelte');
10 | 
11 | 
12 | watch(watch_path, { recursive: true }, function(evt, name) {
13 |     touch(touch_path);
14 | });
15 | 


--------------------------------------------------------------------------------
/packages/create/cli.js:
--------------------------------------------------------------------------------
  1 | #!/usr/bin/env node
  2 | const fs = require('fs-extra')
  3 | const path = require('path')
  4 | const meow = require('meow')
  5 | const prompts = require('prompts/dist')
  6 | const chalk = require('chalk')
  7 | const fetchRepoDir = require('fetch-repo-dir');
  8 | const exec = require('shelljs.exec');
  9 | 
 10 | const logo = chalk.bold('[Svelte-Docs]')
 11 | const log = (...args) => {
 12 |   console.log(logo, ...args)
 13 | }
 14 | log.error = (...args) => {
 15 |   console.log(chalk.red('[ERROR]'), ...args)
 16 | }
 17 | 
 18 | function npminstall (dir) {
 19 |   return new Promise((resolve, reject) => {
 20 |     const child = spawn('npm', [ '--prefix', dir, 'install' ], {
 21 |       stdio: 'inherit'
 22 |     })
 23 |     child.on('close', code => {
 24 |       if (code !== 0) {
 25 |         reject()
 26 |         return
 27 |       }
 28 |       resolve()
 29 |     })
 30 |   })
 31 | }
 32 | 
 33 | const themes = [
 34 |   { name: 'Default', path: 'default' },
 35 | ]
 36 | 
 37 | const cli = meow(`
 38 |   Usage
 39 | 
 40 |     $ npm init svelte-docs
 41 | 
 42 |     $ npx create-svelte-docs
 43 | 
 44 |   Options
 45 | 
 46 |     --name  Directory name for docs
 47 | 
 48 |     -y      Create docs without confirmation step
 49 | 
 50 | `, {
 51 |   booleanDefault: undefined,
 52 |   flags: {
 53 |     help: {
 54 |       type: 'boolean',
 55 |       alias: 'h'
 56 |     },
 57 |     version: {
 58 |       type: 'boolean',
 59 |       alias: 'v'
 60 |     },
 61 |     name: {
 62 |       type: 'string'
 63 |     },
 64 |     confirm: {
 65 |       type: 'boolean',
 66 |       alias: 'y'
 67 |     }
 68 |   }
 69 | })
 70 | 
 71 | const form = [
 72 |   /*
 73 |   {
 74 |     type: 'select',
 75 |     name: 'template',
 76 |     message: 'Choose a base template',
 77 |     choices: templates.map(({ name }, i) => ({ title: name, value: i }))
 78 |   },
 79 |   */
 80 |   {
 81 |     type: 'text',
 82 |     name: 'name',
 83 |     message: 'Choose a name for the docs sources folder',
 84 |     initial: 'docs_src'
 85 |   },
 86 |   {
 87 |     type: 'confirm',
 88 |     name: 'confirm',
 89 |     message: (prev, values) => `Create docs sources in ${values.name}?`,
 90 |     initial: true
 91 |   }
 92 | ]
 93 | 
 94 | const run = async opts => {
 95 |   prompts.inject(opts)
 96 |   const response = await prompts(form)
 97 | 
 98 |   if (!response.confirm) {
 99 |     log('aborted')
100 |     process.exit(0)
101 |   }
102 |   const { name } = response
103 |   const theme = themes[response.theme] || themes[0]
104 | 
105 |   log('Creating docs ...')
106 | 
107 |   if (!name) {
108 |     log.error('name is required')
109 |     process.exit(1)
110 |   }
111 | 
112 |   if (!theme) {
113 |     log.error('theme not found')
114 |     process.exit(1)
115 |   }
116 | 
117 |   try{
118 |     log('Downloading docs template...');
119 |     await fetchRepoDir([
120 |       {src: 'alexxnb/svelte-docs/template', dir:name},
121 |     ]);
122 |     log('Installing NPM packages...');
123 |     exec(`npm --prefix ${name} install`);
124 |     log('Docs created succesfully!')
125 |     log(chalk.green(`Go to the ${name} and execute 'npm run dev' command`));
126 |     process.exit(0)
127 |   }catch(err){
128 |     log.error('Failed to create docs')
129 |       log.error(err)
130 |       process.exit(1)
131 |   }
132 | }
133 | 
134 | run(cli.flags);
135 | 
136 | 


--------------------------------------------------------------------------------
/packages/create/package-lock.json:
--------------------------------------------------------------------------------
  1 | {
  2 |   "name": "create-svelte-docs",
  3 |   "version": "0.3.1",
  4 |   "lockfileVersion": 1,
  5 |   "requires": true,
  6 |   "dependencies": {
  7 |     "ansi-styles": {
  8 |       "version": "3.2.1",
  9 |       "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
 10 |       "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
 11 |       "requires": {
 12 |         "color-convert": "^1.9.0"
 13 |       }
 14 |     },
 15 |     "array-find-index": {
 16 |       "version": "1.0.2",
 17 |       "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz",
 18 |       "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E="
 19 |     },
 20 |     "arrify": {
 21 |       "version": "1.0.1",
 22 |       "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
 23 |       "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0="
 24 |     },
 25 |     "at-least-node": {
 26 |       "version": "1.0.0",
 27 |       "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
 28 |       "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg=="
 29 |     },
 30 |     "balanced-match": {
 31 |       "version": "1.0.0",
 32 |       "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
 33 |       "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
 34 |     },
 35 |     "brace-expansion": {
 36 |       "version": "1.1.11",
 37 |       "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
 38 |       "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
 39 |       "requires": {
 40 |         "balanced-match": "^1.0.0",
 41 |         "concat-map": "0.0.1"
 42 |       }
 43 |     },
 44 |     "camelcase": {
 45 |       "version": "4.1.0",
 46 |       "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
 47 |       "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0="
 48 |     },
 49 |     "camelcase-keys": {
 50 |       "version": "4.2.0",
 51 |       "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz",
 52 |       "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=",
 53 |       "requires": {
 54 |         "camelcase": "^4.1.0",
 55 |         "map-obj": "^2.0.0",
 56 |         "quick-lru": "^1.0.0"
 57 |       }
 58 |     },
 59 |     "chalk": {
 60 |       "version": "2.4.2",
 61 |       "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
 62 |       "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
 63 |       "requires": {
 64 |         "ansi-styles": "^3.2.1",
 65 |         "escape-string-regexp": "^1.0.5",
 66 |         "supports-color": "^5.3.0"
 67 |       }
 68 |     },
 69 |     "chownr": {
 70 |       "version": "2.0.0",
 71 |       "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz",
 72 |       "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ=="
 73 |     },
 74 |     "color-convert": {
 75 |       "version": "1.9.3",
 76 |       "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
 77 |       "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
 78 |       "requires": {
 79 |         "color-name": "1.1.3"
 80 |       }
 81 |     },
 82 |     "color-name": {
 83 |       "version": "1.1.3",
 84 |       "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
 85 |       "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
 86 |     },
 87 |     "concat-map": {
 88 |       "version": "0.0.1",
 89 |       "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
 90 |       "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
 91 |     },
 92 |     "currently-unhandled": {
 93 |       "version": "0.4.1",
 94 |       "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz",
 95 |       "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=",
 96 |       "requires": {
 97 |         "array-find-index": "^1.0.1"
 98 |       }
 99 |     },
100 |     "decamelize": {
101 |       "version": "1.2.0",
102 |       "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
103 |       "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
104 |     },
105 |     "decamelize-keys": {
106 |       "version": "1.1.0",
107 |       "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz",
108 |       "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=",
109 |       "requires": {
110 |         "decamelize": "^1.1.0",
111 |         "map-obj": "^1.0.0"
112 |       },
113 |       "dependencies": {
114 |         "map-obj": {
115 |           "version": "1.0.1",
116 |           "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
117 |           "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0="
118 |         }
119 |       }
120 |     },
121 |     "error-ex": {
122 |       "version": "1.3.2",
123 |       "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
124 |       "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
125 |       "requires": {
126 |         "is-arrayish": "^0.2.1"
127 |       }
128 |     },
129 |     "escape-string-regexp": {
130 |       "version": "1.0.5",
131 |       "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
132 |       "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
133 |     },
134 |     "fetch-repo-dir": {
135 |       "version": "1.0.4",
136 |       "resolved": "https://registry.npmjs.org/fetch-repo-dir/-/fetch-repo-dir-1.0.4.tgz",
137 |       "integrity": "sha512-b7CsdtY2jkvH8O7P5zb0TLlYZ0iLhVcSL4hRO0y6h6CUwD6KbtyHGv2WVhDUau1Kzsod/3wYhGM9ziUSHoI7MA==",
138 |       "requires": {
139 |         "fs-extra": "^9.0.0",
140 |         "tar": "^6.0.1",
141 |         "tmp": "^0.1.0"
142 |       },
143 |       "dependencies": {
144 |         "fs-extra": {
145 |           "version": "9.0.1",
146 |           "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz",
147 |           "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==",
148 |           "requires": {
149 |             "at-least-node": "^1.0.0",
150 |             "graceful-fs": "^4.2.0",
151 |             "jsonfile": "^6.0.1",
152 |             "universalify": "^1.0.0"
153 |           }
154 |         },
155 |         "jsonfile": {
156 |           "version": "6.1.0",
157 |           "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
158 |           "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
159 |           "requires": {
160 |             "graceful-fs": "^4.1.6",
161 |             "universalify": "^2.0.0"
162 |           },
163 |           "dependencies": {
164 |             "universalify": {
165 |               "version": "2.0.0",
166 |               "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
167 |               "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ=="
168 |             }
169 |           }
170 |         },
171 |         "universalify": {
172 |           "version": "1.0.0",
173 |           "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz",
174 |           "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug=="
175 |         }
176 |       }
177 |     },
178 |     "find-up": {
179 |       "version": "2.1.0",
180 |       "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
181 |       "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
182 |       "requires": {
183 |         "locate-path": "^2.0.0"
184 |       }
185 |     },
186 |     "fs-extra": {
187 |       "version": "8.1.0",
188 |       "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
189 |       "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
190 |       "requires": {
191 |         "graceful-fs": "^4.2.0",
192 |         "jsonfile": "^4.0.0",
193 |         "universalify": "^0.1.0"
194 |       }
195 |     },
196 |     "fs-minipass": {
197 |       "version": "2.1.0",
198 |       "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
199 |       "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==",
200 |       "requires": {
201 |         "minipass": "^3.0.0"
202 |       }
203 |     },
204 |     "fs.realpath": {
205 |       "version": "1.0.0",
206 |       "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
207 |       "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
208 |     },
209 |     "glob": {
210 |       "version": "7.1.6",
211 |       "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
212 |       "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
213 |       "requires": {
214 |         "fs.realpath": "^1.0.0",
215 |         "inflight": "^1.0.4",
216 |         "inherits": "2",
217 |         "minimatch": "^3.0.4",
218 |         "once": "^1.3.0",
219 |         "path-is-absolute": "^1.0.0"
220 |       }
221 |     },
222 |     "graceful-fs": {
223 |       "version": "4.2.3",
224 |       "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz",
225 |       "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ=="
226 |     },
227 |     "has-flag": {
228 |       "version": "3.0.0",
229 |       "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
230 |       "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
231 |     },
232 |     "hosted-git-info": {
233 |       "version": "2.8.5",
234 |       "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz",
235 |       "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg=="
236 |     },
237 |     "indent-string": {
238 |       "version": "3.2.0",
239 |       "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz",
240 |       "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok="
241 |     },
242 |     "inflight": {
243 |       "version": "1.0.6",
244 |       "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
245 |       "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
246 |       "requires": {
247 |         "once": "^1.3.0",
248 |         "wrappy": "1"
249 |       }
250 |     },
251 |     "inherits": {
252 |       "version": "2.0.4",
253 |       "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
254 |       "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
255 |     },
256 |     "is-arrayish": {
257 |       "version": "0.2.1",
258 |       "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
259 |       "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0="
260 |     },
261 |     "is-plain-obj": {
262 |       "version": "1.1.0",
263 |       "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz",
264 |       "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4="
265 |     },
266 |     "json-parse-better-errors": {
267 |       "version": "1.0.2",
268 |       "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
269 |       "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw=="
270 |     },
271 |     "jsonfile": {
272 |       "version": "4.0.0",
273 |       "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
274 |       "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
275 |       "requires": {
276 |         "graceful-fs": "^4.1.6"
277 |       }
278 |     },
279 |     "kleur": {
280 |       "version": "2.0.2",
281 |       "resolved": "https://registry.npmjs.org/kleur/-/kleur-2.0.2.tgz",
282 |       "integrity": "sha512-77XF9iTllATmG9lSlIv0qdQ2BQ/h9t0bJllHlbvsQ0zUWfU7Yi0S8L5JXzPZgkefIiajLmBJJ4BsMJmqcf7oxQ=="
283 |     },
284 |     "load-json-file": {
285 |       "version": "4.0.0",
286 |       "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
287 |       "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=",
288 |       "requires": {
289 |         "graceful-fs": "^4.1.2",
290 |         "parse-json": "^4.0.0",
291 |         "pify": "^3.0.0",
292 |         "strip-bom": "^3.0.0"
293 |       }
294 |     },
295 |     "locate-path": {
296 |       "version": "2.0.0",
297 |       "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
298 |       "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
299 |       "requires": {
300 |         "p-locate": "^2.0.0",
301 |         "path-exists": "^3.0.0"
302 |       }
303 |     },
304 |     "loud-rejection": {
305 |       "version": "1.6.0",
306 |       "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz",
307 |       "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=",
308 |       "requires": {
309 |         "currently-unhandled": "^0.4.1",
310 |         "signal-exit": "^3.0.0"
311 |       }
312 |     },
313 |     "map-obj": {
314 |       "version": "2.0.0",
315 |       "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz",
316 |       "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk="
317 |     },
318 |     "meow": {
319 |       "version": "5.0.0",
320 |       "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz",
321 |       "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==",
322 |       "requires": {
323 |         "camelcase-keys": "^4.0.0",
324 |         "decamelize-keys": "^1.0.0",
325 |         "loud-rejection": "^1.0.0",
326 |         "minimist-options": "^3.0.1",
327 |         "normalize-package-data": "^2.3.4",
328 |         "read-pkg-up": "^3.0.0",
329 |         "redent": "^2.0.0",
330 |         "trim-newlines": "^2.0.0",
331 |         "yargs-parser": "^10.0.0"
332 |       }
333 |     },
334 |     "minimatch": {
335 |       "version": "3.0.4",
336 |       "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
337 |       "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
338 |       "requires": {
339 |         "brace-expansion": "^1.1.7"
340 |       }
341 |     },
342 |     "minimist-options": {
343 |       "version": "3.0.2",
344 |       "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz",
345 |       "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==",
346 |       "requires": {
347 |         "arrify": "^1.0.1",
348 |         "is-plain-obj": "^1.1.0"
349 |       }
350 |     },
351 |     "minipass": {
352 |       "version": "3.1.3",
353 |       "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz",
354 |       "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==",
355 |       "requires": {
356 |         "yallist": "^4.0.0"
357 |       }
358 |     },
359 |     "minizlib": {
360 |       "version": "2.1.2",
361 |       "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz",
362 |       "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==",
363 |       "requires": {
364 |         "minipass": "^3.0.0",
365 |         "yallist": "^4.0.0"
366 |       }
367 |     },
368 |     "mkdirp": {
369 |       "version": "1.0.4",
370 |       "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
371 |       "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="
372 |     },
373 |     "normalize-package-data": {
374 |       "version": "2.5.0",
375 |       "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
376 |       "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
377 |       "requires": {
378 |         "hosted-git-info": "^2.1.4",
379 |         "resolve": "^1.10.0",
380 |         "semver": "2 || 3 || 4 || 5",
381 |         "validate-npm-package-license": "^3.0.1"
382 |       }
383 |     },
384 |     "once": {
385 |       "version": "1.4.0",
386 |       "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
387 |       "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
388 |       "requires": {
389 |         "wrappy": "1"
390 |       }
391 |     },
392 |     "p-limit": {
393 |       "version": "1.3.0",
394 |       "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
395 |       "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
396 |       "requires": {
397 |         "p-try": "^1.0.0"
398 |       }
399 |     },
400 |     "p-locate": {
401 |       "version": "2.0.0",
402 |       "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
403 |       "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
404 |       "requires": {
405 |         "p-limit": "^1.1.0"
406 |       }
407 |     },
408 |     "p-try": {
409 |       "version": "1.0.0",
410 |       "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
411 |       "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M="
412 |     },
413 |     "parse-json": {
414 |       "version": "4.0.0",
415 |       "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
416 |       "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
417 |       "requires": {
418 |         "error-ex": "^1.3.1",
419 |         "json-parse-better-errors": "^1.0.1"
420 |       }
421 |     },
422 |     "path-exists": {
423 |       "version": "3.0.0",
424 |       "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
425 |       "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU="
426 |     },
427 |     "path-is-absolute": {
428 |       "version": "1.0.1",
429 |       "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
430 |       "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
431 |     },
432 |     "path-parse": {
433 |       "version": "1.0.6",
434 |       "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
435 |       "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw=="
436 |     },
437 |     "path-type": {
438 |       "version": "3.0.0",
439 |       "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
440 |       "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
441 |       "requires": {
442 |         "pify": "^3.0.0"
443 |       }
444 |     },
445 |     "pify": {
446 |       "version": "3.0.0",
447 |       "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
448 |       "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY="
449 |     },
450 |     "prompts": {
451 |       "version": "0.1.14",
452 |       "resolved": "https://registry.npmjs.org/prompts/-/prompts-0.1.14.tgz",
453 |       "integrity": "sha512-rxkyiE9YH6zAz/rZpywySLKkpaj0NMVyNw1qhsubdbjjSgcayjTShDreZGlFMcGSu5sab3bAKPfFk78PB90+8w==",
454 |       "requires": {
455 |         "kleur": "^2.0.1",
456 |         "sisteransi": "^0.1.1"
457 |       }
458 |     },
459 |     "quick-lru": {
460 |       "version": "1.1.0",
461 |       "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz",
462 |       "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g="
463 |     },
464 |     "read-pkg": {
465 |       "version": "3.0.0",
466 |       "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
467 |       "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=",
468 |       "requires": {
469 |         "load-json-file": "^4.0.0",
470 |         "normalize-package-data": "^2.3.2",
471 |         "path-type": "^3.0.0"
472 |       }
473 |     },
474 |     "read-pkg-up": {
475 |       "version": "3.0.0",
476 |       "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz",
477 |       "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=",
478 |       "requires": {
479 |         "find-up": "^2.0.0",
480 |         "read-pkg": "^3.0.0"
481 |       }
482 |     },
483 |     "redent": {
484 |       "version": "2.0.0",
485 |       "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz",
486 |       "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=",
487 |       "requires": {
488 |         "indent-string": "^3.0.0",
489 |         "strip-indent": "^2.0.0"
490 |       }
491 |     },
492 |     "resolve": {
493 |       "version": "1.12.0",
494 |       "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz",
495 |       "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==",
496 |       "requires": {
497 |         "path-parse": "^1.0.6"
498 |       }
499 |     },
500 |     "rimraf": {
501 |       "version": "2.7.1",
502 |       "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
503 |       "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
504 |       "requires": {
505 |         "glob": "^7.1.3"
506 |       }
507 |     },
508 |     "semver": {
509 |       "version": "5.7.1",
510 |       "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
511 |       "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
512 |     },
513 |     "shelljs.exec": {
514 |       "version": "1.1.8",
515 |       "resolved": "https://registry.npmjs.org/shelljs.exec/-/shelljs.exec-1.1.8.tgz",
516 |       "integrity": "sha512-vFILCw+lzUtiwBAHV8/Ex8JsFjelFMdhONIsgKNLgTzeRckp2AOYRQtHJE/9LhNvdMmE27AGtzWx0+DHpwIwSw=="
517 |     },
518 |     "signal-exit": {
519 |       "version": "3.0.2",
520 |       "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
521 |       "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
522 |     },
523 |     "sisteransi": {
524 |       "version": "0.1.1",
525 |       "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-0.1.1.tgz",
526 |       "integrity": "sha512-PmGOd02bM9YO5ifxpw36nrNMBTptEtfRl4qUYl9SndkolplkrZZOW7PGHjrZL53QvMVj9nQ+TKqUnRsw4tJa4g=="
527 |     },
528 |     "spdx-correct": {
529 |       "version": "3.1.0",
530 |       "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz",
531 |       "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==",
532 |       "requires": {
533 |         "spdx-expression-parse": "^3.0.0",
534 |         "spdx-license-ids": "^3.0.0"
535 |       }
536 |     },
537 |     "spdx-exceptions": {
538 |       "version": "2.2.0",
539 |       "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz",
540 |       "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA=="
541 |     },
542 |     "spdx-expression-parse": {
543 |       "version": "3.0.0",
544 |       "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz",
545 |       "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
546 |       "requires": {
547 |         "spdx-exceptions": "^2.1.0",
548 |         "spdx-license-ids": "^3.0.0"
549 |       }
550 |     },
551 |     "spdx-license-ids": {
552 |       "version": "3.0.5",
553 |       "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz",
554 |       "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q=="
555 |     },
556 |     "strip-bom": {
557 |       "version": "3.0.0",
558 |       "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
559 |       "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM="
560 |     },
561 |     "strip-indent": {
562 |       "version": "2.0.0",
563 |       "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz",
564 |       "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g="
565 |     },
566 |     "supports-color": {
567 |       "version": "5.5.0",
568 |       "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
569 |       "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
570 |       "requires": {
571 |         "has-flag": "^3.0.0"
572 |       }
573 |     },
574 |     "tar": {
575 |       "version": "6.0.5",
576 |       "resolved": "https://registry.npmjs.org/tar/-/tar-6.0.5.tgz",
577 |       "integrity": "sha512-0b4HOimQHj9nXNEAA7zWwMM91Zhhba3pspja6sQbgTpynOJf+bkjBnfybNYzbpLbnwXnbyB4LOREvlyXLkCHSg==",
578 |       "requires": {
579 |         "chownr": "^2.0.0",
580 |         "fs-minipass": "^2.0.0",
581 |         "minipass": "^3.0.0",
582 |         "minizlib": "^2.1.1",
583 |         "mkdirp": "^1.0.3",
584 |         "yallist": "^4.0.0"
585 |       }
586 |     },
587 |     "tmp": {
588 |       "version": "0.1.0",
589 |       "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz",
590 |       "integrity": "sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==",
591 |       "requires": {
592 |         "rimraf": "^2.6.3"
593 |       }
594 |     },
595 |     "trim-newlines": {
596 |       "version": "2.0.0",
597 |       "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz",
598 |       "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA="
599 |     },
600 |     "universalify": {
601 |       "version": "0.1.2",
602 |       "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
603 |       "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="
604 |     },
605 |     "validate-npm-package-license": {
606 |       "version": "3.0.4",
607 |       "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
608 |       "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
609 |       "requires": {
610 |         "spdx-correct": "^3.0.0",
611 |         "spdx-expression-parse": "^3.0.0"
612 |       }
613 |     },
614 |     "wrappy": {
615 |       "version": "1.0.2",
616 |       "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
617 |       "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
618 |     },
619 |     "yallist": {
620 |       "version": "4.0.0",
621 |       "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
622 |       "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
623 |     },
624 |     "yargs-parser": {
625 |       "version": "10.1.0",
626 |       "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz",
627 |       "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==",
628 |       "requires": {
629 |         "camelcase": "^4.1.0"
630 |       }
631 |     }
632 |   }
633 | }
634 | 


--------------------------------------------------------------------------------
/packages/create/package.json:
--------------------------------------------------------------------------------
 1 | {
 2 |   "name": "create-svelte-docs",
 3 |   "version": "0.3.2",
 4 |   "description": "CLI tool to init docs source directory",
 5 |   "main": "cli.js",
 6 |   "bin": {
 7 |     "create-svelte-docs": "./cli.js"
 8 |   },
 9 |   "scripts": {
10 |     "start": "./cli.js"
11 |   },
12 |   "keywords": [],
13 |   "repository": {
14 |     "type": "git",
15 |     "url": "git+https://github.com/AlexxNB/svelte-docs.git"
16 |   },
17 |   "author": "Alexey Schebelev",
18 |   "license": "MIT",
19 |   "bugs": {
20 |     "url": "https://github.com/AlexxNB/svelte-docs/issues"
21 |   },
22 |   "homepage": "https://alexxnb.github.io/svelte-docs",
23 |   "dependencies": {
24 |     "chalk": "^2.4.1",
25 |     "fetch-repo-dir": "^1.0.4",
26 |     "fs-extra": "^8.1.0",
27 |     "meow": "^5.0.0",
28 |     "prompts": "^0.1.12",
29 |     "shelljs.exec": "^1.1.8"
30 |   }
31 | }
32 | 


--------------------------------------------------------------------------------
/packages/publisher/package-lock.json:
--------------------------------------------------------------------------------
  1 | {
  2 |   "name": "@svelte-docs/publisher",
  3 |   "version": "0.2.3",
  4 |   "lockfileVersion": 1,
  5 |   "requires": true,
  6 |   "dependencies": {
  7 |     "ansi-styles": {
  8 |       "version": "3.2.1",
  9 |       "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
 10 |       "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
 11 |       "requires": {
 12 |         "color-convert": "^1.9.0"
 13 |       }
 14 |     },
 15 |     "chalk": {
 16 |       "version": "2.4.2",
 17 |       "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
 18 |       "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
 19 |       "requires": {
 20 |         "ansi-styles": "^3.2.1",
 21 |         "escape-string-regexp": "^1.0.5",
 22 |         "supports-color": "^5.3.0"
 23 |       }
 24 |     },
 25 |     "color-convert": {
 26 |       "version": "1.9.3",
 27 |       "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
 28 |       "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
 29 |       "requires": {
 30 |         "color-name": "1.1.3"
 31 |       }
 32 |     },
 33 |     "color-name": {
 34 |       "version": "1.1.3",
 35 |       "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
 36 |       "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
 37 |     },
 38 |     "escape-string-regexp": {
 39 |       "version": "1.0.5",
 40 |       "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
 41 |       "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
 42 |     },
 43 |     "gitinfo": {
 44 |       "version": "2.4.0",
 45 |       "resolved": "https://registry.npmjs.org/gitinfo/-/gitinfo-2.4.0.tgz",
 46 |       "integrity": "sha512-cQU3oInRu7+LaPwFNlppP0NmJa1SBdZtNCUoo+XT/nGRbmwlhssbjkN7gQmfQZAuMxphghx0ACfbIQmMBmPT2w==",
 47 |       "requires": {
 48 |         "ini": "^1.3.5",
 49 |         "ramda": "^0.26.1"
 50 |       }
 51 |     },
 52 |     "has-flag": {
 53 |       "version": "3.0.0",
 54 |       "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
 55 |       "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
 56 |     },
 57 |     "import-cwd": {
 58 |       "version": "3.0.0",
 59 |       "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-3.0.0.tgz",
 60 |       "integrity": "sha512-4pnzH16plW+hgvRECbDWpQl3cqtvSofHWh44met7ESfZ8UZOWWddm8hEyDTqREJ9RbYHY8gi8DqmaelApoOGMg==",
 61 |       "requires": {
 62 |         "import-from": "^3.0.0"
 63 |       }
 64 |     },
 65 |     "import-from": {
 66 |       "version": "3.0.0",
 67 |       "resolved": "https://registry.npmjs.org/import-from/-/import-from-3.0.0.tgz",
 68 |       "integrity": "sha512-CiuXOFFSzkU5x/CR0+z7T91Iht4CXgfCxVOFRhh2Zyhg5wOpWvvDLQUsWl+gcN+QscYBjez8hDCt85O7RLDttQ==",
 69 |       "requires": {
 70 |         "resolve-from": "^5.0.0"
 71 |       }
 72 |     },
 73 |     "ini": {
 74 |       "version": "1.3.5",
 75 |       "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
 76 |       "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
 77 |     },
 78 |     "kleur": {
 79 |       "version": "2.0.2",
 80 |       "resolved": "https://registry.npmjs.org/kleur/-/kleur-2.0.2.tgz",
 81 |       "integrity": "sha512-77XF9iTllATmG9lSlIv0qdQ2BQ/h9t0bJllHlbvsQ0zUWfU7Yi0S8L5JXzPZgkefIiajLmBJJ4BsMJmqcf7oxQ=="
 82 |     },
 83 |     "prompts": {
 84 |       "version": "0.1.14",
 85 |       "resolved": "https://registry.npmjs.org/prompts/-/prompts-0.1.14.tgz",
 86 |       "integrity": "sha512-rxkyiE9YH6zAz/rZpywySLKkpaj0NMVyNw1qhsubdbjjSgcayjTShDreZGlFMcGSu5sab3bAKPfFk78PB90+8w==",
 87 |       "requires": {
 88 |         "kleur": "^2.0.1",
 89 |         "sisteransi": "^0.1.1"
 90 |       }
 91 |     },
 92 |     "ramda": {
 93 |       "version": "0.26.1",
 94 |       "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.26.1.tgz",
 95 |       "integrity": "sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ=="
 96 |     },
 97 |     "resolve-from": {
 98 |       "version": "5.0.0",
 99 |       "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
100 |       "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="
101 |     },
102 |     "shelljs.exec": {
103 |       "version": "1.1.8",
104 |       "resolved": "https://registry.npmjs.org/shelljs.exec/-/shelljs.exec-1.1.8.tgz",
105 |       "integrity": "sha512-vFILCw+lzUtiwBAHV8/Ex8JsFjelFMdhONIsgKNLgTzeRckp2AOYRQtHJE/9LhNvdMmE27AGtzWx0+DHpwIwSw=="
106 |     },
107 |     "sisteransi": {
108 |       "version": "0.1.1",
109 |       "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-0.1.1.tgz",
110 |       "integrity": "sha512-PmGOd02bM9YO5ifxpw36nrNMBTptEtfRl4qUYl9SndkolplkrZZOW7PGHjrZL53QvMVj9nQ+TKqUnRsw4tJa4g=="
111 |     },
112 |     "supports-color": {
113 |       "version": "5.5.0",
114 |       "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
115 |       "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
116 |       "requires": {
117 |         "has-flag": "^3.0.0"
118 |       }
119 |     }
120 |   }
121 | }
122 | 


--------------------------------------------------------------------------------
/packages/publisher/package.json:
--------------------------------------------------------------------------------
 1 | {
 2 |   "name": "@svelte-docs/publisher",
 3 |   "version": "0.2.3",
 4 |   "description": "Helps to publish Svelte-docs on Github Pages and other resources",
 5 |   "main": "publisher.js",
 6 |   "scripts": {},
 7 |   "keywords": [],
 8 |   "repository": {
 9 |     "type": "git",
10 |     "url": "git+https://github.com/AlexxNB/svelte-docs.git"
11 |   },
12 |   "author": "Alexey Schebelev",
13 |   "license": "MIT",
14 |   "bugs": {
15 |     "url": "https://github.com/AlexxNB/svelte-docs/issues"
16 |   },
17 |   "homepage": "https://alexxnb.github.io/svelte-docs",
18 |   "dependencies": {
19 |     "chalk": "^2.4.2",
20 |     "gitinfo": "^2.4.0",
21 |     "import-cwd": "^3.0.0",
22 |     "prompts": "^0.1.12",
23 |     "shelljs.exec": "^1.1.8"
24 |   }
25 | }
26 | 


--------------------------------------------------------------------------------
/packages/publisher/publisher.js:
--------------------------------------------------------------------------------
 1 | const importCWD = require('import-cwd');
 2 | const exec = require('shelljs.exec');
 3 | const path = require('path');
 4 | const createGitinfo = require('gitinfo').default;
 5 | const chalk = require('chalk');
 6 | const prompts = require('prompts');
 7 | 
 8 | const config = importCWD('./svelte-docs.config.js');
 9 | 
10 | console.log(chalk.bold('Publishing the documentation...'));
11 | 
12 | 
13 | async function run() {
14 |     const git = createGitinfo();
15 | 
16 |     if(!git) Err('can\'t find .git folder in the parents directories');
17 | 
18 |     const GITURL = git.getGithubUrl();
19 |     const GITUSER = git.getUsername();
20 |     const GITNAME = git.getName();
21 |     const DIR = path.join(process.cwd(),config.pathes.build,config.basepath).replace(/\/$/,'');
22 | 
23 |     if(!GITURL.startsWith('https://github.com')) Err('Can publish in Github repository only, but `'+GITURL+'` was found.');
24 | 
25 |     if(`/${GITNAME}/` !== config.basepath) Err('you should set `basepath` option in `svelte-docs.config.js` as the name of your repository `'+ GITNAME +'`');
26 | 
27 |     const result = await prompts([
28 |         {
29 |             type: 'confirm',
30 |             name: 'confirm',
31 |             message: 'Publish documents in `gh-pages` branch of the `'+GITURL+'` repository?',
32 |             initial: true
33 |         }
34 |     ]);
35 | 
36 |     if(result.confirm){
37 |         console.log('Wait while deploy on GitHub Pages...');
38 |         publish_ghpages(DIR, function(err) {
39 |             if(err) Err('Fail on publishing:',err);
40 |             console.log(chalk.bold('Done!'));
41 |             console.log(chalk.green(`You can open it at https://${GITUSER.toLowerCase()}.github.com/${GITNAME}`));
42 |             process.exit(0);
43 |         });
44 |     }else{
45 |         Err('Publishing canceled');
46 |     }
47 | }
48 | 
49 | run();
50 | 
51 | 
52 | function Err(message){
53 |     console.log(chalk.red('[Error]', message));
54 |     process.exit(1);
55 | }
56 | 
57 | function publish_ghpages(dir,cb){
58 |     dir = path.relative(process.cwd(),dir);
59 |     const result = exec(`npx gh-pages -d ${dir}`);
60 |     cb( result.code === 0 ? null : result.stderr);
61 | }


--------------------------------------------------------------------------------
/packages/server/package-lock.json:
--------------------------------------------------------------------------------
  1 | {
  2 |   "name": "@svelte-docs/server",
  3 |   "version": "0.1.6",
  4 |   "lockfileVersion": 1,
  5 |   "requires": true,
  6 |   "dependencies": {
  7 |     "@babel/code-frame": {
  8 |       "version": "7.12.11",
  9 |       "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz",
 10 |       "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==",
 11 |       "requires": {
 12 |         "@babel/highlight": "^7.10.4"
 13 |       }
 14 |     },
 15 |     "@babel/helper-validator-identifier": {
 16 |       "version": "7.12.11",
 17 |       "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz",
 18 |       "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw=="
 19 |     },
 20 |     "@babel/highlight": {
 21 |       "version": "7.10.4",
 22 |       "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz",
 23 |       "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==",
 24 |       "requires": {
 25 |         "@babel/helper-validator-identifier": "^7.10.4",
 26 |         "chalk": "^2.0.0",
 27 |         "js-tokens": "^4.0.0"
 28 |       }
 29 |     },
 30 |     "@polka/url": {
 31 |       "version": "0.5.0",
 32 |       "resolved": "https://registry.npmjs.org/@polka/url/-/url-0.5.0.tgz",
 33 |       "integrity": "sha512-oZLYFEAzUKyi3SKnXvj32ZCEGH6RDnao7COuCVhDydMS9NrCSVXhM79VaKyP5+Zc33m0QXEd2DN3UkU7OsHcfw=="
 34 |     },
 35 |     "@types/minimist": {
 36 |       "version": "1.2.1",
 37 |       "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz",
 38 |       "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg=="
 39 |     },
 40 |     "@types/normalize-package-data": {
 41 |       "version": "2.4.0",
 42 |       "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
 43 |       "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA=="
 44 |     },
 45 |     "ansi-styles": {
 46 |       "version": "3.2.1",
 47 |       "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
 48 |       "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
 49 |       "requires": {
 50 |         "color-convert": "^1.9.0"
 51 |       }
 52 |     },
 53 |     "arrify": {
 54 |       "version": "1.0.1",
 55 |       "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
 56 |       "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0="
 57 |     },
 58 |     "camelcase": {
 59 |       "version": "5.3.1",
 60 |       "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
 61 |       "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="
 62 |     },
 63 |     "camelcase-keys": {
 64 |       "version": "6.2.2",
 65 |       "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz",
 66 |       "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==",
 67 |       "requires": {
 68 |         "camelcase": "^5.3.1",
 69 |         "map-obj": "^4.0.0",
 70 |         "quick-lru": "^4.0.1"
 71 |       }
 72 |     },
 73 |     "chalk": {
 74 |       "version": "2.4.2",
 75 |       "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
 76 |       "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
 77 |       "requires": {
 78 |         "ansi-styles": "^3.2.1",
 79 |         "escape-string-regexp": "^1.0.5",
 80 |         "supports-color": "^5.3.0"
 81 |       }
 82 |     },
 83 |     "color-convert": {
 84 |       "version": "1.9.3",
 85 |       "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
 86 |       "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
 87 |       "requires": {
 88 |         "color-name": "1.1.3"
 89 |       }
 90 |     },
 91 |     "color-name": {
 92 |       "version": "1.1.3",
 93 |       "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
 94 |       "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
 95 |     },
 96 |     "console-clear": {
 97 |       "version": "1.1.1",
 98 |       "resolved": "https://registry.npmjs.org/console-clear/-/console-clear-1.1.1.tgz",
 99 |       "integrity": "sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ=="
100 |     },
101 |     "decamelize": {
102 |       "version": "1.2.0",
103 |       "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
104 |       "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
105 |     },
106 |     "decamelize-keys": {
107 |       "version": "1.1.0",
108 |       "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz",
109 |       "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=",
110 |       "requires": {
111 |         "decamelize": "^1.1.0",
112 |         "map-obj": "^1.0.0"
113 |       },
114 |       "dependencies": {
115 |         "map-obj": {
116 |           "version": "1.0.1",
117 |           "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
118 |           "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0="
119 |         }
120 |       }
121 |     },
122 |     "error-ex": {
123 |       "version": "1.3.2",
124 |       "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
125 |       "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
126 |       "requires": {
127 |         "is-arrayish": "^0.2.1"
128 |       }
129 |     },
130 |     "escape-string-regexp": {
131 |       "version": "1.0.5",
132 |       "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
133 |       "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
134 |     },
135 |     "find-up": {
136 |       "version": "4.1.0",
137 |       "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
138 |       "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
139 |       "requires": {
140 |         "locate-path": "^5.0.0",
141 |         "path-exists": "^4.0.0"
142 |       }
143 |     },
144 |     "function-bind": {
145 |       "version": "1.1.1",
146 |       "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
147 |       "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
148 |     },
149 |     "hard-rejection": {
150 |       "version": "2.1.0",
151 |       "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz",
152 |       "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA=="
153 |     },
154 |     "has": {
155 |       "version": "1.0.3",
156 |       "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
157 |       "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
158 |       "requires": {
159 |         "function-bind": "^1.1.1"
160 |       }
161 |     },
162 |     "has-flag": {
163 |       "version": "3.0.0",
164 |       "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
165 |       "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
166 |     },
167 |     "hosted-git-info": {
168 |       "version": "3.0.7",
169 |       "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.7.tgz",
170 |       "integrity": "sha512-fWqc0IcuXs+BmE9orLDyVykAG9GJtGLGuZAAqgcckPgv5xad4AcXGIv8galtQvlwutxSlaMcdw7BUtq2EIvqCQ==",
171 |       "requires": {
172 |         "lru-cache": "^6.0.0"
173 |       }
174 |     },
175 |     "import-cwd": {
176 |       "version": "3.0.0",
177 |       "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-3.0.0.tgz",
178 |       "integrity": "sha512-4pnzH16plW+hgvRECbDWpQl3cqtvSofHWh44met7ESfZ8UZOWWddm8hEyDTqREJ9RbYHY8gi8DqmaelApoOGMg==",
179 |       "requires": {
180 |         "import-from": "^3.0.0"
181 |       }
182 |     },
183 |     "import-from": {
184 |       "version": "3.0.0",
185 |       "resolved": "https://registry.npmjs.org/import-from/-/import-from-3.0.0.tgz",
186 |       "integrity": "sha512-CiuXOFFSzkU5x/CR0+z7T91Iht4CXgfCxVOFRhh2Zyhg5wOpWvvDLQUsWl+gcN+QscYBjez8hDCt85O7RLDttQ==",
187 |       "requires": {
188 |         "resolve-from": "^5.0.0"
189 |       }
190 |     },
191 |     "indent-string": {
192 |       "version": "4.0.0",
193 |       "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",
194 |       "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg=="
195 |     },
196 |     "is-arrayish": {
197 |       "version": "0.2.1",
198 |       "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
199 |       "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0="
200 |     },
201 |     "is-core-module": {
202 |       "version": "2.2.0",
203 |       "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz",
204 |       "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==",
205 |       "requires": {
206 |         "has": "^1.0.3"
207 |       }
208 |     },
209 |     "is-plain-obj": {
210 |       "version": "1.1.0",
211 |       "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz",
212 |       "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4="
213 |     },
214 |     "js-tokens": {
215 |       "version": "4.0.0",
216 |       "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
217 |       "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
218 |     },
219 |     "json-parse-even-better-errors": {
220 |       "version": "2.3.1",
221 |       "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
222 |       "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="
223 |     },
224 |     "kind-of": {
225 |       "version": "6.0.3",
226 |       "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
227 |       "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw=="
228 |     },
229 |     "lines-and-columns": {
230 |       "version": "1.1.6",
231 |       "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
232 |       "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA="
233 |     },
234 |     "locate-path": {
235 |       "version": "5.0.0",
236 |       "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
237 |       "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
238 |       "requires": {
239 |         "p-locate": "^4.1.0"
240 |       }
241 |     },
242 |     "lru-cache": {
243 |       "version": "6.0.0",
244 |       "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
245 |       "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
246 |       "requires": {
247 |         "yallist": "^4.0.0"
248 |       }
249 |     },
250 |     "map-obj": {
251 |       "version": "4.1.0",
252 |       "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz",
253 |       "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g=="
254 |     },
255 |     "meow": {
256 |       "version": "8.0.0",
257 |       "resolved": "https://registry.npmjs.org/meow/-/meow-8.0.0.tgz",
258 |       "integrity": "sha512-nbsTRz2fwniJBFgUkcdISq8y/q9n9VbiHYbfwklFh5V4V2uAcxtKQkDc0yCLPM/kP0d+inZBewn3zJqewHE7kg==",
259 |       "requires": {
260 |         "@types/minimist": "^1.2.0",
261 |         "camelcase-keys": "^6.2.2",
262 |         "decamelize-keys": "^1.1.0",
263 |         "hard-rejection": "^2.1.0",
264 |         "minimist-options": "4.1.0",
265 |         "normalize-package-data": "^3.0.0",
266 |         "read-pkg-up": "^7.0.1",
267 |         "redent": "^3.0.0",
268 |         "trim-newlines": "^3.0.0",
269 |         "type-fest": "^0.18.0",
270 |         "yargs-parser": "^20.2.3"
271 |       }
272 |     },
273 |     "mime": {
274 |       "version": "2.4.7",
275 |       "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.7.tgz",
276 |       "integrity": "sha512-dhNd1uA2u397uQk3Nv5LM4lm93WYDUXFn3Fu291FJerns4jyTudqhIWe4W04YLy7Uk1tm1Ore04NpjRvQp/NPA=="
277 |     },
278 |     "min-indent": {
279 |       "version": "1.0.1",
280 |       "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz",
281 |       "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg=="
282 |     },
283 |     "minimist-options": {
284 |       "version": "4.1.0",
285 |       "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz",
286 |       "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==",
287 |       "requires": {
288 |         "arrify": "^1.0.1",
289 |         "is-plain-obj": "^1.1.0",
290 |         "kind-of": "^6.0.3"
291 |       }
292 |     },
293 |     "normalize-package-data": {
294 |       "version": "3.0.0",
295 |       "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.0.tgz",
296 |       "integrity": "sha512-6lUjEI0d3v6kFrtgA/lOx4zHCWULXsFNIjHolnZCKCTLA6m/G625cdn3O7eNmT0iD3jfo6HZ9cdImGZwf21prw==",
297 |       "requires": {
298 |         "hosted-git-info": "^3.0.6",
299 |         "resolve": "^1.17.0",
300 |         "semver": "^7.3.2",
301 |         "validate-npm-package-license": "^3.0.1"
302 |       }
303 |     },
304 |     "p-limit": {
305 |       "version": "2.3.0",
306 |       "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
307 |       "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
308 |       "requires": {
309 |         "p-try": "^2.0.0"
310 |       }
311 |     },
312 |     "p-locate": {
313 |       "version": "4.1.0",
314 |       "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
315 |       "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
316 |       "requires": {
317 |         "p-limit": "^2.2.0"
318 |       }
319 |     },
320 |     "p-try": {
321 |       "version": "2.2.0",
322 |       "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
323 |       "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="
324 |     },
325 |     "parse-json": {
326 |       "version": "5.1.0",
327 |       "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz",
328 |       "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==",
329 |       "requires": {
330 |         "@babel/code-frame": "^7.0.0",
331 |         "error-ex": "^1.3.1",
332 |         "json-parse-even-better-errors": "^2.3.0",
333 |         "lines-and-columns": "^1.1.6"
334 |       }
335 |     },
336 |     "path-exists": {
337 |       "version": "4.0.0",
338 |       "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
339 |       "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="
340 |     },
341 |     "path-parse": {
342 |       "version": "1.0.6",
343 |       "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
344 |       "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw=="
345 |     },
346 |     "quick-lru": {
347 |       "version": "4.0.1",
348 |       "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz",
349 |       "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g=="
350 |     },
351 |     "read-pkg": {
352 |       "version": "5.2.0",
353 |       "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz",
354 |       "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==",
355 |       "requires": {
356 |         "@types/normalize-package-data": "^2.4.0",
357 |         "normalize-package-data": "^2.5.0",
358 |         "parse-json": "^5.0.0",
359 |         "type-fest": "^0.6.0"
360 |       },
361 |       "dependencies": {
362 |         "hosted-git-info": {
363 |           "version": "2.8.8",
364 |           "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz",
365 |           "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg=="
366 |         },
367 |         "normalize-package-data": {
368 |           "version": "2.5.0",
369 |           "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
370 |           "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
371 |           "requires": {
372 |             "hosted-git-info": "^2.1.4",
373 |             "resolve": "^1.10.0",
374 |             "semver": "2 || 3 || 4 || 5",
375 |             "validate-npm-package-license": "^3.0.1"
376 |           }
377 |         },
378 |         "semver": {
379 |           "version": "5.7.1",
380 |           "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
381 |           "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
382 |         },
383 |         "type-fest": {
384 |           "version": "0.6.0",
385 |           "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz",
386 |           "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg=="
387 |         }
388 |       }
389 |     },
390 |     "read-pkg-up": {
391 |       "version": "7.0.1",
392 |       "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz",
393 |       "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==",
394 |       "requires": {
395 |         "find-up": "^4.1.0",
396 |         "read-pkg": "^5.2.0",
397 |         "type-fest": "^0.8.1"
398 |       },
399 |       "dependencies": {
400 |         "type-fest": {
401 |           "version": "0.8.1",
402 |           "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
403 |           "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA=="
404 |         }
405 |       }
406 |     },
407 |     "redent": {
408 |       "version": "3.0.0",
409 |       "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz",
410 |       "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==",
411 |       "requires": {
412 |         "indent-string": "^4.0.0",
413 |         "strip-indent": "^3.0.0"
414 |       }
415 |     },
416 |     "resolve": {
417 |       "version": "1.19.0",
418 |       "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
419 |       "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
420 |       "requires": {
421 |         "is-core-module": "^2.1.0",
422 |         "path-parse": "^1.0.6"
423 |       }
424 |     },
425 |     "resolve-from": {
426 |       "version": "5.0.0",
427 |       "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
428 |       "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="
429 |     },
430 |     "semver": {
431 |       "version": "7.3.4",
432 |       "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
433 |       "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
434 |       "requires": {
435 |         "lru-cache": "^6.0.0"
436 |       }
437 |     },
438 |     "sirv": {
439 |       "version": "0.4.6",
440 |       "resolved": "https://registry.npmjs.org/sirv/-/sirv-0.4.6.tgz",
441 |       "integrity": "sha512-rYpOXlNbpHiY4nVXxuDf4mXPvKz1reZGap/LkWp9TvcZ84qD/nPBjjH/6GZsgIjVMbOslnY8YYULAyP8jMn1GQ==",
442 |       "requires": {
443 |         "@polka/url": "^0.5.0",
444 |         "mime": "^2.3.1"
445 |       }
446 |     },
447 |     "spdx-correct": {
448 |       "version": "3.1.1",
449 |       "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
450 |       "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==",
451 |       "requires": {
452 |         "spdx-expression-parse": "^3.0.0",
453 |         "spdx-license-ids": "^3.0.0"
454 |       }
455 |     },
456 |     "spdx-exceptions": {
457 |       "version": "2.3.0",
458 |       "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz",
459 |       "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A=="
460 |     },
461 |     "spdx-expression-parse": {
462 |       "version": "3.0.1",
463 |       "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
464 |       "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
465 |       "requires": {
466 |         "spdx-exceptions": "^2.1.0",
467 |         "spdx-license-ids": "^3.0.0"
468 |       }
469 |     },
470 |     "spdx-license-ids": {
471 |       "version": "3.0.7",
472 |       "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz",
473 |       "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ=="
474 |     },
475 |     "strip-indent": {
476 |       "version": "3.0.0",
477 |       "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz",
478 |       "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==",
479 |       "requires": {
480 |         "min-indent": "^1.0.0"
481 |       }
482 |     },
483 |     "supports-color": {
484 |       "version": "5.5.0",
485 |       "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
486 |       "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
487 |       "requires": {
488 |         "has-flag": "^3.0.0"
489 |       }
490 |     },
491 |     "trim-newlines": {
492 |       "version": "3.0.0",
493 |       "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz",
494 |       "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA=="
495 |     },
496 |     "type-fest": {
497 |       "version": "0.18.1",
498 |       "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz",
499 |       "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw=="
500 |     },
501 |     "validate-npm-package-license": {
502 |       "version": "3.0.4",
503 |       "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
504 |       "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
505 |       "requires": {
506 |         "spdx-correct": "^3.0.0",
507 |         "spdx-expression-parse": "^3.0.0"
508 |       }
509 |     },
510 |     "yallist": {
511 |       "version": "4.0.0",
512 |       "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
513 |       "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
514 |     },
515 |     "yargs-parser": {
516 |       "version": "20.2.4",
517 |       "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz",
518 |       "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA=="
519 |     }
520 |   }
521 | }
522 | 


--------------------------------------------------------------------------------
/packages/server/package.json:
--------------------------------------------------------------------------------
 1 | {
 2 |   "name": "@svelte-docs/server",
 3 |   "version": "0.1.6",
 4 |   "description": "HTTP server to run Svelte-docs in development or production modes",
 5 |   "main": "server.js",
 6 |   "scripts": {},
 7 |   "keywords": [],
 8 |   "repository": {
 9 |     "type": "git",
10 |     "url": "git+https://github.com/AlexxNB/svelte-docs.git"
11 |   },
12 |   "author": "Alexey Schebelev",
13 |   "license": "MIT",
14 |   "bugs": {
15 |     "url": "https://github.com/AlexxNB/svelte-docs/issues"
16 |   },
17 |   "homepage": "https://alexxnb.github.io/svelte-docs",
18 |   "dependencies": {
19 |     "chalk": "^2.4.2",
20 |     "console-clear": "^1.1.1",
21 |     "import-cwd": "^3.0.0",
22 |     "meow": "^8.0.0",
23 |     "sirv": "^0.4.6"
24 |   }
25 | }
26 | 


--------------------------------------------------------------------------------
/packages/server/server.js:
--------------------------------------------------------------------------------
 1 | #!/usr/bin/env node
 2 | 
 3 | const path = require('path');
 4 | const meow = require('meow');
 5 | const sirv = require('sirv');
 6 | const { createServer } = require('http');
 7 | const clear = require('console-clear');
 8 | const chalk = require('chalk');
 9 | const importCWD = require('import-cwd');
10 | 
11 | const config = importCWD('./svelte-docs.config.js');
12 | 
13 | const cli = meow(`
14 |     Usage
15 |       $ node sirv.js [options]
16 |  
17 |     Options
18 |       --dev, -d  Development mode
19 |       --cors, -c  Enable "CORS" headers to allow any origin requestor
20 |       --single, -s  SPA Mode
21 |  
22 |     Examples
23 |       $ node sirv.js --dev --basepath subdir
24 | `, {
25 |     flags: {
26 |         dev: {
27 |             type: 'boolean',
28 |             alias: 'd'
29 |         },
30 |         cors: {
31 |             type: 'boolean',
32 |             alias: 'c'
33 |         },
34 |         single: {
35 |             type: 'boolean',
36 |             alias: 's'
37 |         }
38 |     }
39 | });
40 | 
41 | const CWD = process.cwd();
42 | 
43 | const DEV = cli.flags.dev;
44 | const CORS = cli.flags.cors;
45 | const SINGLE = cli.flags.single;
46 | 
47 | const DIR = DEV ? path.join(CWD,config.pathes.dev) : path.join(CWD,config.pathes.build);
48 | 
49 | let port = process.env.PORT || 5000;
50 | let hostname = process.env.HOST || '0.0.0.0';
51 | 
52 | const mw = sirv(DIR, {
53 |     dev: DEV,
54 |     maxAge: 31536000, // 1Y
55 |     immutable: true,
56 |     setHeaders: CORS ? (res) => {
57 |         res.setHeader('Access-Control-Allow-Origin', '*');
58 |         res.setHeader('Access-Control-Allow-Headers', 'Origin, Content-Type, Accept, Range');
59 |     } : undefined,
60 |     onNoMatch: SINGLE ? (req, res) => (req.path=config.basepath,mw(req, res, () => (res.statusCode=404,res.end()))) : undefined
61 | });
62 | 
63 | createServer(mw).listen(port, hostname, err => {
64 |     if (err) throw err;
65 | 
66 |     const srv = DEV ? chalk.yellow('DEVELOPMENT server started...') : chalk.green('Server started...');
67 | 
68 |     clear(true);
69 |     console.log(`
70 |     ${chalk.bold('Svelte-Docs:')} ${srv}
71 |     Please open: ${chalk.blue('http://'+(hostname === '0.0.0.0' ? 'localhost' : hostname)+':'+port+config.basepath)}
72 |     `);
73 | });
74 | 


--------------------------------------------------------------------------------
/packages/themes/default/assets/burger.svg:
--------------------------------------------------------------------------------
1 | 


--------------------------------------------------------------------------------
/packages/themes/default/assets/fonts/fira-mono-400.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexxNB/svelte-docs/f360de962c015dc3af471b7944e7677e9adcbbd4/packages/themes/default/assets/fonts/fira-mono-400.woff2


--------------------------------------------------------------------------------
/packages/themes/default/assets/fonts/overpass-300.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexxNB/svelte-docs/f360de962c015dc3af471b7944e7677e9adcbbd4/packages/themes/default/assets/fonts/overpass-300.woff2


--------------------------------------------------------------------------------
/packages/themes/default/assets/fonts/overpass-400.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexxNB/svelte-docs/f360de962c015dc3af471b7944e7677e9adcbbd4/packages/themes/default/assets/fonts/overpass-400.woff2


--------------------------------------------------------------------------------
/packages/themes/default/assets/fonts/overpass-600.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexxNB/svelte-docs/f360de962c015dc3af471b7944e7677e9adcbbd4/packages/themes/default/assets/fonts/overpass-600.woff2


--------------------------------------------------------------------------------
/packages/themes/default/components/Document.svelte:
--------------------------------------------------------------------------------
 1 | 
 8 | 
 9 | 
10 | 11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /packages/themes/default/components/Example.svelte: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 | 7 |
8 |
-------------------------------------------------------------------------------- /packages/themes/default/components/Layout.svelte: -------------------------------------------------------------------------------- 1 | 68 | 69 | 70 | 71 | 72 | {title} 73 | 74 | 75 | 76 |
77 | 78 |
79 | 80 | {#if layout === 'no_sidebar'} 81 | 82 | 83 |
84 | 85 |
86 | 87 | {/if} 88 | 89 | {#if layout === 'default'} 90 | 91 | {#if $mobile} 92 | 93 | 96 | {/if} 97 | 98 | {#if !$mobile || show_sidebar} 99 | 102 | {/if} 103 | 104 | 105 |
106 | 107 |
108 | 109 | {/if} 110 | -------------------------------------------------------------------------------- /packages/themes/default/components/Properties.svelte: -------------------------------------------------------------------------------- 1 | 33 | 34 |
35 | {#each data as prop} 36 |
{prop.name}
37 |
{@html getTypes(prop.attr.types)}
38 |
{prop.attr.default ? prop.attr.default : ''}
39 |
{@html prop.description ? prop.description : ''}
40 | {/each} 41 |
-------------------------------------------------------------------------------- /packages/themes/default/components/Sections.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /packages/themes/default/components/Topbar.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 |
7 | 8 |
9 |
10 | 11 |
-------------------------------------------------------------------------------- /packages/themes/default/info.md: -------------------------------------------------------------------------------- 1 | Theme based on [offical Svelte documentation site](https://svelte.dev/docs). 2 | 3 | *by Alexey Schebelev* 4 | 5 | ## Theme variables 6 | 7 | |Variable|Default|Comment| 8 | |--------|-------|-----------| 9 | | `--font` | "Overpass", sans-serif | | 10 | | `--font-mono` | "Fira Mono", monospace | | 11 | | `--primary` | #ff3e00 | | 12 | | `--secondary` | #676778 | | 13 | | `--dark` | #34343d | | 14 | | `--light` | #c0c0d8 | | 15 | | `--white` | #ffffff | | 16 | | `--code` | #f6fafd | | 17 | | `--text` | --dark | | 18 | | `--text-sidebar` | #d4d4d4 | | 19 | | `--text-sidebar-links` | --white | | 20 | | `--topbar-height` | 50px | | 21 | | `--sidebar-width` | 300px | | 22 | | `--example-border` | --light | Border color of the example block | 23 | | `--props-border` | --light | Colors of the properties block | 24 | | `--props-devider` | --code | | 25 | | `--props-types-bg` | --code | | 26 | | `--props-types-border` | --light | | 27 | | `--props-types-text` | --hl-keyword | | 28 | | `--props-oneof-text` | --hl-string | | 29 | | `--props-default-text` | --light | | 30 | | `--hl-background` | --code | Code highlighting colors | 31 | | `--hl-text` | #505050 | | 32 | | `--hl-comment` | #8da4bc | | 33 | | `--hl-keyword` | #3c87b9 | | 34 | | `--hl-string` | #a18851 | | 35 | | `--hl-number` | #76a562 | | 36 | | `--hl-name` | #c36031 | | 37 | | `--hl-attr` | #a18851 | | 38 | | `--hl-builtin` | #505050 | | 39 | 40 | 41 | ## Layouts 42 | 43 | |Name |Description| 44 | |--------|-----------| 45 | | `default` | Layout with topbar, sidebar on the left and content| 46 | | `no_sidebar` | Layout without sidebar | -------------------------------------------------------------------------------- /packages/themes/default/style.css: -------------------------------------------------------------------------------- 1 | @import "styles/layout.css"; 2 | @import "styles/typography.css"; 3 | @import "styles/fonts.css"; 4 | @import "styles/highlight.css"; 5 | 6 | :root{ 7 | --font: "Overpass", sans-serif; 8 | --font-mono: "Fira Mono", monospace; 9 | 10 | --primary: #ff3e00; 11 | --secondary: #676778; 12 | --dark: #34343d; 13 | --light: #c0c0d8; 14 | 15 | --white: #ffffff; 16 | --code: #f6fafd; 17 | 18 | --text: var(--dark); 19 | --text-sidebar:#d4d4d4; 20 | --text-sidebar-links:var(--white); 21 | 22 | --topbar-height: 50px; 23 | --sidebar-width: 300px; 24 | 25 | --example-border: var(--light); 26 | 27 | --props-border: var(--light); 28 | --props-devider: var(--code); 29 | --props-types-bg: var(--code); 30 | --props-types-border: var(--light); 31 | --props-types-text: var(--hl-keyword); 32 | --props-oneof-text: var(--hl-string); 33 | --props-default-text: var(--light); 34 | 35 | --hl-background: var(--code); 36 | --hl-text: #505050; 37 | --hl-comment: #8da4bc; 38 | --hl-keyword: #3c87b9; 39 | --hl-string: #a18851; 40 | --hl-number: #76a562; 41 | --hl-name: #c36031; 42 | --hl-attr: #a18851; 43 | --hl-builtin: #505050; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /packages/themes/default/styles/fonts.css: -------------------------------------------------------------------------------- 1 | /* overpass-300normal */ 2 | @font-face { 3 | font-family: 'Overpass'; 4 | font-style: normal; 5 | font-weight: 300; 6 | font-display: fallback; 7 | src: 8 | local('Overpass Light '), 9 | local('Overpass-Light'), 10 | url('assets/fonts/overpass-300.woff2') format('woff2'); 11 | } 12 | 13 | /* overpass-400normal */ 14 | @font-face { 15 | font-family: 'Overpass'; 16 | font-style: normal; 17 | font-weight: 400; 18 | font-display: fallback; 19 | src: 20 | local('Overpass Light '), 21 | local('Overpass-Light'), 22 | url('assets/fonts/overpass-400.woff2') format('woff2'); 23 | } 24 | 25 | /* overpass-600normal */ 26 | @font-face { 27 | font-family: 'Overpass'; 28 | font-style: normal; 29 | font-weight: 600; 30 | font-display: fallback; 31 | src: 32 | local('Overpass Bold '), 33 | local('Overpass-Bold'), 34 | url('assets/fonts/overpass-600.woff2') format('woff2'); 35 | } 36 | 37 | /* fira-mono-400normal */ 38 | @font-face { 39 | font-family: 'Fira Mono'; 40 | font-style: normal; 41 | font-weight: 400; 42 | font-display: fallback; 43 | src: 44 | local('Fira Mono'), 45 | local('Fira-Mono'), 46 | url('assets/fonts/fira-mono-400.woff2') format('woff2'); 47 | } -------------------------------------------------------------------------------- /packages/themes/default/styles/highlight.css: -------------------------------------------------------------------------------- 1 | /* 2 | * You can just import theme from the higlight.js package: 3 | * Example: @import 'highlight.js/styles/solarized-light.css' 4 | */ 5 | 6 | .hljs { 7 | display: block; 8 | overflow-x: auto; 9 | padding: 0.5em; 10 | background: var(--hl-background); 11 | color: var(--hl-text); 12 | font-family: var(--font-mono); 13 | line-height: 1; 14 | } 15 | 16 | .hljs-comment, 17 | .hljs-quote { 18 | color: var(--hl-comment); 19 | } 20 | 21 | .hljs-keyword, 22 | .hljs-selector-tag, 23 | .hljs-addition { 24 | color: var(--hl-keyword); 25 | } 26 | 27 | .hljs-number{ 28 | color: var(--hl-number); 29 | } 30 | 31 | .hljs-string, 32 | .hljs-meta .hljs-meta-string, 33 | .hljs-literal, 34 | .hljs-doctag, 35 | .hljs-regexp { 36 | color: var(--hl-string); 37 | } 38 | 39 | .hljs-title, 40 | .hljs-section, 41 | .hljs-name, 42 | .hljs-selector-id, 43 | .hljs-selector-class { 44 | color: var(--hl-name); 45 | } 46 | 47 | .hljs-attribute, 48 | .hljs-attr, 49 | .hljs-variable, 50 | .hljs-template-variable, 51 | .hljs-class .hljs-title, 52 | .hljs-type { 53 | color: var(--hl-attr); 54 | } 55 | 56 | .hljs-symbol, 57 | .hljs-bullet, 58 | .hljs-subst, 59 | .hljs-meta, 60 | .hljs-meta .hljs-keyword, 61 | .hljs-selector-attr, 62 | .hljs-selector-pseudo, 63 | .hljs-link { 64 | color: var(--hl-string); 65 | } 66 | 67 | .hljs-built_in{ 68 | color: var(--hl-builtin); 69 | } 70 | 71 | .hljs-deletion { 72 | color: #dc322f; 73 | } 74 | 75 | .hljs-formula { 76 | background: #eee8d5; 77 | } 78 | 79 | .hljs-emphasis { 80 | font-style: italic; 81 | } 82 | 83 | .hljs-strong { 84 | font-weight: bold; 85 | } -------------------------------------------------------------------------------- /packages/themes/default/styles/layout.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | position: relative; 3 | width: 100%; 4 | height: 100%; 5 | } 6 | 7 | body { 8 | margin: 0; 9 | padding: 0px; 10 | box-sizing: border-box; 11 | } 12 | 13 | 14 | /* Top bar */ 15 | header{ 16 | position:fixed; 17 | top:0px; 18 | left:0px; 19 | width: 100vw; 20 | height:var(--topbar-height); 21 | line-height:var(--topbar-height); 22 | background-color:var(--white); 23 | box-shadow: 0 0 15px -5px var(--dark); 24 | z-index: 1001; 25 | 26 | display: flex; 27 | flex-wrap: wrap; 28 | } 29 | 30 | header section{ 31 | margin:0px 1em; 32 | flex-grow: 1; 33 | text-align: center; 34 | } 35 | 36 | header section:first-child{ 37 | text-align: left; 38 | } 39 | 40 | header section:last-child{ 41 | text-align: right; 42 | } 43 | 44 | header section ul{ 45 | margin: 0px; 46 | padding: 0px; 47 | } 48 | 49 | header section li{ 50 | display: inline-block; 51 | margin:0 .5em; 52 | } 53 | 54 | header section li:last-child{ 55 | margin-right: 0; 56 | } 57 | 58 | header section li a{ 59 | color: var(--text); 60 | } 61 | 62 | header section h1{ 63 | font-size: 2rem; 64 | font-weight: 400; 65 | margin:0; 66 | } 67 | 68 | header section img{ 69 | max-height: var(--topbar-height); 70 | width: auto; 71 | } 72 | 73 | header section h1 a{ 74 | color: var(--primary); 75 | } 76 | header section h1 a:hover{ 77 | text-decoration: none; 78 | } 79 | 80 | 81 | /* Sidebar navigation */ 82 | nav{ 83 | position:fixed; 84 | top:var(--topbar-height); 85 | left:0px; 86 | width:var(--sidebar-width); 87 | height:100vh; 88 | background-color:var(--secondary); 89 | box-shadow: 0 0 15px -5px var(--dark); 90 | overflow-x: hidden; 91 | z-index:1000; 92 | color: var(--text-sidebar); 93 | } 94 | 95 | nav a{ 96 | color: var(--text-sidebar-links); 97 | } 98 | 99 | nav ul{ 100 | display: block; 101 | padding:0 .5em 0 2em; 102 | text-transform: uppercase; 103 | font-weight: 600; 104 | } 105 | 106 | nav ul ul{ 107 | display: block; 108 | padding:0 0 .3em 1em; 109 | text-transform: initial; 110 | font-weight: 400; 111 | } 112 | 113 | nav ul li{ 114 | display: block; 115 | padding: 0; 116 | margin: 0 0 .5em 0; 117 | } 118 | 119 | nav ul li li{ 120 | margin: 0; 121 | } 122 | 123 | nav a:hover, nav a.active{ 124 | text-decoration: underline; 125 | } 126 | nav a.active::after { 127 | float:right; 128 | content: url('data:image/svg+xml;utf8,'); 129 | } 130 | 131 | .showNav{ 132 | position: fixed; 133 | bottom: 10px; 134 | left: 10px; 135 | width:37px; 136 | height:37px; 137 | z-index: 10101; 138 | border: 1px solid var(--dark); 139 | background-color: var(--white); 140 | cursor:pointer; 141 | } 142 | 143 | 144 | /* Content */ 145 | main{ 146 | padding-top:var(--topbar-height); 147 | margin-left:var(--sidebar-width); 148 | background-color:var(--bg-light); 149 | min-height: calc(100vh - var(--topbar-height)); 150 | max-width:70em; 151 | } 152 | 153 | main.fullscreen{ 154 | margin:0 auto; 155 | } 156 | 157 | article{ 158 | padding:0 4em; 159 | } 160 | 161 | article img { 162 | display: block; 163 | max-width: 100%; 164 | height: auto; 165 | margin: 0 auto; 166 | } 167 | 168 | main.mobile{ 169 | margin-left:0px; 170 | max-width: 100%; 171 | } 172 | 173 | main.mobile article{ 174 | padding:0 1em; 175 | } 176 | 177 | /* Example block */ 178 | .example{ 179 | border:1px solid var(--example-border); 180 | margin:25px; 181 | } 182 | 183 | /* .example > .result{} */ 184 | .example > .code{ 185 | border-top:1px solid var(--example-border); 186 | } 187 | 188 | 189 | /* Properties block */ 190 | 191 | .properties{ 192 | position: relative; 193 | display: block; 194 | border:1px solid var(--props-border); 195 | margin:25px; 196 | padding: .3em; 197 | } 198 | 199 | .properties dd, .properties dt{ 200 | display: inline-block; 201 | margin:0px; 202 | } 203 | 204 | /*name*/ 205 | .properties dt{ 206 | width: 10em; 207 | font-weight: bold; 208 | padding-top:.5em; 209 | } 210 | 211 | .properties dt.required{ 212 | text-decoration: underline; 213 | } 214 | 215 | /*type*/ 216 | .properties dt + dd{ 217 | color: var(--props-border); 218 | padding-top:.5em; 219 | } 220 | 221 | .properties dfn{ 222 | display: inline-block; 223 | padding: 0 .3em; 224 | color: var(--props-types-text); 225 | background: var(--props-types-bg); 226 | border: 1px solid var(--props-types-border); 227 | border-radius: .3em; 228 | margin-right: .3em; 229 | font-style: normal; 230 | font-family: var(--font-mono); 231 | font-size:.8em; 232 | letter-spacing: -.05em; 233 | } 234 | 235 | .properties dfn i{ 236 | color: var(--props-oneof-text); 237 | } 238 | 239 | 240 | /*default*/ 241 | .properties dt + dd + dd{ 242 | width:100%; 243 | color: var(--props-default-text); 244 | padding-top:.3em; 245 | } 246 | 247 | /*description*/ 248 | .properties dt + dd + dd + dd{ 249 | display: block; 250 | border-bottom: 1px solid var(--props-devider); 251 | padding:0 .3em .3em 10em; 252 | margin-top:-1em; 253 | } 254 | 255 | .properties dd:last-of-type{ 256 | border-bottom: none; 257 | } -------------------------------------------------------------------------------- /packages/themes/default/styles/typography.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: var(--text); 3 | font-family: "Overpass", sans-serif; 4 | font-weight: 300; 5 | line-height: 1.6; 6 | } 7 | 8 | strong{ 9 | font-weight: 600; 10 | } 11 | 12 | a { 13 | color: rgb(0,100,200); 14 | text-decoration: none; 15 | } 16 | 17 | a:hover { 18 | text-decoration: underline; 19 | } 20 | 21 | label { 22 | display: block; 23 | } 24 | 25 | input, button, select, textarea { 26 | font-family: inherit; 27 | font-size: inherit; 28 | padding: 0.4em; 29 | margin: 0 0 0.5em 0; 30 | box-sizing: border-box; 31 | border: 1px solid #ccc; 32 | border-radius: 2px; 33 | } 34 | 35 | input:disabled { 36 | color: #ccc; 37 | } 38 | 39 | input[type="range"] { 40 | height: 0; 41 | } 42 | 43 | button { 44 | color: #333; 45 | background-color: #f4f4f4; 46 | outline: none; 47 | } 48 | 49 | button:active { 50 | background-color: #ddd; 51 | } 52 | 53 | button:focus { 54 | border-color: #666; 55 | } 56 | 57 | code{ 58 | font-family: var(--font-mono); 59 | font-size: .8rem; 60 | background: var(--code); 61 | border: 1px solid var(--light); 62 | color: var(--secondary); 63 | padding: 0 .2em; 64 | border-radius: .2em; 65 | white-space: nowrap; 66 | } 67 | 68 | 69 | pre { 70 | background-color: var(--code); 71 | font-size: 1em; 72 | padding: 1rem; 73 | overflow-x: auto; 74 | border-radius: .3em; 75 | margin:25px; 76 | } 77 | 78 | pre code { 79 | background: none; 80 | border: none; 81 | padding: 0; 82 | white-space: pre; 83 | line-height:.8rem; 84 | } 85 | 86 | blockquote { 87 | background-color: var(--code); 88 | padding: 1rem 2rem; 89 | border-left: 3px solid var(--light); 90 | } 91 | -------------------------------------------------------------------------------- /packages/themes/light/components/Example.svelte: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 | 7 |
8 |
-------------------------------------------------------------------------------- /packages/themes/light/components/Layout.svelte: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | 25 | {title} 26 | 27 | 28 | 29 | 30 |
31 |
32 | 33 |
34 |
35 | 36 | {#if !nosidebar} 37 | {#if !mobile || (mobile&&show_sidebar)} 38 | 41 | {/if} 42 | {/if} 43 | 44 |
45 | {#if mobile && !nosidebar} 46 | 51 | {/if} 52 | 53 |
54 |
55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /packages/themes/light/components/Properties.svelte: -------------------------------------------------------------------------------- 1 | 33 | 34 | 35 | {#each data as prop} 36 | 37 | 41 | 44 | 47 | 48 | {/each} 49 |
38 |
{prop.name}
39 |
{prop.attr.default ? prop.attr.default : ''}
40 |
42 |
{@html getTypes(prop.attr.types)}
43 |
45 |
{@html prop.description ? prop.description : ''}
46 |
-------------------------------------------------------------------------------- /packages/themes/light/info.md: -------------------------------------------------------------------------------- 1 | Light and clean theme 2 | *by Alexey Schebelev* 3 | 4 | ## Theme variables 5 | 6 | |Variable|Default|Comment| 7 | |--------|-------|-----------| 8 | | `--font` | -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol | | 9 | | `--font-mono` | SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace | | 10 | | `--primary` | #5BC9C3 | | 11 | | `--secondary` | #B1B1B3 | | 12 | | `--dark` | #1A202C | | 13 | | `--light` | #E2E8F0 | | 14 | | `--white` | #ffffff | | 15 | | `--code` | #011627 | | 16 | | `--tag` | #FEEBC8 | | 17 | | `--tag-border` | #fdd58a | | 18 | | `--tag-text` | #DD6B20 | | 19 | | `--text` | --dark | | 20 | | `--topbar-height` | 50px | | 21 | | `--sidebar-width` | 250px | | 22 | | `--quote` | --tag | | 23 | | `--quote-side` | --tag-text | | 24 | | `--example-border` | --light | Border color of the example block | 25 | | `--props-border` | --light | Colors of the properties block | 26 | | `--props-devider` | --code | | 27 | | `--props-types-bg` | --tag | | 28 | | `--props-types-border` | --tag-border | | 29 | | `--props-types-text` | --tag-text | | 30 | | `--props-oneof-text` | --hl-builtin | | 31 | | `--props-default-text` | --light | | 32 | | `--hl-background` | --code | Code highlighting colors | 33 | | `--hl-text` | #D6DEEB | | 34 | | `--hl-comment` | #637777 | | 35 | | `--hl-keyword` | #7FDBCA | | 36 | | `--hl-string` | #ADDB67 | | 37 | | `--hl-number` | #F78C6C | | 38 | | `--hl-name` | #FFCB8B | | 39 | | `--hl-attr` | #ADDB67 | | 40 | | `--hl-builtin` | #8B6CAF | | 41 | 42 | 43 | ## Layouts 44 | 45 | |Name |Description| 46 | |--------|-----------| 47 | | `default` | Layout with topbar, sidebar on the left and content| 48 | | `no_sidebar` | Layout without sidebar | -------------------------------------------------------------------------------- /packages/themes/light/style.css: -------------------------------------------------------------------------------- 1 | @import "styles/layout.css"; 2 | @import "styles/typography.css"; 3 | @import "styles/highlight.css"; 4 | 5 | :root{ 6 | --font: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica, 7 | Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"; 8 | --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 9 | 10 | --primary: #5BC9C3; 11 | --secondary: #B1B1B3; 12 | --dark: #1A202C; 13 | --light: #E2E8F0; 14 | 15 | --white: #ffffff; 16 | --code: #011627; 17 | 18 | --tag: #FEEBC8; 19 | --tag-border:#fdd58a; 20 | --tag-text:#DD6B20; 21 | 22 | --text: var(--dark); 23 | 24 | --topbar-height: 50px; 25 | --sidebar-width: 250px; 26 | 27 | --quote: var(--tag); 28 | --quote-side: var(--tag-text); 29 | 30 | --example-border: var(--light); 31 | 32 | --props-border: var(--light); 33 | --props-devider: var(--code); 34 | --props-types-bg: var(--tag); 35 | --props-types-border: var(--tag-border); 36 | --props-types-text: var(--tag-text); 37 | --props-oneof-text: var(--hl-builtin); 38 | --props-default-text: var(--light); 39 | 40 | --hl-background: var(--code); 41 | --hl-text: #D6DEEB; 42 | --hl-comment: #637777; 43 | --hl-keyword: #7FDBCA; 44 | --hl-string: #ADDB67; 45 | --hl-number: #F78C6C; 46 | --hl-name: #FFCB8B; 47 | --hl-attr: #ADDB67; 48 | --hl-builtin: #8B6CAF; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /packages/themes/light/styles/highlight.css: -------------------------------------------------------------------------------- 1 | /* 2 | * You can just import theme from the higlight.js package: 3 | * Example: @import 'highlight.js/styles/solarized-light.css' 4 | */ 5 | 6 | .hljs { 7 | display: block; 8 | overflow-x: auto; 9 | padding: 0.5em; 10 | background: var(--hl-background); 11 | color: var(--hl-text); 12 | font-family: var(--font-mono); 13 | } 14 | 15 | .hljs-comment, 16 | .hljs-quote { 17 | color: var(--hl-comment); 18 | } 19 | 20 | .hljs-keyword, 21 | .hljs-selector-tag, 22 | .hljs-addition { 23 | color: var(--hl-keyword); 24 | } 25 | 26 | .hljs-number{ 27 | color: var(--hl-number); 28 | } 29 | 30 | .hljs-string, 31 | .hljs-meta .hljs-meta-string, 32 | .hljs-literal, 33 | .hljs-doctag, 34 | .hljs-regexp { 35 | color: var(--hl-string); 36 | } 37 | 38 | .hljs-title, 39 | .hljs-section, 40 | .hljs-name, 41 | .hljs-selector-id, 42 | .hljs-selector-class { 43 | color: var(--hl-name); 44 | } 45 | 46 | .hljs-attribute, 47 | .hljs-attr, 48 | .hljs-variable, 49 | .hljs-template-variable, 50 | .hljs-class .hljs-title, 51 | .hljs-type { 52 | color: var(--hl-attr); 53 | } 54 | 55 | .hljs-symbol, 56 | .hljs-bullet, 57 | .hljs-subst, 58 | .hljs-meta, 59 | .hljs-meta .hljs-keyword, 60 | .hljs-selector-attr, 61 | .hljs-selector-pseudo, 62 | .hljs-link { 63 | color: var(--hl-string); 64 | } 65 | 66 | .hljs-built_in{ 67 | color: var(--hl-builtin); 68 | } 69 | 70 | .hljs-deletion { 71 | color: #dc322f; 72 | } 73 | 74 | .hljs-formula { 75 | background: #eee8d5; 76 | } 77 | 78 | .hljs-emphasis { 79 | font-style: italic; 80 | } 81 | 82 | .hljs-strong { 83 | font-weight: bold; 84 | } -------------------------------------------------------------------------------- /packages/themes/light/styles/layout.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | position: relative; 3 | width: 100%; 4 | height: 100%; 5 | } 6 | 7 | body { 8 | margin: 0; 9 | padding: 0px; 10 | box-sizing: border-box; 11 | } 12 | 13 | .topbar{ 14 | display:flex; 15 | justify-content: space-between; 16 | flex-wrap: nowrap; 17 | align-items: center; 18 | position: fixed; 19 | top:0px; 20 | height: var(--topbar-height); 21 | border-bottom: 1px solid var(--light); 22 | width: 100vw; 23 | line-height: var(--topbar-height); 24 | background-color: var(--white); 25 | } 26 | 27 | .logo{ 28 | margin-left:1em; 29 | white-space: nowrap; 30 | overflow-x: hidden; 31 | } 32 | 33 | .logo h1{ 34 | margin: 0px; 35 | padding: 0px; 36 | } 37 | 38 | .logo h1 a:hover{ 39 | text-decoration: none; 40 | } 41 | 42 | .topbar ul{ 43 | margin:0px; 44 | padding:0px; 45 | white-space: nowrap; 46 | } 47 | 48 | .topbar ul li{ 49 | display:inline-block; 50 | margin-right: 1em; 51 | } 52 | 53 | .topbar .show_sidebar{ 54 | display: block; 55 | background: none; 56 | border: none; 57 | cursor: pointer; 58 | color: var(--primary); 59 | align-self: center; 60 | margin: .2rem 61 | } 62 | 63 | 64 | .page{ 65 | display: flex; 66 | align-content: flex-start; 67 | } 68 | 69 | .sidebar{ 70 | position: fixed; 71 | left: 0px; 72 | top: 0px; 73 | bottom: 0px; 74 | width: var(--sidebar-width); 75 | height: calc(100vh - var(--topbar-height)); 76 | margin-top: var(--topbar-height); 77 | border-right: 1px solid var(--light); 78 | padding: 1em; 79 | box-sizing: border-box; 80 | font-size: .9em; 81 | background-color: var(--white); 82 | } 83 | 84 | .sidebar ul{ 85 | margin: 0; 86 | padding: 0; 87 | } 88 | 89 | .sidebar ul li{ 90 | display: block; 91 | color: var(--secondary); 92 | font-weight: bolder; 93 | margin: .3em 0; 94 | } 95 | 96 | .sidebar ul li a{ 97 | display: block; 98 | color: var(--text); 99 | font-weight: normal; 100 | } 101 | 102 | .sidebar ul li a:hover{ 103 | color: var(--primary); 104 | } 105 | 106 | .sidebar ul li a.active{ 107 | color: var(--primary); 108 | font-weight: bolder; 109 | } 110 | 111 | .sidebar ul ul{ 112 | margin-left: 1em; 113 | } 114 | 115 | .main{ 116 | padding-top: var(--topbar-height); 117 | margin-left: var(--sidebar-width); 118 | } 119 | 120 | .main.nosidebar{ 121 | margin-left: .5rem; 122 | margin-right: .5rem; 123 | } 124 | 125 | .article{ 126 | margin: 0 auto 3em auto; 127 | max-width: 46rem; 128 | } 129 | 130 | .article img { 131 | display: block; 132 | max-width: 100%; 133 | height: auto; 134 | margin: 0 auto; 135 | } 136 | 137 | table.properties{ 138 | margin: 25px; 139 | border-collapse: collapse; 140 | width: 100%; 141 | } 142 | 143 | table.properties td{ 144 | vertical-align: top; 145 | padding: .7rem; 146 | } 147 | 148 | table.properties .propname{ 149 | font-weight: bolder; 150 | } 151 | 152 | table.properties .propname.required{ 153 | text-decoration: underline; 154 | } 155 | 156 | table.properties .default{ 157 | color: var(--secondary); 158 | } 159 | 160 | table.properties tr{ 161 | border-bottom: 1px solid var(--light); 162 | } 163 | 164 | table.properties tr:last-child{ 165 | border-bottom: none; 166 | } 167 | 168 | 169 | span.typedef{ 170 | display: inline-block; 171 | padding: 0 .3em; 172 | color: var(--props-types-text); 173 | background: var(--props-types-bg); 174 | border: 1px solid var(--props-types-border); 175 | border-radius: .3em; 176 | margin-right: .3em; 177 | font-style: normal; 178 | font-family: var(--font-mono); 179 | font-size:.8em; 180 | letter-spacing: -.05em; 181 | } 182 | 183 | span.typedef span{ 184 | color: var(--props-oneof-text); 185 | } -------------------------------------------------------------------------------- /packages/themes/light/styles/typography.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: var(--text); 3 | line-height: 1.6; 4 | font-family: var(--font); 5 | } 6 | 7 | 8 | a { 9 | color: var(--primary); 10 | text-decoration: none; 11 | } 12 | 13 | a:hover { 14 | text-decoration: underline; 15 | } 16 | 17 | label { 18 | display: block; 19 | } 20 | 21 | input, button, select, textarea { 22 | font-family: inherit; 23 | font-size: inherit; 24 | padding: 0.4em; 25 | margin: 0 0 0.5em 0; 26 | box-sizing: border-box; 27 | border: 1px solid var(--light); 28 | border-radius: 2px; 29 | } 30 | 31 | input:disabled { 32 | color: var(--light); 33 | } 34 | 35 | input[type="range"] { 36 | height: 0; 37 | } 38 | 39 | button { 40 | color: #333; 41 | background-color: #f4f4f4; 42 | outline: none; 43 | } 44 | 45 | button:active { 46 | background-color: #ddd; 47 | } 48 | 49 | button:focus { 50 | border-color: #666; 51 | } 52 | 53 | code{ 54 | font-family: var(--font-mono); 55 | font-size: .9rem; 56 | background: var(--tag); 57 | border: 1px solid var(--tag-border); 58 | color: var(--tag-text); 59 | padding: 0 .2em; 60 | border-radius: .2em; 61 | white-space: nowrap; 62 | } 63 | 64 | 65 | pre { 66 | background-color: var(--code); 67 | padding: 1rem; 68 | overflow-x: auto; 69 | border-radius: .7em; 70 | margin:25px; 71 | } 72 | 73 | pre code { 74 | background: none; 75 | border: none; 76 | padding: 0; 77 | white-space: pre; 78 | font-size: .9rem; 79 | line-height: 1rem; 80 | color: var(--hl-text); 81 | } 82 | 83 | .example{ 84 | border: 1px solid var(--example-border); 85 | border-radius: .7em; 86 | margin:25px; 87 | } 88 | 89 | .example pre { 90 | border-top-left-radius : 0; 91 | border-top-right-radius : 0; 92 | } 93 | 94 | blockquote { 95 | background-color: var(--quote); 96 | padding: 1rem 2rem; 97 | border-left: 3px solid var(--quote-side); 98 | } 99 | -------------------------------------------------------------------------------- /packages/themes/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@svelte-docs/themes", 3 | "version": "1.0.1", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "svelte": { 8 | "version": "3.15.0", 9 | "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.15.0.tgz", 10 | "integrity": "sha512-OL9FIdUAmVTXR38cB/2vQQ9xWvW/7IuOASjWMfwRAB5NXywLW4Xqhblouan4odjI0S/JFGsytkgp7jelWpFgSA==", 11 | "dev": true 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/themes/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@svelte-docs/themes", 3 | "version": "1.0.1", 4 | "description": "Themes set for the svelte-docs", 5 | "repository": { 6 | "type": "git", 7 | "url": "git+https://github.com/AlexxNB/svelte-docs.git" 8 | }, 9 | "author": "Alexey Schebelev", 10 | "license": "MIT", 11 | "bugs": { 12 | "url": "https://github.com/AlexxNB/svelte-docs/issues" 13 | }, 14 | "homepage": "https://alexxnb.github.io/svelte-docs", 15 | "dependencies": {}, 16 | "devDependencies": { 17 | "svelte": "^3.15.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/themes/utils.js: -------------------------------------------------------------------------------- 1 | import { current_page } from '@svelte-docs/get/routes'; 2 | 3 | export function set_active_link(node){ 4 | return { 5 | destroy: current_page.subscribe(page => { 6 | node.querySelectorAll('a').forEach(a => { 7 | if(a.getAttribute('href') === page.url) 8 | a.classList.add('active'); 9 | else 10 | a.classList.remove('active') 11 | }); 12 | }) 13 | } 14 | } 15 | 16 | export function outside_click(node,handler){ 17 | document.body.addEventListener('click',handler); 18 | return{ 19 | destroy(){ 20 | document.body.removeEventListener('click',handler); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /scripts/clean.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra'); 2 | const path = require('path'); 3 | 4 | const subjects = ['node_modules','__DOCS__','__DEV__']; 5 | 6 | function cleanDirectory(dir='.') { 7 | fs.readdirSync(dir).forEach(file => { 8 | if(file === 'docs_src') return; 9 | const filepath = path.join(dir,file); 10 | if(subjects.includes(file)) { 11 | console.log(filepath, 'removed'); 12 | fs.removeSync(filepath) 13 | }else if(fs.statSync(filepath).isDirectory()){ 14 | cleanDirectory(filepath) 15 | } 16 | }) 17 | } 18 | 19 | fs.removeSync('./template/src/theme'); 20 | cleanDirectory(); 21 | -------------------------------------------------------------------------------- /scripts/install.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra'); 2 | const path = require('path'); 3 | const { pour } = require('std-pour'); 4 | const ln = require('symlink-dir') 5 | 6 | const PKGDIR = './packages'; 7 | const TPLDIR = './template'; 8 | 9 | const DEVDIR = './__DEV__' 10 | 11 | const NMDIR = path.join(DEVDIR,'node_modules','@svelte-docs'); 12 | 13 | async function run(){ 14 | 15 | console.log('1. Symlink template to the Dev dir'); 16 | ln(TPLDIR,DEVDIR); 17 | 18 | 19 | console.log('2. Do `npm i` in the Dev dir.'); 20 | await npm('install',TPLDIR); 21 | 22 | 23 | console.log('3. Do `npm i` in all packages and symlinking it in template.'); 24 | 25 | fs.mkdirpSync(NMDIR); 26 | fs.readdirSync(PKGDIR).forEach(async pkg => { 27 | if(fs.existsSync( path.join(PKGDIR,pkg,'package.json')) ){ 28 | await npm('install',path.join(PKGDIR,pkg)); 29 | ln(path.join(PKGDIR,pkg),path.join(NMDIR,pkg)); 30 | } 31 | }) 32 | 33 | console.log('Ready!'); 34 | } 35 | 36 | async function exec(command){ 37 | let ar = command.split(' ').map(e => e.trim()).filter(e => e !== ''); 38 | try{ 39 | await pour(ar.shift(), ar); 40 | }catch(err){ 41 | throw new Error(err); 42 | } 43 | } 44 | 45 | async function npm(command,dir){ 46 | if(dir) 47 | await exec(`npm --prefix ${dir} ${command}`); 48 | else 49 | await exec(`npm ${command}`); 50 | } 51 | 52 | run(); -------------------------------------------------------------------------------- /scripts/link.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const ln = require('symlink-dir') 4 | 5 | const PKGDIR = './packages'; 6 | const TPLDIR = './templates/default'; 7 | const NMDIR = path.join(TPLDIR,'node_modules','@svelte-docs'); 8 | 9 | fs.readdirSync(PKGDIR).forEach(pkg => { 10 | if(fs.existsSync( path.join(PKGDIR,pkg,'package.json')) ){ 11 | ln(path.join(PKGDIR,pkg),path.join(NMDIR,pkg)); 12 | } 13 | }) 14 | 15 | -------------------------------------------------------------------------------- /template/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | __DOCS__ -------------------------------------------------------------------------------- /template/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "svelte-docs-template", 4 | "version": "0.3.2", 5 | "dependencies": { 6 | "@svelte-docs/server": "^0.1.6" 7 | }, 8 | "devDependencies": { 9 | "@svelte-docs/core": "^0.10.13", 10 | "@svelte-docs/publisher": "^0.2.3", 11 | "@svelte-docs/themes": "^1.0.1", 12 | "npm-run-all": "^4.1.5" 13 | }, 14 | "scripts": { 15 | "build": "rollup -c node_modules/@svelte-docs/core/rollup.config.js", 16 | "autobuild": "rollup -c node_modules/@svelte-docs/core/rollup.config.js -w", 17 | "dev": "run-p start:dev start:pagewatch autobuild", 18 | "start": "node node_modules/@svelte-docs/server", 19 | "start:dev": "node node_modules/@svelte-docs/server --dev --single", 20 | "start:pagewatch": "node node_modules/@svelte-docs/core/watcher", 21 | "deploy": "npm run build && node node_modules/@svelte-docs/publisher" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /template/src/examples.css: -------------------------------------------------------------------------------- 1 | /* Styling of the examples view */ 2 | 3 | body { 4 | color: #333; 5 | margin: 0; 6 | padding: 8px; 7 | box-sizing: border-box; 8 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; 9 | } 10 | 11 | a { 12 | color: rgb(0,100,200); 13 | text-decoration: none; 14 | } 15 | 16 | a:hover { 17 | text-decoration: underline; 18 | } 19 | 20 | a:visited { 21 | color: rgb(0,80,160); 22 | } 23 | 24 | label { 25 | display: block; 26 | } 27 | 28 | input, button, select, textarea { 29 | font-family: inherit; 30 | font-size: inherit; 31 | padding: 0.4em; 32 | margin: 0 0 0.5em 0; 33 | box-sizing: border-box; 34 | border: 1px solid #ccc; 35 | border-radius: 2px; 36 | } 37 | 38 | input:disabled { 39 | color: #ccc; 40 | } 41 | 42 | input[type="range"] { 43 | height: 0; 44 | } 45 | 46 | button { 47 | background-color: #f4f4f4; 48 | outline: none; 49 | } 50 | 51 | button:active { 52 | background-color: #ddd; 53 | } 54 | 55 | button:focus { 56 | border-color: #666; 57 | } -------------------------------------------------------------------------------- /template/src/includes/error.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: 'no_sidebar' 3 | --- 4 | # Page not found! # 5 | 6 | [Go to start page](/) 7 | 8 | -------------------------------------------------------------------------------- /template/src/includes/logo.md: -------------------------------------------------------------------------------- 1 | # [SvelteDocs](/) # 2 | 3 | -------------------------------------------------------------------------------- /template/src/includes/sidebar.md: -------------------------------------------------------------------------------- 1 | * [Getting Started](getting-started) 2 | * Components 3 | - [Button](components/button) 4 | * [Github](https://github.com/alexxnb/svelte-docs) -------------------------------------------------------------------------------- /template/src/includes/topbar.md: -------------------------------------------------------------------------------- 1 | * [Docs](getting-started) 2 | * [Github](https://github.com/alexxnb/svelte-docs) -------------------------------------------------------------------------------- /template/src/pages/components/button.md: -------------------------------------------------------------------------------- 1 | # Button 2 | 3 | My button component 4 | 5 | ## Usage 6 | ```example 7 | 8 | 9 | ``` 10 | 11 | ## Properties 12 | ```properties 13 | type | Type of the button | 'default','error','success'('default') 14 | disabled | Make button disabled | bool(false) 15 | ``` -------------------------------------------------------------------------------- /template/src/pages/getting-started.md: -------------------------------------------------------------------------------- 1 | # About my component 2 | 3 | It is very cool button. 4 | 5 | ## Installation 6 | 7 | Run this command: 8 | 9 | ```shell 10 | $ npm install -D my-svelte-button 11 | ``` 12 | 13 | Then you can import it in your projects: 14 | 15 | ```html 16 | 19 | ``` 20 | -------------------------------------------------------------------------------- /template/src/pages/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: 'no_sidebar' 3 | title: false 4 | --- 5 | # Great Success 6 | 7 | You are ready to write documentation for new [Svelte](https://svelte.dev) thing! 8 | 9 | Start from editing files in `src/pages` directory. 10 | 11 | ![Great Success](static/great-success.png "Great Success") 12 | 13 | > For more info visit the [Svelte-Docs Reference](https://alexxnb.github.io/svelte-docs/) -------------------------------------------------------------------------------- /template/src/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexxNB/svelte-docs/f360de962c015dc3af471b7944e7677e9adcbbd4/template/src/static/favicon.png -------------------------------------------------------------------------------- /template/src/static/great-success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexxNB/svelte-docs/f360de962c015dc3af471b7944e7677e9adcbbd4/template/src/static/great-success.png -------------------------------------------------------------------------------- /template/src/theme.css: -------------------------------------------------------------------------------- 1 | /* Theme tunning: for full list ov variables visit the https://alexxnb.github.io/svelte-docs/theming */ 2 | 3 | :root{ 4 | 5 | --somevar: #ff3e00; 6 | 7 | } -------------------------------------------------------------------------------- /template/svelte-docs.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // if you will serve docs in subdirictory use '/subdir/' 3 | basepath: '/', 4 | 5 | // theme 6 | theme: 'default', 7 | 8 | title: { 9 | // constant part of page title 10 | main: 'Svelte Thing Documentation', 11 | 12 | // use first header's content as a part of page's title 13 | // it looks for `# Header` and `## Header` on the current page 14 | header: true, 15 | }, 16 | 17 | // URL to your favicon 18 | favicon: 'static/favicon.png', 19 | 20 | pathes: { 21 | // directory for files, generated in development mode 22 | dev: '__DOCS__/dev', 23 | 24 | // directory for builted documentaton 25 | build: '__DOCS__/dist', 26 | }, 27 | 28 | aliases:{ 29 | // Virtual packages 30 | // : , 31 | // 32 | // Ex1: './Button.svelte': './../dist/Button.svelte', 33 | // Ex2: 'mylib': './../dist/index.js', (don't miss `index` and `.js` at the end!) 34 | // 35 | // Then you can use: 36 | // import Button from './Button.svelte'; 37 | // import { Input } from 'mylib'; 38 | }, 39 | 40 | preprocess: [ 41 | // preprocessors for Svelte if needed in Examples 42 | // syntax same as for `preprocess` option in `rollup-plugin-svelte` 43 | // Ex: Import preprocessor at top of the config file: 44 | // import {markdown} from 'svelte-preprocess-markdown'; 45 | // Then add it here: 46 | // markdown({filetype: 'svelte'}), 47 | 48 | ] 49 | 50 | } --------------------------------------------------------------------------------