https://github.com/gamtiq/jsdoc-file
JSDoc plugin to create files inside directory of generated documentation (e.g. .nojekyll etc)
https://github.com/gamtiq/jsdoc-file
content create directory documentation empty file jsdoc nojekyll plugin write
Last synced: 4 months ago
JSON representation
JSDoc plugin to create files inside directory of generated documentation (e.g. .nojekyll etc)
- Host: GitHub
- URL: https://github.com/gamtiq/jsdoc-file
- Owner: gamtiq
- License: mit
- Created: 2020-04-27T20:46:51.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-23T18:31:53.000Z (almost 4 years ago)
- Last Synced: 2025-02-15T22:35:35.249Z (4 months ago)
- Topics: content, create, directory, documentation, empty, file, jsdoc, nojekyll, plugin, write
- Language: JavaScript
- Size: 171 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[JSDoc](https://jsdoc.app/) plugin to create files inside directory of generated documentation (e.g. `.nojekyll` etc).
## Table of contents
* [Installation](#install)
* [Usage](#usage)
* [Examples](#examples)
* [Related projects](#related)
* [Contributing](#contributing)
* [License](#license)npm install jsdoc-file --save-dev
This plugin requires the following:
* JSDoc version >= 3.2.11. Add plugin into `plugins` array of a [JSDoc configuration file](https://jsdoc.app/about-configuring-jsdoc.html#configuring-plugins):
```json
{
...
"plugins": [
...
"jsdoc-file"
],
...
}
```2. Specify files that should be created as value of `opts.fileSet` field in the [JSDoc configuration file](https://jsdoc.app/about-configuring-jsdoc.html#incorporating-command-line-options-into-the-configuration-file):
```json
{
"opts": {
...
"fileSet": {
".nojekyll": "",
"LICENSE-MIT": "Copyright (c) ..."
}
},
...
}
```You can specify one or several files and provide content for them.
If a file does already exist in documentation directory the file will be overwritten.
It is possible to set file path that includes subdirectories inside documentation directory (necessary subdirectories will be automatically created).
You can skip creation of a file by setting `false`/`null` value for the file.
If you set an object or an array as a value for a file the corresponding JSON will be written into the file.
See examples below.In the following examples `"opts": {...}` is omitted for brevity.
Create one empty file:
```json
"fileSet": ".nojekyll"
```
or
```json
"fileSet": {
".nojekyll": ""
}
```
or
```json
"fileSet": {
".nojekyll": true
}
```Create several files at once:
```json
"fileSet": {
".nojekyll": true,
"LICENSE": "Some license data here",
"very/important/file.txt": "very important data",
"config.json": {
"a": 2,
"topics": ["home", "docs"],
"url": "http://some.server.net"
}
}
```Skip creating some files by setting `false`/`null` value for them:
```json
"fileSet": {
".nojekyll": false,
"a.txt": "content",
"some/dir/file.md": null
}
```## Related projects [↑](#start)
* [makef](https://github.com/gamtiq/makef) - a utility to create files inside specified directory.
* [typedoc-light-theme](https://github.com/gamtiq/typedoc-light-theme) - [TypeDoc](https://typedoc.org/) theme that adds some useful options (header links, custom style and script, ability to create files etc).## Contributing [↑](#start)
In lieu of a formal styleguide, take care to maintain the existing coding style.
Add unit tests for any new or changed functionality.
Lint and test your code.## License [↑](#start)
Copyright (c) 2020-2021 Denis Sikuler
Licensed under the MIT license.