
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.
Doku is designed to make the process of building downloadable PDFs from markdown files simple and easy.
__ __
____/ /___ / /____ __
/ __ / __ \/ //_/ / / /
/ /_/ / /_/ / ,< / /_/ /
\__,_/\____/_/|_|\__,_/
npm install doku-md
The easiest way to get started with it is to run doku at the root of your documentation project.
> doku --glob '*.md'
Success! PDF file created
Open now: file.pdf
--fileName [file] -- name of the output file
--config [doku.json] -- configuration file
--glob [*.md] -- glob
--dev [false] -- launch a browser
--css -- path or url to a custom stylesheet
--js -- path or url to a custom Javascript include
--puppeteerOptions -- override default options of puppetter
--outputDir -- output directory
--tocLevels -- table of content levels. default: 'h1, h2, h3, h4'
In your markdown files, add a <toc> tag where you want to insert an automatically generated table of contents. This tag will scan the rest of the document for h1, h2, h3, and h4 headers and build an indented table of contents at that location.
<toc>
## My Header
lorem ipsum
You can use a doku.json file to pass your options. This file also takes an entries property where you can specify the files you'd like to use for your pdf. This is a great option if you want more precise control over your input files than a glob would provide.
Example:
{
"fileName": "Documentation.pdf",
"entries": ["Chapter1.md", "Chapter2.md"]
}
> doku
Success! PDF file created
Open now: Documentation.pdf
Under the hood, doku uses Bootstrap library to reboot the browser defaults. You can use any Bootstrap utility class to customize the appearance of your markdown files.
You can also pass your own stylesheet through the commandline.
doku --css mystyles.css
If you'd like to modify the DOM using Javascript, you can pass your own Javascript file.
doku --js myscript.js
In your file, you can use jQuery. To ensure that the page is completely rendered, listen for the doku-rendered custom event.
window.addEventListener(`doku-rendered`, () => { ... })
To extend the marked renderer, you can provide your extensions in the Javascript file. The renderer will be available at window.marked property.
Check out the "how-to" page of marked to get a better sense of how to extend the renderer.
If you want more control over your PDF, including customization for header and footer templates, you can pass puppeteerOptions to doku to override any of the defaults.
FAQs
Commandline tool that generates a pdf file from markdown files.
We found that doku-md demonstrated a not healthy version release cadence and project activity because the last version was released 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.