Changeset 3194371 in sasview for docs


Ignore:
Timestamp:
Jun 16, 2017 10:41:01 AM (2 years ago)
Author:
Paul Kienzle <pkienzle@…>
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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
e9df8a5
Parents:
90d9cd3
Message:

add latex→html preprocessor and RST→PDF to the build (both supressed for now)

Location:
docs/sphinx-docs
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • docs/sphinx-docs/Makefile

    r1d5f5c2 r3194371  
    1616PAPEROPT_a4     = -D latex_paper_size=a4 
    1717PAPEROPT_letter = -D latex_paper_size=letter 
    18 ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 
     18ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source-temp 
    1919# the i18n builder cannot share the environment and doctrees with the others 
    2020I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 
     
    5353        rm -rf source/dev/api 
    5454        sphinx-apidoc -o source/dev/api -d 8 ../../src 
    55          
     55 
    5656html: stubs 
    5757        $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 
  • docs/sphinx-docs/build_sphinx.py

    r90d9cd3 r3194371  
    374374                     SASVIEW_BUILD]) 
    375375 
     376def build_pdf(): 
     377    """ 
     378    Runs sphinx-build for pdf.  Reads in all .rst files and spits out the final html. 
     379    """ 
     380    print("=== Build PDF Docs from ReST Files ===") 
     381    subprocess.call(["sphinx-build", 
     382                     "-b", "latex", # Builder name. TODO: accept as arg to setup.py. 
     383                     "-d", os.path.join(SPHINX_BUILD, "doctrees"), 
     384                     SPHINX_SOURCE, 
     385                     os.path.join(SPHINX_BUILD, "latex")]) 
     386 
     387    LATEXDIR = os.path.join(SPHINX_BUILD, "latex") 
     388    def pdflatex(): 
     389        subprocess.call(["pdflatex", "Sasview.tex"], cwd=LATEXDIR) 
     390    pdflatex() 
     391    pdflatex() 
     392    pdflatex() 
     393    subprocess.call(["makeindex", "-s", "python.ist", "Sasview.idx"], cwd=LATEXDIR) 
     394    pdflatex() 
     395    pdflatex() 
     396 
     397    print("=== Copy PDF to HTML Directory ===") 
     398    source = os.path.join(LATEXDIR, "Sasview.pdf") 
     399    target = os.path.join(SASVIEW_DOCS, "Sasview.pdf") 
     400    shutil.copyfile(source, target) 
     401 
    376402def build(): 
    377403    """ 
    378404    Runs sphinx-build.  Reads in all .rst files and spits out the final html. 
    379405    """ 
    380     print("=== Build HTML Docs from Rest Files ===") 
     406    print("=== Build HTML Docs from ReST Files ===") 
    381407    subprocess.call(["sphinx-build", 
    382408                     "-b", "html", # Builder name. TODO: accept as arg to setup.py. 
     
    388414    html = os.path.join(SPHINX_BUILD, "html") 
    389415    copy_tree(html, SASVIEW_DOCS) 
     416 
     417def convert_katex(): 
     418    print("=== Preprocess HTML, converting latex to html ===") 
     419    subprocess.call(["node", "convertKaTex.js", SASVIEW_DOCS]) 
    390420 
    391421def rebuild(): 
     
    397427    apidoc() 
    398428    build() 
     429    #build_pdf() 
     430    #convert_katex() 
    399431 
    400432    print("=== Done ===") 
Note: See TracChangeset for help on using the changeset viewer.