I am one of the guys who wants to write the documentation for the project directly in the IDE. Since PHPStorm has a Markdown plugin I thought it might be a good idea to write the documentation in Markdown.
Next step would be to have this documentation in a nicely formatted PDF Document. And I don’t speak about code documentation, I am speaking about the part of the documentation the customer wants to have as a end user manual.
Some easy steps are necessary for that:
- Install nodeJS, since we use grunt for out JS/CSS build jobs, we already hat nodeJS installed. Documentation how to install nodeJS can be found here: http://nodejs.org/
- Install the nodejs package markdown-pdf that can be found here: https://npmjs.org/package/markdown-pdf
Or
Create a package.json for installation on the fly and put it next to your documentation files:{ "name": "markdown-pdf package", "version": "0.0.0", "description": "", "author": "Put your name here if you want to", "license": "BSD-2-Clause", "devDependencies": { "markdown-pdf": "*" } }
- Create a new Jenkins job, using your git repository where your project and documentation is located and add the following “Execute shell” command
- Run the jenkins job. If you want, you can copy the generated pdf document wherever you want to have it, or put the pdf inside a buildpackage.
cd ${WORKSPACE}/app/docs npm install ./node_modules/markdown-pdf/bin/markdown-pdf index.md --css-path pdf.css
I am currently working on a Symfony project so I decided to put my documentation in the folder app/docs. I also put the package.json in this folder