v0.5.0

Example

This is a little example how to create a project website with DoxyDoc.
First we start with an empty project.

This example assumes that you have a folder structure like:

myproject/ The project myproject-page/ The documentation page (That what we are creating in this example)



Setup

mkdir myproject-page # Our project folder cd myproject-page npm init # Run npm init # Install all requirements npm install grunt grunt-doxydoc grunt-version grunt-contrib-watch --save-dev # We need a gruntfile touch Gruntfile.js # A doxydoc config file touch doxydoc.json # A folder for our src pages mkdir pages # A example page touch pages/example.md



This ist the Gruntfile code:

module.exports = function(grunt) { 'use strict'; grunt.initConfig({ doxydoc: { dist: { options: {}, src: ['../myproject/src/**/*'], dest: 'public/' } }, version: { options: { pkg: '../myproject/package.json' }, defaults: { src: ['doxydoc.json'] } }, watch: { less: { options: { livereload: true }, files: 'less/*.less', tasks: ['less'] }, pages: { options: { livereload: true }, files: 'pages/**/*.*', tasks: ['doxydoc'] } } }); grunt.loadNpmTasks('grunt-doxydoc'); grunt.loadNpmTasks('grunt-version'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.registerTask('build', ['version', 'doxydoc']); };

We have a doxydoc task in the gruntfile. The task creates a source code documentation from all files located under myproject/src/ and copies the output to public/. The grunt-version task reads the module version from the mymodule/package.json file and updates the version in the doxydoc.json file.



Code of the doxydoc.json file

{ "name": "MyProject", "version": "0.0.0", "headerLinks": [ { "link": "docu.html", "name": "Docu" }, { "link": "http://doxydoc.com/syntax.html", "name": "Syntax", "target": "_blank" } ], "navigationLinks": [ { "link": "example.html", "file": "pages/example.md", "name": "Example page", "livereload": true } ], "indexPage": "../myproject/README.md" }

This file configures the links and pages. We have two links in the header and the link to the example.md file in the sidebar. The index page points to the README.md file of your project.


Add a little bit content to the example page:

MyProject example page ====================== So much fun :)




Thats it! We are ready for our first build.
Open a terminal and change into the myproject-page/ dir and type grunt build, then cross your fingers and press the enter button. If everything was correct configured you'll have a new great documentation page.
Open the index.html file in your web-browser to watch the result.