Using Jenkins to generate your documentation

By | 09/12/2013

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:

    1. 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:
    2. Install the nodejs package markdown-pdf that can be found here:
      Create a package.json for installation on the fly and put it next to your documentation files: 
    3. Create a new Jenkins job, using your git repository where your project and documentation is located and add the following “Execute shell” command

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

  1. 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.