Hello. I hope the following recipe will be found useful.
Since Sphinx uses regular Python file, it is possible to use "regular"
Python modules :-). To be specific, you can use :mod:atexit and
sitemap_gen module
@atexit.register
def generate_sitemap():
if 'www' not in outdir:
return
try:
import sitemap_gen
config = <<<your site xml configuration>>>
<<<write file to the disk>>>
sitemap = sitemap_gen.CreateSitemapFromFile(<<<path to the
file>>>, True)
if not sitemap:
print 'ERROR(SITEMAP): configuration file errors'
else:
sitemap.Generate()
print 'ERRORS(SITEMAP): %d' %
sitemap_gen.output.num_errors
print 'WARNINGS(SITEMAP): %d' %
sitemap_gen.output.num_warns
except Exception, error:
print "ERROR(SITEMAP): sitemap file was not generated - ", str
(error)
Thus, every time you update the documentation, sitemap will be updated
to.
The complete and working source code could be found here:http://
pygccxml.svn.sourceforge.net/viewvc/pygccxml/sphinx/conf.py?
view=markup
Enjoy.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sphinx-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sphinx-dev?hl=en
-~----------~----~----~----~------~----~------~--~---