Changeset dce368f in sasview for docs


Ignore:
Timestamp:
Jun 16, 2017 1:01:44 PM (8 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:
8f1bb6f
Parents:
e9df8a5 (diff), f2ea95a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'ticket-510' into ticket-639-katex

Location:
docs/sphinx-docs
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • docs/sphinx-docs/source/conf.py

    r28c4a3d rdce368f  
    214214\renewcommand{\AA}{\text{\r{A}}} % Allow \AA in math mode 
    215215\usepackage[utf8]{inputenc}      % Allow unicode symbols in text 
     216\usepackage[T1]{fontenc}      % Taking care of underscores 
     217\catcode`\_=12                % Moving underscore to category 12 
     218\newcommand{\lt}{<}           %lower than symbol handling 
     219\newcommand{\gt}{>}           %greater than symbol handling 
    216220\DeclareUnicodeCharacter {00B7} {\ensuremath{\cdot}}   % cdot 
    217221\DeclareUnicodeCharacter {00B0} {\ensuremath{^\circ}}  % degrees 
  • docs/sphinx-docs/source/rst_prolog

    ra45185c r62af61fd  
    22.. Remove |biggamma|, etc. when they are no longer needed. 
    33 
     4    .. |alpha| unicode:: U+03B1 
     5    .. |beta| unicode:: U+03B2 
     6    .. |gamma| unicode:: U+03B3 
     7    .. |delta| unicode:: U+03B4 
     8    .. |epsilon| unicode:: U+03B5 
     9    .. |zeta| unicode:: U+03B6 
     10    .. |eta| unicode:: U+03B7 
     11    .. |theta| unicode:: U+03B8 
     12    .. |iota| unicode:: U+03B9 
     13    .. |kappa| unicode:: U+03BA 
     14    .. |lambda| unicode:: U+03BB 
     15    .. |mu| unicode:: U+03BC 
     16    .. |nu| unicode:: U+03BD 
     17    .. |xi| unicode:: U+03BE 
     18    .. |omicron| unicode:: U+03BF 
     19    .. |pi| unicode:: U+03C0 
     20    .. |rho| unicode:: U+03C1 
     21    .. |sigma| unicode:: U+03C3 
     22    .. |tau| unicode:: U+03C4 
     23    .. |upsilon| unicode:: U+03C5 
     24    .. |phi| unicode:: U+03C6 
     25    .. |chi| unicode:: U+03C7 
     26    .. |psi| unicode:: U+03C8 
     27    .. |omega| unicode:: U+03C9 
    428 
    5 .. |alpha| unicode:: U+03B1 
    6 .. |beta| unicode:: U+03B2 
    7 .. |gamma| unicode:: U+03B3 
    8 .. |delta| unicode:: U+03B4 
    9 .. |epsilon| unicode:: U+03B5 
    10 .. |zeta| unicode:: U+03B6 
    11 .. |eta| unicode:: U+03B7 
    12 .. |theta| unicode:: U+03B8 
    13 .. |iota| unicode:: U+03B9 
    14 .. |kappa| unicode:: U+03BA 
    15 .. |lambda| unicode:: U+03BB 
    16 .. |mu| unicode:: U+03BC 
    17 .. |nu| unicode:: U+03BD 
    18 .. |xi| unicode:: U+03BE 
    19 .. |omicron| unicode:: U+03BF 
    20 .. |pi| unicode:: U+03C0 
    21 .. |rho| unicode:: U+03C1 
    22 .. |sigma| unicode:: U+03C3 
    23 .. |tau| unicode:: U+03C4 
    24 .. |upsilon| unicode:: U+03C5 
    25 .. |phi| unicode:: U+03C6 
    26 .. |chi| unicode:: U+03C7 
    27 .. |psi| unicode:: U+03C8 
    28 .. |omega| unicode:: U+03C9 
     29    .. |biggamma| unicode:: U+0393 
     30    .. |bigdelta| unicode:: U+0394 
     31    .. |bigzeta| unicode:: U+039E 
     32    .. |bigpsi| unicode:: U+03A8 
     33    .. |bigphi| unicode:: U+03A6 
     34    .. |bigsigma| unicode:: U+03A3 
     35    .. |Gamma| unicode:: U+0393 
     36    .. |Delta| unicode:: U+0394 
     37    .. |Zeta| unicode:: U+039E 
     38    .. |Psi| unicode:: U+03A8 
     39 
     40    .. |drho| replace:: |Delta|\ |rho| 
     41 
     42    .. |equiv| unicode:: U+2261 
     43    .. |noteql| unicode:: U+2260 
     44    .. |TM| unicode:: U+2122 
    2945 
    3046 
    31 .. |biggamma| unicode:: U+0393 
    32 .. |bigdelta| unicode:: U+0394 
    33 .. |bigzeta| unicode:: U+039E 
    34 .. |bigpsi| unicode:: U+03A8 
    35 .. |bigphi| unicode:: U+03A6 
    36 .. |bigsigma| unicode:: U+03A3 
    37 .. |Gamma| unicode:: U+0393 
    38 .. |Delta| unicode:: U+0394 
    39 .. |Zeta| unicode:: U+039E 
    40 .. |Psi| unicode:: U+03A8 
    4147 
    42  
    43 .. |drho| replace:: |Delta|\ |rho| 
    4448.. |Ang| unicode:: U+212B 
    4549.. |Ang^-1| replace:: |Ang|\ :sup:`-1` 
     
    6064.. |A2| replace:: A\ :sub:`2`\ 
    6165 
    62  
    63 .. |equiv| unicode:: U+2261 
    64 .. |noteql| unicode:: U+2260 
    65 .. |TM| unicode:: U+2122 
    66  
    67  
    6866.. |cdot| unicode:: U+00B7 
    6967.. |deg| unicode:: U+00B0 
  • 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

    rf2ea95a r3194371  
    324324        print("!!!!NO MODEL DOCS WILL BE BUILT!!!!") 
    325325 
     326def fetch_katex(version, destination="_static"): 
     327    from zipfile import ZipFile 
     328    import urllib2 
     329    url = "https://github.com/Khan/KaTeX/releases/download/%s/katex.zip" % version 
     330    cache_path = "katex_%s.zip" % version 
     331    if not os.path.exists(cache_path): 
     332        try: 
     333            fd_in = urllib2.urlopen(url) 
     334            with open(cache_path, "wb") as fd_out: 
     335                fd_out.write(fd_in.read()) 
     336        finally: 
     337            fd_in.close() 
     338    with ZipFile(cache_path) as zip: 
     339        zip.extractall(destination) 
    326340 
    327341def retrieve_bumps_docs(): 
     
    360374                     SASVIEW_BUILD]) 
    361375 
     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 
    362402def build(): 
    363403    """ 
    364404    Runs sphinx-build.  Reads in all .rst files and spits out the final html. 
    365405    """ 
    366     print("=== Build HTML Docs from Rest Files ===") 
     406    print("=== Build HTML Docs from ReST Files ===") 
    367407    subprocess.call(["sphinx-build", 
    368408                     "-b", "html", # Builder name. TODO: accept as arg to setup.py. 
     
    375415    copy_tree(html, SASVIEW_DOCS) 
    376416 
    377     #We are building latex doc on linux only 
    378     if "linux" in platform: 
    379         print "=== Build Latex Docs from Rest Files ===" 
    380         subprocess.call(["sphinx-build", 
    381                      "-b", "latex", # Builder name. TODO: accept as arg to setup.py. 
    382                      "-d", os.path.join(SPHINX_BUILD, "doctrees"), 
    383                      SPHINX_SOURCE, 
    384                      os.path.join(SPHINX_BUILD, "latex")]) 
    385  
    386         print "=== Copy Latex Docs to Build Directory ===" 
    387         latex = os.path.join(SPHINX_BUILD, "latex") 
    388         copy_tree(latex, SASVIEW_DOCS) 
     417def convert_katex(): 
     418    print("=== Preprocess HTML, converting latex to html ===") 
     419    subprocess.call(["node", "convertKaTex.js", SASVIEW_DOCS]) 
    389420 
    390421def rebuild(): 
     
    393424    retrieve_user_docs() 
    394425    retrieve_bumps_docs() 
     426    fetch_katex(version=KATEX_VERSION, destination=KATEX_PARENT) 
    395427    apidoc() 
    396428    build() 
     429    #build_pdf() 
     430    #convert_katex() 
    397431 
    398432    print("=== Done ===") 
Note: See TracChangeset for help on using the changeset viewer.