
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
html-gen-docs
Advanced tools
CLI to convert Markdown files to HTML and serve the generated documentation on a local server.
npm install -g html-gen-docs
After that, use html-gen from any directory on your machine.
bun add -g html-gen-docs
npx html-gen-docs --input docs --output docs-html
Convert and serve with explicit values:
html-gen --input docs/ --output docs-html/ --port 12334
Convert the current directory to a temp output with an auto-selected port:
html-gen
Clean the output directory before generating (removes stale files):
html-gen --input docs/ --output docs-html/ --clean
Show help:
html-gen --help
Show version:
html-gen --version
| Option | Short | Description | Default |
|---|---|---|---|
--input <dir> | -i | Source directory with .md files | Current directory |
--output <dir> | -o | Output directory for generated HTML | System temp dir |
--port <port> | -p | Port for the local server | Auto-selected |
--clean | -c | Empty the output directory before generating | false |
--help | -h | Show help | — |
--version | -v | Show version | — |
Default behavior:
--output not specified → Linux: /tmp/<timestamp>-<random>/ · Windows: C:\Temp\<timestamp>-<random>\--port not specified → first available port is used automaticallyIf you want to pin the tool version within a project:
npm install --save-dev html-gen-docs
Add a script to your package.json:
{
"scripts": {
"docs:serve": "html-gen --input docs/ --output docs-html/ --port 12334"
}
}
Run with:
npm run docs:serve
.md to .html```mermaid block and ::: mermaid syntax).md filesnode_modules automatically excluded from file counts.md only)--clean flag to remove stale output files before generationClick 📋 Todos os Arquivos in the listing toolbar to see every generated document from all folders in a single flat table. A Pasta (Folder) column shows the origin folder for each file. Click the button again to return to the normal folder view.
Type a term in the search bar and press Enter or click 🔎 Buscar.
.md sources)./guias), results are scoped to that folder and its subfolders..md file that is added, modified, or deleted is reflected in the next search without restarting the server.bin/
html-gen.js # global CLI entrypoint
src/
app/run.js # main orchestration
cli/parse-args.js # argument parsing and validation
config/
runtime-config.js # path resolution and defaults
temp-output.js # OS-specific temp directory
conversion/
discovery.js # recursive markdown discovery
converter.js # markdown → html pipeline
html/template.js # final HTML page template
markdown/
frontmatter.js # frontmatter parser with fallback
renderer.js # markdown-it + plugins
server/
directory-listing.js # HTML listing of generated files
start-server.js # Express server initialization
test/
*.test.js # automated tests (node:test)
docs/
teste-completo.md # full markdown document for render validation
Install dependencies:
npm install
Run tests:
npm test
Run locally:
npm start -- --input docs --output docs-html --port 12334
With Bun:
bun ./bin/html-gen.js --input docs --output docs-html
The project includes a pipeline in .gitlab-ci.yml with two stages:
test: runs npm test on branches and merge requestsrelease: runs npm run release on the main branch (semantic-release)For automatic npm publishing, configure the following GitLab CI/CD variables:
NPM_TOKEN: npm automation token with publish permissionGL_TOKEN: GitLab personal access token (scope api)Check that the directory specified with --input exists and contains .md files.
--output?No. Without --output, the tool creates a temporary directory automatically.
Yes. The package is implemented in CommonJS with libraries compatible with both runtimes.
Specify another port with --port, or omit it to use a free port automatically.
Yes. After the initial publish, the watcher monitors .md file changes, reconverts them automatically, and prints the URL in the terminal.
The tool only counts .md files and automatically excludes node_modules directories from all counts and size calculations.
Use --clean to empty the output directory before every run:
html-gen --input docs/ --output docs-html/ --clean
At startup, the tool reads all .md source files into an in-memory index. The file watcher keeps this index current: edits, new files, and deletions are reflected immediately without restarting the server.
Navigate to the folder first (e.g. open http://localhost:PORT/?path=guias), then use the search bar. Results will be limited to that folder and its subfolders.
docs/API.mdCONTRIBUTING.mdCHANGELOG.mddocs/npm-publish-guide.mdISC
CLI para converter arquivos Markdown em HTML e publicar a documentação gerada em um servidor local.
npm install -g html-gen-docs
Depois disso, use html-gen em qualquer pasta da máquina.
bun add -g html-gen-docs
npx html-gen-docs --input docs --output docs-html
Converter e servir com valores explícitos:
html-gen --input docs/ --output docs-html/ --port 12334
Converter a pasta atual para saída temporária e porta automática:
html-gen
Limpar o diretório de saída antes de gerar (remove arquivos obsoletos):
html-gen --input docs/ --output docs-html/ --clean
Mostrar ajuda:
html-gen --help
Mostrar versão:
html-gen --version
| Opção | Curta | Descrição | Padrão |
|---|---|---|---|
--input <pasta> | -i | Pasta de origem com arquivos .md | Pasta atual |
--output <pasta> | -o | Pasta de saída para os HTML gerados | Pasta temporária do sistema |
--port <porta> | -p | Porta do servidor local | Automática |
--clean | -c | Esvazia a pasta de saída antes de gerar | false |
--help | -h | Exibe a ajuda | — |
--version | -v | Exibe a versão | — |
Comportamento padrão:
--output → Linux: /tmp/<timestamp>-<random>/ · Windows: C:\Temp\<timestamp>-<random>\--port → a primeira porta disponível é usada automaticamenteSe você quer versionar o uso da ferramenta dentro de um projeto:
npm install --save-dev html-gen-docs
No package.json, adicione um script:
{
"scripts": {
"docs:serve": "html-gen --input docs/ --output docs-html/ --port 12334"
}
}
Execute com:
npm run docs:serve
.md para .html```mermaid e sintaxe ::: mermaid).md de origemnode_modules excluído automaticamente das contagens e tamanhos.md)--clean para remover arquivos obsoletos antes da geraçãoClique em 📋 Todos os Arquivos na barra da listagem para ver todos os documentos gerados de todas as pastas em uma tabela plana. A coluna Pasta indica a pasta de origem de cada arquivo. Clique novamente no botão para voltar à navegação normal por pastas.
Digite um termo na barra de pesquisa e pressione Enter ou clique em 🔎 Buscar.
.md de origem)./guias), os resultados ficam limitados àquela pasta e suas subpastas..md adicionados, modificados ou excluídos são refletidos na próxima busca sem reiniciar o servidor.bin/
html-gen.js # entrypoint CLI global
src/
app/run.js # orquestração principal
cli/parse-args.js # parse e validação de argumentos
config/
runtime-config.js # resolução de paths e defaults
temp-output.js # pasta temporária por SO
conversion/
discovery.js # busca recursiva de markdown
converter.js # pipeline markdown -> html
html/template.js # template final da página html
markdown/
frontmatter.js # parser de frontmatter com fallback
renderer.js # markdown-it + plugins
server/
directory-listing.js # listagem html de arquivos gerados
start-server.js # inicialização do express
test/
*.test.js # testes automatizados (node:test)
docs/
teste-completo.md # markdown completo para validar renderização
Instalar dependências:
npm install
Executar testes:
npm test
Rodar localmente:
npm start -- --input docs --output docs-html --port 12334
Com Bun:
bun ./bin/html-gen.js --input docs --output docs-html
O projeto inclui pipeline em .gitlab-ci.yml com dois estágios:
test: executa npm test em branches e merge requestsrelease: executa npm run release na branch main (semantic-release)Para publicação automática no npm, configure no GitLab (CI/CD Variables):
NPM_TOKEN: token do npm com permissão de publishGL_TOKEN: token de acesso ao GitLab (escopo api)Verifique se a pasta informada em --input existe e contém arquivos .md.
--output?Não. Sem --output, a ferramenta cria uma pasta temporária automaticamente.
Sim. O pacote foi implementado em CommonJS com bibliotecas compatíveis com os dois runtimes.
Informe outra porta com --port, ou remova a opção para usar uma porta livre automaticamente.
Sim. Depois da publicação inicial, o watcher monitora mudanças em .md, reconverte automaticamente e exibe a URL novamente no terminal.
A ferramenta conta apenas arquivos .md e exclui automaticamente diretórios node_modules de todas as contagens e cálculos de tamanho.
Use --clean para esvaziar a pasta de saída antes de cada execução:
html-gen --input docs/ --output docs-html/ --clean
Ao iniciar, a ferramenta lê todos os arquivos .md de origem e cria um índice em memória. O watcher mantém esse índice atualizado: edições, novos arquivos e exclusões são refletidos imediatamente, sem reiniciar o servidor.
Navegue até a pasta primeiro (ex.: abra http://localhost:PORTA/?path=guias) e use a barra de busca. Os resultados serão limitados àquela pasta e suas subpastas.
docs/API.mdCONTRIBUTING.mdCHANGELOG.mddocs/npm-publish-guide.mdISC
FAQs
CLI para converter Markdown em HTML e publicar documentacao local
We found that html-gen-docs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.