https://github.com/herbsjs/herbsshelf
Dynamically generated documentation for your domain
https://github.com/herbsjs/herbsshelf
documentation hacktoberfest herbsjs
Last synced: 11 months ago
JSON representation
Dynamically generated documentation for your domain
- Host: GitHub
- URL: https://github.com/herbsjs/herbsshelf
- Owner: herbsjs
- License: other
- Created: 2021-02-20T18:59:13.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-03-30T13:34:55.000Z (about 2 years ago)
- Last Synced: 2025-07-19T17:28:59.098Z (11 months ago)
- Topics: documentation, hacktoberfest, herbsjs
- Language: CSS
- Homepage:
- Size: 1.67 MB
- Stars: 8
- Watchers: 2
- Forks: 16
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README

 [](https://codecov.io/gh/herbsjs/herbsshelf)
# herbsshelf
Welcome to the shelf!
This is a self-generate documentation, here you can see all the flow of information in the application.
You can use the lateral panel to navigate into Use Cases of this application.

### Installing
```
$ npm install @herbsjs/herbsshelf
```
### Functioning
To use the shelf you will need to pass a list of usecases to it, it will read them and return a string from an HTML document with the generated documentation.
### Using
The quickest way to use the herbs shelf is to create a rest route in your api and expose the documentation generated by the shelf.
Consider a file called _uclist.js with this inside
```javascript
module.exports = (injection) => {
return [
{ usecase: require('./myUseCaseFile').myUseCaseName(injection), tags: { group: 'GroupOne' } },
{ usecase: require('./myUseCase2File').myUseCase2Name(injection), tags: { group: 'GroupOne' } },
{ usecase: require('./myUseCase3File').myUseCase3Name(injection), tags: { group: 'GroupTwo' } },
]
}
```
In your app or server file, import the shelf dependecy and the list of usecases
```javascript
const usecases = require('../../domain/usecases/_uclist')
const renderShelfHTML = require('herbsshelf')
```
And call the shelf into you prefered rest route
```javascript
this.app.get('/herbsshelf', (req, res, next) => {
res.setHeader('Content-Type', 'text/html')
const shelf = renderShelfHTML('Project Name', usecases(), entities)
res.write(shelf)
res.end()
})
```
If your project has a `readme.md`, this content should be shown at the beginning of the project. If you want to use a custom readme, you can specify on startup:
```javascript
const shelf = renderShelfHTML('Project Name', usecases(), entities, './custom-readme.md')
```
You can see the full functionality into the [TODO-LIST ON HERBS repository](https://github.com/herbsjs/todolist-on-herbs)
## TODO
- [X] Self-documentation
- [ ] Add templates and injection of css file
- [X] Entities of gotu support
- [ ] Playground functionality
- [ ] GraphQL documentation sample
### Contribute
Come with us to make an awesome *herbsshelf*.
Now, if you do not have the technical knowledge and also have intended to help us, do not feel shy, [click here](https://github.com/herbsjs/herbsshelf/issues) to open an issue and collaborate their ideas, the contribution may be a criticism or a compliment (why not?)
If you would like to help contribute to this repository, please see [CONTRIBUTING](https://github.com/herbsjs/herbsshelf/blob/main/.github/CONTRIBUTING.md)
### License
**herbsshelf** is released under the
[MIT license](https://github.com/herbsjs/herbsshelf/blob/main/LICENSE)