Skip to content
wingedfox edited this page Aug 18, 2016 · 1 revision

Configure web-app

Override Templates

Create folder with new templates

Folder should be open for read and contain one or more templates in the website subfolder. Folder structure should be the same as in website package.

Add templates

Template files should be placed under website/views subfolder within template folder in order to be detected and used by dgeni.

E.g. if you'd like to change the footer, you have to add website/views/footer.html to the template root. Absolute path should look like /opt/www/docs/custom-templates/website/views/footer.html.

Template definitions

Register new template folder with grunt

Add config option

templatePaths: [
  'path_to_templates_relative_to_Gruntfile'
]

to your Gruntfile.

Register new template folder with docgen

Take docgen package and directly update list of the locations in templateFinder component.

docgen.Package()
  .config(function(templateFinder) {
    templateFinder.templateFolders.unshift('absolute_path_to_templates');
  });
})

Override a whole website

Website has been refactored and dgeni-alive now contains 3 independent packages

  • website - contains web-app scripts, styles and templates and depends on the following packages
  • search - search index builder
  • navigation - navigation info provider

In order to replace default web-app with desired one you have to override the list of the packages, default one is

  • jsdoc-ext - extensions to dgeni-packages/jsdoc
  • ngdoc-ext - extensions to dgeni-packages/ngdoc
  • links-ext - extensions to dgeni-packages/links
  • website - website package, building docs web-app

Override packages with grunt

Add packages option to override default ones

packages: [
  'dgeni-alive/jsdoc-ext',
  'dgeni-packages/examples',
  'my-custom-web-app'
]

to the Gruntfile.

Override packages with docgen

docgen.Package([
  'dgeni-alive/jsdoc-ext',
  'dgeni-packages/examples',
  'my-custom-web-app'
]);