2017-06-23 14:46:24 +02:00
|
|
|
# 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:
|
2007-01-25 11:04:20 +00:00
|
|
|
##
|
2017-06-23 14:46:24 +02:00
|
|
|
# $ gps -P /foo/bar/my_project.gpr --load=python:doc.py
|
2007-01-25 11:04:20 +00:00
|
|
|
|
2017-06-23 14:46:24 +02:00
|
|
|
from GPS import Preference, Hook, Project
|
2008-06-10 13:09:21 +00:00
|
|
|
from pygps import delayed_exit
|
2007-01-25 11:04:20 +00:00
|
|
|
|
|
|
|
|
|
2017-06-23 14:46:24 +02:00
|
|
|
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)
|
2007-01-25 11:04:20 +00:00
|
|
|
|
2017-06-23 14:46:24 +02:00
|
|
|
# Generate documentation for the root projects and all subprojects.
|
|
|
|
|
Project.root().generate_doc(recursive=True)
|
2008-11-19 13:08:20 +00:00
|
|
|
|
2017-06-23 14:46:24 +02:00
|
|
|
# Try to exit every 10 seconds.
|
|
|
|
|
delayed_exit(10000)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Hook("gps_started").add(on_gps_started)
|