doxygen_enhance.py 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. #! /usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # ===========================================================================
  4. # Copyright (c) 2010 Barend Gehrels, Amsterdam, the Netherlands.
  5. #
  6. # Use, modification and distribution is subject to the Boost Software License,
  7. # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  8. # http://www.boost.org/LICENSE_1_0.txt)9
  9. # ============================================================================
  10. import sys
  11. args = sys.argv[1:]
  12. if len(args) != 1:
  13. raise SystemExit("Usage: doxygen_enhance <html filename>")
  14. # 1) set variable for doxygen_contents to be posted
  15. file_in = open(args[0], 'r')
  16. doxygen_contents = file_in.read()
  17. doxygen_contents = doxygen_contents.replace('<span>Modules</span>', '<span>Function overview</span>')
  18. doxygen_contents = doxygen_contents.replace('<span>Related&nbsp;Pages</span>', '<span>Main pages</span>')
  19. doxygen_contents = doxygen_contents.replace('<span>Main&nbsp;Page</span>', '<span>Introduction</span>')
  20. doxygen_contents = doxygen_contents.replace('<li><a href="namespaces.html"><span>Namespaces</span></a></li>', '')
  21. doxygen_contents = doxygen_contents.replace('<h1>Modules</h1>Here is a list of all modules:<ul>', '<h1>Function overview</h1>Here is a list of all functions:<ul>')
  22. doxygen_contents = doxygen_contents.replace('<h1>Related Pages</h1>Here is a list of all related documentation pages:<ul>', '<h1>Main pages</h1>The following pages give backgrounds on Boost.Geometry:<ul>')
  23. file_out = file (args[0], 'w')
  24. file_out.write(doxygen_contents)
  25. file_out.close()