Generate documents offline #12
Labels
enhancement
New feature or request
hacktoberfest
ready-to-work
Item is ready to work on it
severity-minor
Item is not urgent
We recently used herbs to develop an offline application as a service. No layer rest or graphql;
In this case, we identified that it would be interesting to generate a folder at the root of the project with the html files.
code used generate.js
`const renderShelfHTML = require('@herbsjs/herbsshelf')
const fs = require('fs')
const yargs = require('yargs/yargs')
const { hideBin } = require('yargs/helpers')
const argv = yargs(hideBin(process.argv)).argv
const usecases = require('../../domain/usecases')
const output = argv.output ? argv.output : 'shelf'
if (!fs.existsSync(output)) {
fs.mkdirSync(output)
}
var stream = fs.createWriteStream(
./${output}/index.html
)stream.once('open', function () {
const shelf = renderShelfHTML(usecases())
stream.write(shelf)
stream.end()
})`
package.json
node generate.json --output=shelf
would it be interesting to put in the library the option to generate the html file?
The text was updated successfully, but these errors were encountered: