Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate documents offline #12

Open
alavortx opened this issue Sep 2, 2021 · 3 comments
Open

Generate documents offline #12

alavortx opened this issue Sep 2, 2021 · 3 comments
Labels
enhancement New feature or request hacktoberfest ready-to-work Item is ready to work on it severity-minor Item is not urgent

Comments

@alavortx
Copy link

alavortx commented Sep 2, 2021

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?

@alavortx alavortx added the enhancement New feature or request label Sep 2, 2021
@alavortx alavortx closed this as completed Sep 2, 2021
@alavortx alavortx reopened this Sep 3, 2021
@jhomarolo
Copy link
Contributor

Hi @alavortx , i think that is a good idea, but I'm not sure if this implementation model is the best one.

Could you please run a benchmark inside other libs (ex: ncy with mocha like here

"coverage": "nyc --reporter=html mocha ./test",
)

But anyway, thank for your contrib

@alavortx
Copy link
Author

alavortx commented Sep 3, 2021

Perfect.
It was a palliative solution to the current situation. But I will delve into the subject.

@jhomarolo jhomarolo added ready-to-work Item is ready to work on it severity-minor Item is not urgent labels Dec 24, 2021
@italojs
Copy link
Member

italojs commented May 4, 2022

Is this issue still alive? @adrianoluisalmeida

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest ready-to-work Item is ready to work on it severity-minor Item is not urgent
Projects
Status: Ready to code
Development

No branches or pull requests

3 participants