3

How can I modify the look&feel template of the website generated by grunt-ngDocs ?

The final goal is to integrate the generated documentation inside a website.

Per example, we want to display the following tabs for each topic

  • Demo (focused on the final user rendering)
  • Code (for the developers)

To do that, we need to modify the template used by ngDocs, but how ?

PEC
  • 632
  • 1
  • 11
  • 28

2 Answers2

3

To create different tabs just add another Target to the ngdocs task:

ngdocs: {
  options: {        
    ...
    startPage: '/code' // this is displayed first
    ...        
  },
  demo: {
    src: ['path/to/demo/files'],
    title: 'Demo'
  },
  code: {
    src: ['path/to/code/files'],
    title: 'Code'
  }
}

Now, regarding the custom template.

You can provide your own Template file and CSS file.

You can even create a custom Navigation Template

Yoni Levy
  • 1,562
  • 2
  • 16
  • 35
0

You may style the template provided with your own css files that you can copy each time you generate the docs.

See https://www.npmjs.com/package/grunt-ngdocs#styles? where you may specify styles in the option object used to intitialize your docs in grunt

ggordon
  • 9,790
  • 2
  • 14
  • 27