Ticket #13143: trac_13143-sage.v2.patch

File trac_13143-sage.v2.patch, 4.4 KB (added by jhpalmieri, 9 years ago)

Sage library

  • doc/common/build_options.py

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1341874862 18000
    # Node ID 558eb16ce22bfb5cb437cfff65bdbd43ab58cd98
    # Parent  04fced02d88535c647b0f1d4330b70c06ca3ce1a
    Use mathjax by default
    
    diff --git a/doc/common/build_options.py b/doc/common/build_options.py
    a b else: 
    1616
    1717#Note that this needs to have the doctrees dir   
    1818ALLSPHINXOPTS   = SPHINXOPTS + " " + PAPEROPTS + " "
     19WEBSITESPHINXOPTS = ""
  • doc/common/builder.py

    diff --git a/doc/common/builder.py b/doc/common/builder.py
    a b def builder_helper(type): 
    9595        output_dir = self._output_dir(type)
    9696        os.chdir(self.dir)
    9797
     98        options = ALLSPHINXOPTS
     99
     100        if self.name == 'website':
     101            # WEBSITESPHINXOPTS is either empty or " -A hide_pdf_links=1 "
     102            options += WEBSITESPHINXOPTS
     103
    98104        build_command = 'sphinx-build'
    99105        build_command += ' -b %s -d %s %s %s %s'%(type, self._doctrees_dir(),
    100                                                   ALLSPHINXOPTS, self.dir,
     106                                                  options, self.dir,
    101107                                                  output_dir)
    102108        logger.warning(build_command)
    103109        subprocess.call(build_command, shell=True)
    if __name__ == '__main__': 
    10741080    logger = setup_logger(options.verbose, options.color)
    10751081
    10761082    # Process selected options.
    1077     if (options.mathjax or (os.environ.get('SAGE_DOC_MATHJAX', False))
    1078         or (os.environ.get('SAGE_DOC_JSMATH', False))):
    1079         os.environ['SAGE_DOC_MATHJAX'] = "True"
     1083    #
     1084    # MathJax: this check usually has no practical effect, since
     1085    # SAGE_DOC_MATHJAX is set to "True" by the script sage-env.
     1086    # To disable MathJax, set SAGE_DOC_MATHJAX to "no" or "False".
     1087    if options.mathjax or (os.environ.get('SAGE_DOC_MATHJAX', 'no') != 'no'
     1088                           and os.environ.get('SAGE_DOC_MATHJAX', 'no') != 'False'):
     1089        os.environ['SAGE_DOC_MATHJAX'] = 'True'
    10801090
    10811091    if options.check_nested:
    10821092        os.environ['SAGE_CHECK_NESTED'] = 'True'
    if __name__ == '__main__': 
    10871097    if options.sphinx_opts:
    10881098        ALLSPHINXOPTS += options.sphinx_opts.replace(',', ' ') + " "
    10891099    if options.no_pdf_links:
    1090         ALLSPHINXOPTS += "-A hide_pdf_links=1 "
     1100        WEBSITESPHINXOPTS = " -A hide_pdf_links=1 "
    10911101    if options.warn_links:
    10921102        ALLSPHINXOPTS += "-n "
    10931103
  • doc/common/conf.py

    diff --git a/doc/common/conf.py b/doc/common/conf.py
    a b html_favicon = 'favicon.ico' 
    166166# so a file named "default.css" will overwrite the builtin "default.css".
    167167html_static_path = [os.path.join(SAGE_DOC, 'common/static'), 'static']
    168168
    169 # The environment variable SAGE_DOC_MATHJAX may be set by the user or
    170 # by the file "builder.py".  If it's set, or if SAGE_DOC_JSMATH is set
    171 # (for backwards compatibility), use MathJax.
    172 if (os.environ.get('SAGE_DOC_MATHJAX', False)
    173     or os.environ.get('SAGE_DOC_JSMATH', False)):
     169# We use MathJax to build the documentation unless the environment
     170# variable SAGE_DOC_MATHJAX is set to "no" or "False".  (Note that if
     171# the user does not set this variable, then the script sage-env sets
     172# it to "True".)
     173
     174if (os.environ.get('SAGE_DOC_MATHJAX', 'no') != 'no'
     175            and os.environ.get('SAGE_DOC_MATHJAX', 'no') != 'False'):
    174176
    175177    extensions.append('sphinx.ext.mathjax')
    176178    mathjax_path = 'MathJax.js?config=TeX-AMS_HTML-full,../mathjax_sage.js'
  • doc/en/installation/source.rst

    diff --git a/doc/en/installation/source.rst b/doc/en/installation/source.rst
    a b process: 
    681681  spkgs might also assume that certain programs are available on the
    682682  system (for example, ``latex`` or ``pdflatex``).
    683683
     684- :envvar:`SAGE_DOC_MATHJAX` - By default, any LaTeX code in Sage's
     685  documentation is processed by MathJax. If this variable is set to
     686  "no", then MathJax is not used -- instead, math is processed using
     687  LaTeX and converted by dvipng to image files, and then those files
     688  are included into the documentation. Typically, building the
     689  documentation using LaTeX and dvipng takes longer and uses more
     690  memory and disk space than using MathJax.
     691
    684692- :envvar:`SAGE_BUILD_DIR` - the default behavior is to build each
    685693  spkg in a subdirectory of :file:`$SAGE_ROOT/spkg/build/`; for
    686694  example, build :file:`atlas-3.8.3.p12.spkg` in the directory