- Timestamp:
- Apr 5, 2014 9:24:06 AM (11 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 30fbe6d
- Parents:
- f330d67
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
docs/sphinx-docs/build_sphinx.py
ra40a875 r7d6f1bd 20 20 SASVIEW_SRC = os.path.join(CURRENT_SCRIPT_DIR, "..", "..", "src") 21 21 SASVIEW_BUILD = os.path.abspath(os.path.join(CURRENT_SCRIPT_DIR, "..", "..", "build", "lib"+platform)) 22 SASVIEW_DOCS = os.path.join(SASVIEW_BUILD, "doc") 22 23 23 24 SPHINX_BUILD = os.path.join(CURRENT_SCRIPT_DIR, "build") 24 25 SPHINX_SOURCE = os.path.join(CURRENT_SCRIPT_DIR, "source") 25 SPHINX_SOURCE_API = os.path.join(SPHINX_SOURCE, "dev", "api")26 SPHINX_SOURCE_API = os.path.join(SPHINX_SOURCE, "dev", "api") 26 27 27 28 def _remove_dir(dir_path): … … 40 41 def retrieve_user_docs(): 41 42 """ 42 Copies across the contents of any docs/ directories in src/, and puts them43 Copies across the contents of any media/ directories in src/, and puts them 43 44 in an appropriately named directory of docs/sphinx-docs/source/. For 44 45 example: 45 46 46 sans/../[MODULE]/docs/A.rst47 sans/../[MODULE]/docs/B.rst47 sans/../[MODULE]/media/dir/A.rst 48 sans/../[MODULE]/media/B.rst 48 49 49 50 gets copied to a new location: 50 51 51 docs/sphinx-docs/source/user/[MODULE]/A.rst52 docs/sphinx-docs/source/user/[MODULE]/B.rst52 docs/sphinx-docs/source/user/[MODULE]/dir/A.rst 53 docs/sphinx-docs/source/user/[MODULE]/B.rst 53 54 54 55 so that Sphinx may pick it up when generating the documentation. … … 58 59 # Copy documentation files from their "source" to their "destination". 59 60 for root, dirnames, _ in os.walk(SASVIEW_SRC): 60 for dirname in fnmatch.filter(dirnames, ' docs'):61 for dirname in fnmatch.filter(dirnames, 'media'): 61 62 62 63 docs = os.path.abspath(os.path.join(root, dirname)) … … 66 67 dest_dir = os.path.join(SPHINX_SOURCE, "user", dest_dir_name) 67 68 68 copy_tree(docs, dest_dir , update=1)69 copy_tree(docs, dest_dir) 69 70 70 71 def apidoc(): … … 87 88 Runs sphinx-build. Reads in all .rst files and spits out the final html. 88 89 """ 89 print "=== Build HTML from Rest Files ==="90 print "=== Build HTML Docs from Rest Files ===" 90 91 subprocess.call(["sphinx-build", 91 "-b", "html", # Builder name. 92 "-d", os.path.join(SPHINX_BUILD, "doctrees"), # Cache directory (doctrees).92 "-b", "html", # Builder name. TODO: accept as arg to setup.py. 93 "-d", os.path.join(SPHINX_BUILD, "doctrees"), 93 94 SPHINX_SOURCE, 94 95 os.path.join(SPHINX_BUILD, "html")]) 95 96 97 print "=== Copy HTML Docs to Build Directory ===" 98 html = os.path.join(SPHINX_BUILD, "html") 99 copy_tree(html, SASVIEW_DOCS) 100 96 101 if __name__ == "__main__": 97 102 call()
Note: See TracChangeset
for help on using the changeset viewer.