File: doc.py

package info (click to toggle)
gnat-gps 5.3dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 50,360 kB
  • ctags: 11,617
  • sloc: ada: 374,346; ansic: 92,327; python: 15,979; xml: 12,186; sh: 3,277; makefile: 1,113; awk: 154; perl: 128; java: 17
file content (23 lines) | stat: -rw-r--r-- 815 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## This is an example of how documentation can be generated in batch mode.
## Assuming you want to generate documentation for project My_Project located
## in /foo/bar, just issue the following command:
##
##    $ gps -P /foo/bar/my_project.gpr --load=python:doc.py

from GPS import *
from pygps import delayed_exit

def on_gps_started (hook):
  # Set the preferences. You can adjust them at your convenience.
  Preference ("Doc-Process-Body").set (True)
  Preference ("Doc-Show-Private").set (True)
  Preference ("Doc-References").set (True)
  Preference ("Doc-Up-To-Date-Only").set (False)

  # Generate documentation for the root projects and all subprojects.
  Project.root().generate_doc (recursive=True)

  # Try to exit every 10 seconds.
  delayed_exit (10000)

GPS.Hook ("gps_started").add (on_gps_started)