Ticket #6495: trac_6495-part2-everything-else.patch

File trac_6495-part2-everything-else.patch, 53.3 KB (added by jhpalmieri, 6 years ago)

apply second

  • .hgignore

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1311223150 25200
    # Node ID a3cf5eae8ffba4a7486b9b10866e59b604faa02b
    # Parent  34d8284ab576153fa65ecbea2f57deb15bfec064
    #6495: Break the reference manual into more manageable pieces.
    Part 2: all important changes to files.
    
    diff --git a/.hgignore b/.hgignore
    a b  
    6060doc/output/
    6161doc/en/reference/sage/
    6262doc/en/reference/sagenb/
     63doc/en/reference/.*/sage/
     64doc/en/reference/.*/sagenb/
  • MANIFEST.in

    diff --git a/MANIFEST.in b/MANIFEST.in
    a b  
    3434include doc/fr/a_tour_of_sage/sin_plot.png
    3535include doc/tr/a_tour_of_sage/eigen_plot.png
    3636include doc/tr/a_tour_of_sage/sin_plot.png
    37 graft   doc/en/reference/media
     37graft   doc/en/reference/*/media
    3838graft   doc/en/thematic_tutorials/media
    3939graft   doc/en/prep/media
    4040prune   doc/en/reference/sage
  • doc/common/builder.py

    diff --git a/doc/common/builder.py b/doc/common/builder.py
    a b  
    6161        raise shutil.Error(errors)
    6262
    6363
     64##########################################
     65#      Parallel Building Ref Manual      #
     66##########################################
     67
     68def build_ref_doc(doc, lang, format, output_dir, *args, **kwds):
     69    # Build the reference manual for doc
     70    static_dir = os.path.join(output_dir, 'reference', '_static')
     71    bad_static = os.path.join(output_dir, doc, '_static')
     72    # We need to remove the link to "_static" before generating the
     73    # documentation, because the html doc builder writes to the
     74    # _static directory.
     75    if (os.path.isdir(static_dir) and os.path.isdir(bad_static)
     76        and os.path.islink(bad_static)):
     77        os.remove(bad_static)
     78    getattr(ReferenceSubBuilder(doc, lang), format)(*args, **kwds)
     79    # The standard Sphinx html build puts a copy of the "static"
     80    # directory in reference/doc/_static.  For the reference manual,
     81    # these are all identical to reference/_static, so delete the
     82    # directory reference/doc/_static and replace it with a link to
     83    # reference/_static.  This saves hundreds of megabytes of disk
     84    # space.
     85    if (os.path.isdir(static_dir) and os.path.isdir(bad_static)
     86        and not os.path.islink(bad_static)):
     87        shutil.rmtree(bad_static)
     88    if os.path.isdir(static_dir):
     89        os.symlink(static_dir, bad_static)
    6490
    6591##########################################
    6692#             Builders                   #
     
    103129
    104130        - ``lang`` - (default "en") the language of the document.
    105131        """
    106         if '/' in name:
    107             lang, name = name.split(os.path.sep)
    108         self.name = name
     132        doc = name.split(os.path.sep)
     133
     134        if doc[0] in LANGUAGES:
     135            lang = doc[0]
     136            doc.pop(0)
     137
     138        self.name = os.path.join(*doc)
    109139        self.lang = lang
    110         self.dir = os.path.join(SAGE_DOC, lang, name)
     140        self.dir = os.path.join(SAGE_DOC, self.lang, self.name)
    111141
    112142        #Make sure the .static and .templates directories are there
    113143        mkdir(os.path.join(self.dir, "static"))
     
    209239    changes = builder_helper('changes')
    210240    linkcheck = builder_helper('linkcheck')
    211241
     242
    212243class AllBuilder(object):
    213244    """
    214245    A class used to build all of the documentation.
     
    228259        This is the function which goes through all of the documents
    229260        and does the actual building.
    230261        """
    231         for document in self.get_all_documents():
     262        docs = self.get_all_documents()
     263        refs = [x for x in docs if x.endswith('reference')]
     264        others = [x for x in docs if not x.endswith('reference')]
     265        for document in others:
     266            logger.warning("\nBuilding %s.\n" % document)
     267            getattr(get_builder(document), name)(*args, **kwds)
     268        # Build the reference manual twice to resolve references.
     269        # That is, build once to construct the intersphinx inventory
     270        # files, and then build the second time for real.  So the
     271        # first build should be as fast as possible; thus do an html
     272        # build first.
     273        logger.warning("\nBuilding reference manual, first pass.\n")
     274        global ALLSPHINXOPTS
     275        ALLSPHINXOPTS += ' -Q '
     276        for document in refs:
     277            getattr(get_builder(document), 'html')(*args, **kwds)
     278        logger.warning("Building reference manual, second pass.\n")
     279        ALLSPHINXOPTS = ALLSPHINXOPTS.replace('-Q', '-q') + ' '
     280        for document in refs:
    232281            getattr(get_builder(document), name)(*args, **kwds)
    233282
    234283    def get_all_documents(self):
     
    261310
    262311        return documents
    263312
     313
    264314class WebsiteBuilder(DocBuilder):
    265315    def html(self):
    266316        """
     
    292342
    293343        DocBuilder.clean(self)
    294344
    295 class ReferenceBuilder(DocBuilder):
     345
     346class ReferenceBuilder(AllBuilder):
    296347    """
    297     This the class used to build the reference manual.  It is
     348    This class builds the reference manual.  It uses DocBuilder to
     349    build the top-level page and ReferenceSubBuilder for each
     350    sub-component.
     351    """
     352    def __init__(self, name, lang='en'):
     353        """
     354        Records the reference manual's name, in case it's not
     355        identical to 'reference'.
     356        """
     357        AllBuilder.__init__(self)
     358        doc = name.split(os.path.sep)
     359
     360        if doc[0] in LANGUAGES:
     361            lang = doc[0]
     362            doc.pop(0)
     363
     364        self.name = doc[0]
     365        self.lang = lang
     366
     367    def _output_dir(self, type, lang='en'):
     368        """
     369        Returns the directory where the output of type type is stored.
     370        If the directory does not exist, then it will automatically be
     371        created.
     372
     373        EXAMPLES::
     374
     375            sage: import os, sys; sys.path.append(os.environ['SAGE_DOC']+'/common/'); import builder
     376            sage: b = builder.ReferenceBuilder('reference')
     377            sage: b._output_dir('html')
     378            '.../devel/sage/doc/output/html/en/reference'
     379        """
     380        return mkdir(os.path.join(SAGE_DOC, "output", type, lang, self.name))
     381
     382    def _wrapper(self, format, *args, **kwds):
     383        """
     384        Builds reference manuals.  For each language, it builds the
     385        top-level document and its components.
     386        """
     387        for lang in LANGUAGES:
     388            refdir = os.path.join(SAGE_DOC, lang, self.name)
     389            if not os.path.exists(refdir):
     390                continue
     391
     392            output_dir = self._output_dir(format, lang)
     393            getattr(DocBuilder(self.name, lang), format)(*args, **kwds)
     394
     395            from multiprocessing import Pool, cpu_count
     396            # Determine the number of threads from the environment variable
     397            # SAGE_NUM_THREADS.
     398            pool = Pool(int(os.environ.get('SAGE_NUM_THREADS', 1)))
     399            for doc in self.get_all_documents(refdir):
     400                pool.apply_async(build_ref_doc,
     401                                 (doc, lang, format,
     402                                  os.path.split(output_dir)[0]) + args, kwds)
     403            pool.close()
     404            pool.join()
     405            if format == 'html':
     406                # html build: combine the todo lists from the
     407                # different modules.
     408                todofile = os.path.join(output_dir, 'todolist', 'index.html')
     409                old = open(todofile).read()
     410                note = "The combined to do list is only available in the html version of the reference manual."
     411                preamble = old.find(note)
     412                postamble = preamble + len(note)
     413                if preamble != -1:
     414                    old_todofile = os.path.join(output_dir, 'todolist', 'index-old.html')
     415                    shutil.move(todofile, old_todofile)
     416                    new = open(todofile, 'w')
     417                    new.write(old[:preamble])
     418                    for f in os.listdir(output_dir):
     419                        index = os.path.join(output_dir, f, 'index.html')
     420                        if (f != 'todolist' and os.path.exists(index)):
     421                            html = open(index).read()
     422                            start = html.find('<div class="admonition-todo')
     423                            end = html.find('<div class="section" id="indices-and-tables">')
     424                            if start != -1:
     425                                html = html[start:end].replace('sage/%s' %f,
     426                                                               '../%s/sage/%s' % (f, f))
     427                                new.write(html)
     428                    new.write(old[postamble:])
     429                    new.close()
     430
     431                logger.warning('''
     432Build finished.  The Sage reference manual can be found in
     433
     434  %s
     435''' % (os.path.join(output_dir, 'index.html')))
     436            # PDF: we need to build master index file which lists all
     437            # of the PDF file.  So we create an html file, based on
     438            # the file index.html from the "website" target.
     439            if format == 'pdf':
     440                import re
     441                # First build the website page.  (This only takes a
     442                # few seconds.)
     443                getattr(get_builder('website'), 'html')()
     444                # Copy the relevant pieces of
     445                # output/html/en/website/_static to output_dir.
     446                # (Don't copy all of _static to save some space: we
     447                # don't need all of the MathJax stuff, and in
     448                # particular we don't need the fonts.)
     449                website_dir = os.path.join(SAGE_DOC, 'output', 'html',
     450                                           'en', 'website')
     451                static_files = ['COPYING.txt', 'basic.css', 'blank.gif',
     452                         'default.css', 'doctools.js', 'favicon.ico',
     453                         'file.png', 'jquery.js', 'minus.png',
     454                         'pdf.png', 'plus.png', 'pygments.css',
     455                         'sage.css', 'sageicon.png', 'sagelogo.png',
     456                         'searchtools.js', 'sidebar.js', 'underscore.js']
     457                try:
     458                    os.mkdir(os.path.join(output_dir, '_static'))
     459                except OSError:
     460                    pass
     461                for f in static_files:
     462                    shutil.copyfile(os.path.join(website_dir, '_static', f),
     463                                    os.path.join(output_dir, '_static', f))
     464                # Now modify website's index.html page and write it
     465                # to output_dir.
     466                f = open(os.path.join(website_dir, 'index.html'))
     467                html = f.read().replace('Documentation', 'Reference')
     468                f.close()
     469                html_output_dir = os.path.dirname(website_dir)
     470                html = html.replace('http://www.sagemath.org',
     471                                    os.path.join(html_output_dir, 'index.html'))
     472                # From index.html, we want the preamble and the tail.
     473                html_end_preamble = html.find('<h1>Sage Reference')
     474                html_bottom = html.rfind('</table>') + len('</table>')
     475                # For the content, we modify doc/en/reference/index.rst,
     476                # which has two parts: the body and the table of contents.
     477                f = open(os.path.join(SAGE_DOC, lang, 'reference', 'index.rst'))
     478                rst = f.read()
     479                f.close()
     480                # Replace rst links with html links.  There are two types:
     481                #
     482                # `blah`__
     483                # __ link
     484                #
     485                # `blah <module/index.html>`_
     486                #
     487                # For the second type, also change "module/index.html"
     488                # to "module/module.pdf".
     489                rst = re.sub('`([^`]*)`__\.\n\n__ (.*)',
     490                                  r'<a href="\2">\1</a>.', rst)
     491                rst = re.sub(r'`([^<]*?)\s+<(.*)/index\.html>`_',
     492                             r'<a href="\2/\2.pdf">\1 <img src="_static/pdf.png" /></a>',
     493                             rst)
     494                start = rst.find('=\n') + 1
     495                end = rst.find('Table of Contents')
     496                # Body: add paragraph <p> markup.
     497                rst_body = rst[start:end]
     498                rst_body = rst_body.replace('\n\n', '</p>\n<p>')
     499                start = rst.find('Table of Contents') + 2*len('Table of Contents') + 1
     500                end = rst.find('.. include:: footer.txt')
     501                # TOC: change * to <li>, change rst headers to html headers.
     502                rst_toc = rst[start:end]
     503                rst_toc = rst_toc.replace('*', '<li>')
     504                rst_toc = re.sub('\n([A-Z][a-zA-Z, ]*)\n-*\n',
     505                             '</ul>\n\n\n<h2>\\1</h2>\n\n<ul>\n', rst_toc)
     506                # Now write the file.
     507                new_index = open(os.path.join(output_dir, 'index.html'), 'w')
     508                new_index.write(html[:html_end_preamble])
     509                new_index.write('<h1>' + rst[:rst.find('\n')] +
     510                                ' (PDF version)'+ '</h1>')
     511                new_index.write(rst_body)
     512                new_index.write('<h2>Table of Contents</h2>\n\n<ul>')
     513                new_index.write(rst_toc)
     514                new_index.write('</ul>\n\n')
     515                new_index.write(html[html_bottom:])
     516                new_index.close()
     517                logger.warning('''
     518PDF documents have been created in subdirectories of
     519
     520  %s
     521
     522Alternatively, you can open
     523
     524  %s
     525
     526for a webpage listing all of the documents.''' % (output_dir,
     527                                                 os.path.join(output_dir,
     528                                                              'index.html')))
     529
     530    def get_all_documents(self, refdir):
     531        """
     532        Returns a list of all reference manual components to build.
     533        We add a component name if it's a subdirectory of the manual's
     534        directory and contains a file named 'index.rst'.
     535        """
     536        documents = []
     537
     538        for doc in os.listdir(refdir):
     539            if os.path.exists(os.path.join(refdir, doc, 'index.rst')):
     540                documents.append(os.path.join(self.name, doc))
     541       
     542        return documents
     543
     544
     545class ReferenceSubBuilder(DocBuilder):
     546    """
     547    This class builds sub-components of the reference manual.  It is
    298548    resposible for making sure the auto generated ReST files for the
    299549    Sage library are up to date.
    300550
     
    705955
    706956def get_builder(name):
    707957    """
    708     Returns a either a AllBuilder or DocBuilder object depending
    709     on whether ``name`` is 'all' or not.  These are the objects
    710     which do all the real work in building the documentation.
     958    Returns an appropriate *Builder object for the document ``name``.
     959    DocBuilder and its subclasses do all the real work in building the
     960    documentation.
    711961    """
    712962    if name == 'all':
    713963        return AllBuilder()
    714964    elif name.endswith('reference'):
    715965        return ReferenceBuilder(name)
     966    elif 'reference' in name:
     967        return ReferenceSubBuilder(name)
    716968    elif name.endswith('website'):
    717969        return WebsiteBuilder(name)
    718970    elif name in get_documents() or name in AllBuilder().get_all_documents():
     
    8021054    shortcut 'all' for all documents, available to the Sage
    8031055    documentation builder.
    8041056    """
     1057    docs = get_documents()
    8051058    s += "DOCUMENTs:\n"
    806     s += format_columns(get_documents() + ['all  (!)'])
    807     s += "(!) Builds everything.\n"
     1059    s += format_columns(docs + ['all  (!)'])
     1060    s += "(!) Builds everything.\n\n"
     1061    if 'reference' in docs:
     1062        s+= "Other valid document names take the form 'reference/DIR', where\n"
     1063        s+= "DIR is a subdirectory of SAGE_ROOT/devel/sage/doc/en/reference/.\n"
     1064        s+= "This builds just the specified part of the reference manual.\n"
    8081065    return s
    8091066
    8101067def get_formats():
  • doc/common/themes/sage/layout.html

    diff --git a/doc/common/themes/sage/layout.html b/doc/common/themes/sage/layout.html
    a b  
    77    {% if pathto(master_doc).endswith('.html') %}
    88      <a href="{{ '../' + pathto(master_doc) }}"><img src="{{ pathto('_static/sagelogo.png', 1) }}" style="vertical-align: middle" title="Sage Logo"></a>
    99    {% else %}
    10       <a href="{{ '../' + pathto(master_doc) + 'index.html' }}"><img src="{{ pathto('_static/sagelogo.png', 1) }}" style="vertical-align: middle" title="Sage Logo"></a>
     10      <a href="{{ '../' + pathto(master_doc, 1) + '.html' }}"><img src="{{ pathto('_static/sagelogo.png', 1) }}" style="vertical-align: middle" title="Sage Logo"></a>
    1111    {% endif %}
    1212  {% endif %}
    1313  {{ super() }}
  • new file doc/common/themes/sageref/layout.html

    diff --git a/doc/common/themes/sageref/layout.html b/doc/common/themes/sageref/layout.html
    new file mode 100644
    - +  
     1{% extends "basic/layout.html" %}
     2
     3{% block rootrellink %}
     4  {% if docstitle.startswith('Sage Documentation') %}
     5    <a href="http://www.sagemath.org"><img src="{{ pathto('_static/sagelogo.png', 1) }}" style="vertical-align: middle" title="Sage Logo"></a>
     6  {% else %}
     7    {% if pathto(master_doc).endswith('.html') %}
     8      <a href="{{ '../../' + pathto(master_doc) }}"><img src="{{ pathto('_static/sagelogo.png', 1) }}" style="vertical-align: middle" title="Sage Logo"></a>
     9    {% else %}
     10      <a href="{{ '../../' + pathto(master_doc,1) + '.html' }}"><img src="{{ pathto('_static/sagelogo.png', 1) }}" style="vertical-align: middle" title="Sage Logo"></a>
     11      <a href="{{ '../' + 'index.html' }}"> Sage Reference Manual </a> &raquo;
     12    {% endif %}
     13  {% endif %}
     14  {{ super() }}
     15{% endblock %}
     16
     17{% block extrahead %}
     18    <link rel="icon" href="{{ pathto('_static/sageicon.png', 1) }}" type="image/x-icon" />
     19{% endblock %}
     20
     21{%- block footer %}
     22    {{ super() }}
     23    <script type="text/javascript">
     24/*global jQuery, window */
     25/* Sphinx sidebar toggle.  Putting this code at the end of the body
     26 * enables the toggle for the live, static, and offline docs.  Note:
     27 * sage.misc.html.math_parse() eats jQuery's dollar-sign shortcut. */
     28var jq = jQuery; 
     29jq(document).ready(function () {
     30    var bar, bod, bg, fg, key, tog, wid_old, wid_new, resize, get_state, set_state;
     31    bod = jq('div.bodywrapper');
     32    bar = jq('div.sphinxsidebar');
     33    tog = jq('<div class="sphinxsidebartoggle"></div>');
     34   
     35    /* Delayed resize helper.  Not perfect but good enough. */
     36    resize = function () {
     37        setTimeout(function () {
     38            tog.height(bod.height());
     39        }, 100);
     40    };
     41    jq(window).resize(function () {
     42        resize();
     43    });
     44   
     45    /* Setup and add the toggle. See Sphinx v0.5.1 default.css. */
     46    fg = jq('div.sphinxsidebar p a').css('color') || 'rgb(152, 219, 204)';
     47    bg = jq('div.document').css('background-color') || 'rgb(28, 78, 99)';
     48    wid_old = '230px';
     49    wid_new = '5px';
     50    tog.css('background-color', bg)
     51        .css('border-width', '0px')
     52        .css('border-right', wid_new + ' ridge ' + bg)
     53        .css('cursor', 'pointer')
     54        .css('position', 'absolute')
     55        .css('left', '-' + wid_new)
     56        .css('top', '0px')
     57        .css('width', wid_new);
     58    bod.css('position', 'relative');
     59    bod.prepend(tog);
     60    resize();
     61   
     62    /* Cookie helpers. */
     63    key = 'sphinxsidebar=';
     64    set_state = function (s) {
     65        var date = new Date();
     66        /* Expiry in 7 days. */
     67        date.setTime(date.getTime() + (7 * 24 * 3600 * 1000));
     68        document.cookie = key + encodeURIComponent(s) + '; expires=' +
     69            date.toUTCString() + '; path=/';
     70    };
     71    get_state = function () {
     72        var i, c, crumbs = document.cookie.split(';');
     73        for (i = 0; i < crumbs.length; i += 1) {
     74            c = crumbs[i].replace(/^\s+/, '');
     75            if (c.indexOf(key) === 0) {
     76                return decodeURIComponent(c.substring(key.length, c.length));
     77            }
     78        }
     79        return null;
     80    };
     81   
     82    /* Event handlers. */
     83    tog.mouseover(function (ev) {
     84        tog.css('border-right-color', fg);
     85    }).mouseout(function (ev) {
     86        tog.css('border-right-color', bg);
     87    }).click(function (ev) {
     88        if (bod.hasClass('wide')) {
     89            bod.removeClass('wide');
     90            bod.css('margin-left', wid_old);
     91            bar.css('width', wid_old);
     92            bar.show();
     93            set_state('visible');
     94        } else {
     95            set_state('hidden');
     96            bar.hide();
     97            bar.css('width', '0px');
     98            bod.css('margin-left', wid_new);
     99            bod.addClass('wide');
     100        }
     101        resize();
     102    });
     103   
     104    /* Hide the normally visible sidebar? */
     105    if (get_state() === 'hidden') {
     106        tog.trigger('click');
     107    } else {
     108        set_state('visible');
     109    }
     110});
     111    </script>
     112{%- endblock %}
     113
     114<!-- This macro block for the sidebar is heavily borrowed from the basic -->
     115<!-- theme of Sphinx 0.6.3. In particular, we borrowed from the file -->
     116<!-- themes/basic/layout.html distributed with Sphinx 0.6.3. -->
     117{%- macro sidebar() %}
     118      {%- if not embedded %}{% if not theme_nosidebar|tobool %}
     119      <div class="sphinxsidebar">
     120        <div class="sphinxsidebarwrapper">
     121          {%- block sidebarlogo %}
     122          {%- if logo %}
     123            <p class="logo"><a href="{{ pathto(master_doc) }}">
     124              <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
     125            </a></p>
     126          {%- endif %}
     127          {%- endblock %}
     128          {%- block sidebartoc %}
     129          {%- if display_toc %}
     130            <h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3>
     131            {{ toc }}
     132          {%- endif %}
     133          {%- endblock %}
     134          {%- block sidebarrel %}
     135          {%- if prev %}
     136            <h4>{{ _('Previous topic') }}</h4>
     137            <p class="topless"><a href="{{ prev.link|e }}"
     138                                  title="{{ _('previous chapter') }}">{{ prev.title }}</a></p>
     139          {%- endif %}
     140          {%- if next %}
     141            <h4>{{ _('Next topic') }}</h4>
     142            <p class="topless"><a href="{{ next.link|e }}"
     143                                  title="{{ _('next chapter') }}">{{ next.title }}</a></p>
     144          {%- endif %}
     145          {%- endblock %}
     146          {%- block sidebarsourcelink %}
     147          {%- if show_source and has_source and sourcename %}
     148            <h3>{{ _('This Page') }}</h3>
     149            <ul class="this-page-menu">
     150              <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}"
     151                     rel="nofollow">{{ _('Show Source') }}</a></li>
     152            </ul>
     153          {%- endif %}
     154          {%- endblock %}
     155          {%- if customsidebar %}
     156          {% include customsidebar %}
     157          {%- endif %}
     158          {%- block sidebarsearch %}
     159          {%- if pagename != "search" %}
     160          <div id="searchbox" style="display: none">
     161            <h3>{{ _('Quick search') }}</h3>
     162              <form class="search" action="{{ pathto('search') }}" method="get">
     163                <input type="text" name="q" size="18" />
     164               <!-- The shading of the "Go" button should be consistent -->
     165               <!-- with the colour of the header and footer. See the file -->
     166               <!-- doc/common/themes/sage/theme.conf for colours used by -->
     167               <!-- the Sage theme. -->
     168                <input type="submit" style="background-color: #B8B9F6" value="{{ _('Go') }}" />
     169                <input type="hidden" name="check_keywords" value="yes" />
     170                <input type="hidden" name="area" value="default" />
     171              </form>
     172              <p class="searchtip" style="font-size: 90%">
     173              {{ _('Enter search terms or a module, class or function name.') }}
     174              </p>
     175          </div>
     176          <script type="text/javascript">$('#searchbox').show(0);</script>
     177          {%- endif %}
     178          {%- endblock %}
     179        </div>
     180      </div>
     181      {%- endif %}{% endif %}
     182{%- endmacro %}
  • new file doc/common/themes/sageref/static/favicon.ico

    diff --git a/doc/common/themes/sageref/static/favicon.ico b/doc/common/themes/sageref/static/favicon.ico
    new file mode 100644
    index 0000000000000000000000000000000000000000..51775bc542a5d8653935c5223b9ecd616cb1e085
    GIT binary patch
    literal 1150
    zc$}q^KT88a5XI-z_zxqeVh|AtA|eQ4DMCcCv$3+X(Mmr+K(M%gtyrWLECfYJC)n9o
    z2^L9_A}A@u;z;mAoNv5$FsyefxZxKzGy7&|XC@*ZKE5ybF3Mq_NI^sv0Zg#O_OAtB
    zD<6}rC<s1McmwC)IK%%FZEyfIb}twP^NdybMf(mm!6+C31yBduU=`%R7<kFhuY(c@
    zK^06pv2TH&@vdF41-j<^lyjy7YM^LruRLe92?LB{ZA~y^YH<lXzD>`sfF0)Ou?8KZ
    z*SC#>vU5*`xjcdku*4oHdG;Ux&%D26^mB}B^IT)x9^S9I1uzSSm|L4?m%)+Imd)F>
    zkN3vcWo{FuUUy)F`|Bv4n+AVtE%uE5lzMk=^bHTx){O6l_0s(l_ij%Vozs4B=Ga5V
    z)c?dJ>+5Pm*280*EA~0@YrS-4PExc9nw!q&KHsNz4KgR~VJ`YUUw=XG)ETR$`Q@MM
    E6WVp2FaQ7m
  • new file doc/common/themes/sageref/static/mathjax_sage.js_t

    diff --git a/doc/common/themes/sageref/static/mathjax_sage.js_t b/doc/common/themes/sageref/static/mathjax_sage.js_t
    new file mode 100644
    - +  
     1MathJax.Hub.Config({
     2  imageFont: null,
     3  tex2jax: {
     4    inlineMath: [['$','$'],['\\(','\\)']],
     5    processEscapes: true,
     6  },
     7  styles: {
     8    ".MathJax .mo, .MathJax .mi": {
     9      color: "inherit ! important"
     10    }
     11  },
     12  TeX: {
     13    Macros: {
     14     {{ theme_mathjax_macros|join(',\n') }}
     15    }
     16  }
     17});
     18
     19// This path is a little funny because we have to load our local
     20// config file as '../mathjax_sage' in the theme conf.py
     21MathJax.Ajax.loadComplete("[MathJax]/config/../mathjax_sage.js")
  • new file doc/common/themes/sageref/static/sage.css_t

    diff --git a/doc/common/themes/sageref/static/sage.css_t b/doc/common/themes/sageref/static/sage.css_t
    new file mode 100644
    - +  
     1/**
     2 * Sage stylesheet theme. This stylesheet is heavily borrowed from the
     3 * Sphinx stylesheet default theme distributed as the file
     4 * themes/default/static/default.css_t in Sphinx 0.6.3.
     5 */
     6
     7@import url("basic.css");
     8
     9/* -- page layout ----------------------------------------------------------- */
     10
     11body {
     12    font-family: {{ theme_bodyfont }};
     13    font-size: 100%;
     14    background-color: {{ theme_footerbgcolor }};
     15    color: #000;
     16    margin: 0;
     17    padding: 0;
     18}
     19
     20div.document {
     21    background-color: {{ theme_sidebarbgcolor }};
     22}
     23
     24div.documentwrapper {
     25    float: left;
     26    width: 100%;
     27}
     28
     29div.bodywrapper {
     30    margin: 0 0 0 230px;
     31}
     32
     33div.body {
     34    background-color: {{ theme_bgcolor }};
     35    color: {{ theme_textcolor }};
     36    padding: 0 20px 30px 20px;
     37}
     38
     39{%- if theme_rightsidebar|tobool %}
     40div.bodywrapper {
     41    margin: 0 230px 0 0;
     42}
     43{%- endif %}
     44
     45div.footer {
     46    color: {{ theme_footertextcolor }};
     47    width: 100%;
     48    padding: 9px 0 9px 0;
     49    text-align: center;
     50    font-size: 75%;
     51}
     52
     53div.footer a {
     54    color: {{ theme_footertextcolor }};
     55    text-decoration: underline;
     56}
     57
     58div.related {
     59    background-color: {{ theme_relbarbgcolor }};
     60    line-height: 30px;
     61    color: {{ theme_relbartextcolor }};
     62}
     63
     64div.related a {
     65    color: {{ theme_relbarlinkcolor }};
     66}
     67
     68div.sphinxsidebar {
     69    {%- if theme_stickysidebar|tobool %}
     70    top: 30px;
     71    margin: 0;
     72    position: fixed;
     73    overflow: auto;
     74    height: 100%;
     75    {%- endif %}
     76    {%- if theme_rightsidebar|tobool %}
     77    float: right;
     78    {%- if theme_stickysidebar|tobool %}
     79    right: 0;
     80    {%- endif %}
     81    {%- endif %}
     82}
     83
     84{%- if theme_stickysidebar|tobool %}
     85/* this is nice, but it it leads to hidden headings when jumping
     86   to an anchor */
     87/*
     88div.related {
     89    position: fixed;
     90}
     91
     92div.documentwrapper {
     93    margin-top: 30px;
     94}
     95*/
     96{%- endif %}
     97
     98div.sphinxsidebar h3 {
     99    font-family: {{ theme_headfont }};
     100    color: {{ theme_sidebartextcolor }};
     101    font-size: 1.4em;
     102    font-weight: normal;
     103    margin: 0;
     104    padding: 0;
     105}
     106
     107div.sphinxsidebar h3 a {
     108    color: {{ theme_sidebartextcolor }};
     109}
     110
     111div.sphinxsidebar h4 {
     112    font-family: {{ theme_headfont }};
     113    color: {{ theme_sidebartextcolor }};
     114    font-size: 1.3em;
     115    font-weight: normal;
     116    margin: 5px 0 0 0;
     117    padding: 0;
     118}
     119
     120div.sphinxsidebar p {
     121    color: {{ theme_sidebartextcolor }};
     122}
     123
     124div.sphinxsidebar p.topless {
     125    margin: 5px 10px 10px 10px;
     126}
     127
     128div.sphinxsidebar ul {
     129    margin: 10px;
     130    padding: 0;
     131    color: {{ theme_sidebartextcolor }};
     132}
     133
     134div.sphinxsidebar a {
     135    color: {{ theme_sidebarlinkcolor }};
     136}
     137
     138div.sphinxsidebar input {
     139    border: 1px solid {{ theme_sidebarlinkcolor }};
     140    font-family: sans-serif;
     141    font-size: 1em;
     142}
     143
     144/* -- body styles ----------------------------------------------------------- */
     145
     146a {
     147    color: {{ theme_linkcolor }};
     148    text-decoration: none;
     149}
     150
     151a:hover {
     152    text-decoration: underline;
     153}
     154
     155div.body p, div.body dd, div.body li {
     156    text-align: justify;
     157    line-height: 130%;
     158}
     159
     160div.body h1,
     161div.body h2,
     162div.body h3,
     163div.body h4,
     164div.body h5,
     165div.body h6 {
     166    font-family: {{ theme_headfont }};
     167    background-color: {{ theme_headbgcolor }};
     168    font-weight: normal;
     169    color: {{ theme_headtextcolor }};
     170    border-bottom: 1px solid #ccc;
     171    margin: 20px -20px 10px -20px;
     172    padding: 3px 0 3px 10px;
     173}
     174
     175div.body h1 { margin-top: 0; font-size: 200%; }
     176div.body h2 { font-size: 160%; }
     177div.body h3 { font-size: 140%; }
     178div.body h4 { font-size: 120%; }
     179div.body h5 { font-size: 110%; }
     180div.body h6 { font-size: 100%; }
     181
     182a.headerlink {
     183    color: {{ theme_headlinkcolor }};
     184    font-size: 0.8em;
     185    padding: 0 4px 0 4px;
     186    text-decoration: none;
     187}
     188
     189a.headerlink:hover {
     190    background-color: {{ theme_headlinkcolor }};
     191    color: white;
     192}
     193
     194div.body p, div.body dd, div.body li {
     195    text-align: justify;
     196    line-height: 130%;
     197}
     198
     199div.admonition p.admonition-title + p {
     200    display: inline;
     201}
     202
     203div.note {
     204    background-color: #eee;
     205    border: 1px solid #ccc;
     206}
     207
     208div.seealso {
     209    background-color: #ffc;
     210    border: 1px solid #ff6;
     211}
     212
     213div.topic {
     214    background-color: #eee;
     215}
     216
     217div.warning {
     218    background-color: #ffe4e4;
     219    border: 1px solid #f66;
     220}
     221
     222p.admonition-title {
     223    display: inline;
     224}
     225
     226p.admonition-title:after {
     227    content: ":";
     228}
     229
     230/**
     231 * Code block.
     232 * The border colour should be a darker shade of the background colour.
     233 * The hex code #E8D898 used below is a pale, light grayish amber.
     234 */
     235pre {
     236    padding: 5px;
     237    background-color: {{ theme_codebgcolor }};
     238    color: {{ theme_codetextcolor }};
     239    line-height: 120%;
     240    border: 1px solid #E8D898;
     241    border-left: none;
     242    border-right: none;
     243}
     244
     245/**
     246 * Commands or code within text. The hex code #EAEAF8 used below is a
     247 * pale, light grayish blue.
     248 */
     249tt {
     250    background-color: #EAEAF8;
     251    padding: 0 1px 0 1px;
     252    font-size: 0.95em;
     253}
  • new file doc/common/themes/sageref/theme.conf

    diff --git a/doc/common/themes/sageref/theme.conf b/doc/common/themes/sageref/theme.conf
    new file mode 100644
    - +  
     1[theme]
     2inherit = default
     3stylesheet = sage.css
     4pygments_style = sphinx
     5
     6[options]
     7# Custom Sage theme options
     8
     9# MathJax settings filled in by conf.py
     10mathjax_macros =
     11
     12# Sphinx default theme options
     13
     14#nosidebar = false
     15#rightsidebar = false
     16#stickysidebar = false
     17
     18# Background color for the footer line: pale, light grayish blue (CSS color):
     19footerbgcolor    = #B8B9F6
     20# Text color for the footer line: black (CSS color):
     21footertextcolor  = #000000
     22# Background color for the sidebar: light bluish gray (CSS color):
     23sidebarbgcolor   = #EAEAF8
     24# Text color for the sidebar: black (CSS color):
     25sidebartextcolor = #000000
     26# Link color for the sidebar: dark blue (CSS color):
     27sidebarlinkcolor = #090999
     28# Background color for the relation bar: pale, light grayish blue (CSS color):
     29relbarbgcolor    = #B8B9F6
     30# Text color for the relation bar: black (CSS color):
     31relbartextcolor  = #000000
     32# Link color for the relation bar: dark blue (CSS color):
     33relbarlinkcolor  = #090999
     34# Body background color (CSS color):
     35#bgcolor          = #ffffff
     36# Body text color: black (CSS color):
     37textcolor        = #000000
     38# Background color for headings: light bluish gray (CSS color):
     39headbgcolor      = #EAEAF8
     40# Text color for headings (CSS color):
     41#headtextcolor    = #20435c
     42# Link color for headings (CSS color):
     43#headlinkcolor    = #c60f0f
     44# Body link color: dark greenish blue (CSS color):
     45linkcolor        = #45529B
     46# Background color for code blocks: very pale yellow (CSS color):
     47codebgcolor      = #FFFFE5
     48# Default text color for code blocks, if not set differently by the highlighting style (CSS color):
     49#codetextcolor    = #333333
     50
     51# Font for normal text (CSS font-family):
     52#bodyfont = sans-serif
     53# Font for headings (CSS font-family):
     54#headfont = 'Trebuchet MS', sans-serif
  • doc/en/reference/arithgroup/index.rst

    diff --git a/doc/en/reference/arithgroup/index.rst b/doc/en/reference/arithgroup/index.rst
    a b  
    1 Arithmetic Subgroups of `{\rm SL}_2(\ZZ)`
    2 ================================================
     1Arithmetic Subgroups of `{\rm SL}_2({\bf Z})`
     2=============================================
    33
    44This chapter describes the basic functionality for finite index subgroups of
    55the modular group `{\rm SL}_2(\ZZ)`.
  • doc/en/reference/conf.py

    diff --git a/doc/en/reference/conf.py b/doc/en/reference/conf.py
    a b  
    1515sys.path.append(os.environ['SAGE_DOC'])
    1616from common.conf import *
    1717
     18# settings for the intersphinx extension:
     19
     20ref_src = os.path.join(SAGE_DOC, 'en', 'reference')
     21ref_out = os.path.join(SAGE_DOC, 'output', 'html', 'en', 'reference')
     22intersphinx_mapping[ref_out] = None
     23
     24for doc in os.listdir(ref_src):
     25    if os.path.exists(os.path.join(ref_src, doc, 'index.rst')):
     26        intersphinx_mapping[os.path.join(ref_out, doc)] = None
     27
    1828# General information about the project.
    1929project = u"Sage Reference Manual"
    2030name = "reference"
     
    5060
    5161#Ignore all .rst in the _sage subdirectory
    5262exclude_trees = exclude_trees + ['_sage']
     63
     64# List of directories, relative to source directory, that shouldn't be
     65# searched for source files.
     66exclude_trees = exclude_trees + [
     67    'algebras',
     68    'arithgroup',
     69    'calculus',
     70    'categories',
     71    'cmd',
     72    'coding',
     73    'coercion',
     74    'combinat',
     75    'constants',
     76    'cryptography',
     77    'databases',
     78    'finance',
     79    'finite_rings',
     80    'function_fields',
     81    'functions',
     82    'games',
     83    'geometry',
     84    'graphs',
     85    'groups',
     86    'hecke',
     87    'history_and_license',
     88    'homology',
     89    'interfaces',
     90    'lfunctions',
     91    'libs',
     92    'logic',
     93    'matrices',
     94    'misc',
     95    'modabvar',
     96    'modfrm',
     97    'modmisc',
     98    'modsym',
     99    'modules',
     100    'monoids',
     101    'notebook',
     102    'number_fields',
     103    'numerical',
     104    'options',
     105    'padics',
     106    'parallel',
     107    'plane_curves',
     108    'plot3d',
     109    'plotting',
     110    'polynomial_rings',
     111    'power_series',
     112    'probability',
     113    'quadratic_forms',
     114    'quat_algebras',
     115    'rings',
     116    'rings_numerical',
     117    'rings_standard',
     118    'sage',
     119    'sagenb',
     120    'schemes',
     121    'semirings',
     122    'stats',
     123    'structure',
     124    'tensor',
     125    'todolist'
     126    ]
  • new file doc/en/reference/conf_sub.py

    diff --git a/doc/en/reference/conf_sub.py b/doc/en/reference/conf_sub.py
    new file mode 100644
    - +  
     1# -*- coding: utf-8 -*-
     2#
     3# Sage documentation build configuration file, created by
     4# sphinx-quickstart on Thu Aug 21 20:15:55 2008.
     5#
     6# This file is execfile()d with the current directory set to its containing dir.
     7#
     8# The contents of this file are pickled, so don't put values in the namespace
     9# that aren't pickleable (module imports are okay, they're removed automatically).
     10#
     11# All configuration values have a default; values that are commented out
     12# serve to show the default.
     13
     14import sys, os
     15sys.path.append(os.environ['SAGE_DOC'])
     16from common.conf import *
     17
     18# settings for the intersphinx extension:
     19
     20ref_src = os.path.join(SAGE_DOC, 'en', 'reference')
     21ref_out = os.path.join(SAGE_DOC, 'output', 'html', 'en', 'reference')
     22intersphinx_mapping[ref_out] = None
     23
     24for doc in os.listdir(ref_src):
     25    if os.path.exists(os.path.join(ref_src, doc, 'index.rst')):
     26        intersphinx_mapping[os.path.join(ref_out, doc)] = None
     27
     28# We use the main document's title, if we can find it.
     29rst_file = open('index.rst', 'r')
     30rst_lines = rst_file.read().splitlines()
     31rst_file.close()
     32
     33title = u''
     34for i in xrange(len(rst_lines)):
     35    if rst_lines[i].startswith('==') and i > 0:
     36        title = rst_lines[i-1].strip()
     37        break
     38
     39# Otherwise, we use this directory's name.
     40name = os.path.basename(os.path.abspath('.'))
     41if not title:
     42    title = name.capitalize()
     43title = title.replace(u'`', u'$')
     44
     45# General information about the project.
     46project = u'Sage Reference Manual: ' + title
     47
     48# The name for this set of Sphinx documents.  If None, it defaults to
     49# "<project> v<release> documentation".
     50html_title = u'Sage Reference Manual v' + release + ': ' + title
     51
     52# A shorter title for the navigation bar.  Default is the same as html_title.
     53html_short_title = title
     54
     55# HTML theme (e.g., 'default', 'sphinxdoc').  The pages for the
     56# reference manual use a custom theme, a slight variant on the 'sage'
     57# theme, to set the links in the top line.
     58html_theme = 'sageref'
     59
     60# Output file base name for HTML help builder.
     61htmlhelp_basename = name
     62
     63# Grouping the document tree into LaTeX files. List of tuples (source
     64# start file, target name, title, author, document class
     65# [howto/manual]).
     66latex_documents = [
     67('index', name + '.tex', project, u'The Sage Development Team', 'manual')
     68]
     69
     70#Ignore all .rst in the _sage subdirectory
     71exclude_trees = exclude_trees + ['_sage']
  • new file doc/en/reference/footer.txt

    diff --git a/doc/en/reference/footer.txt b/doc/en/reference/footer.txt
    new file mode 100644
    - +  
     1
     2.. todolist::
     3
     4Indices and Tables
     5==================
     6
     7.. toctree::
     8   :maxdepth: 1
     9
     10* :ref:`genindex`
     11* :ref:`modindex`
     12* :ref:`search`
  • doc/en/reference/games/index.rst

    diff --git a/doc/en/reference/games/index.rst b/doc/en/reference/games/index.rst
    a b  
    22=====
    33
    44Sage includes a sophisticated Sudoku solver.  It also has a
    5 Rubik's cube solver (see :ref:`Rubik's Cube Group <sec-rubik>`).
     5Rubik's cube solver (see
     6`Rubik's Cube Group <../groups/sage/groups/perm_gps/cubegroup.html>`_).
    67
    78.. toctree::
    89   :maxdepth: 2
  • doc/en/reference/hecke/index.rst

    diff --git a/doc/en/reference/hecke/index.rst b/doc/en/reference/hecke/index.rst
    a b  
    33
    44This chapter describes the basic functionality for modules over Hecke
    55algebras, including decompositions, degeneracy maps and so on. For specific
    6 examples of Hecke algebras that use this functionality see :ref:`ch:modsym` and
    7 :ref:`ch:modular`.
     6examples of Hecke algebras that use this functionality see `Modular
     7Symbols <../modsym/index.html>`_ and `Modular Forms
     8<../modfrm/index.html>`_.
    89
    910.. toctree::
    1011   :maxdepth: 2
  • doc/en/reference/index.rst

    diff --git a/doc/en/reference/index.rst b/doc/en/reference/index.rst
    a b  
    1 .. Sage Reference Manual documentation master file, created by sphinx-quickstart on Sun Sep 28 03:34:37 2008.
    2    You can adapt this file completely to your liking, but it should at least
    3    contain the root `toctree` directive.
    4 
    5 .. _ch:intro:
    6 
    71Welcome to Sage's Reference Manual!
    82=================================================
    93
     
    2014Sage, and should produce exactly the same output as in this manual,
    2115except for line breaks.
    2216
    23 The Sage command line is briefly described in :ref:`ch:cmdline`, which
    24 lists the command line options. For more details about the command
    25 line, see the Sage tutorial.
     17The Sage command line is briefly described in `The Sage Command Line
     18<cmd/index.html>`_, which lists the command line options. For more
     19details about the command line, see the Sage tutorial.
    2620
    27 The Sage graphical user interface is described in
    28 :ref:`ch:notebook`. This graphical user interface is unusual in that
    29 it operates via your web browser. It provides you with Sage worksheets
    30 that you can edit and evaluate, which contain scalable typeset
    31 mathematics and beautiful antialiased images.
     21The Sage graphical user interface is described in `The Sage Notebook
     22<notebook/index.html>`_. This graphical user interface is unusual in
     23that it operates via your web browser. It provides you with Sage
     24worksheets that you can edit and evaluate, which contain scalable
     25typeset mathematics and beautiful antialiased images.
    3226
    3327This work is licensed under a `Creative Commons Attribution-Share Alike
    34283.0 License`__.
     
    3731
    3832Enjoy Sage!
    3933
    40 .. toctree::
    41    :maxdepth: 2
     34Table of Contents
     35=================
    4236
    43    cmd
    44    notebook
    45    calculus
    46    plotting
    47    plot3d
    48    games
    49    graphs
    50    constants
    51    functions
    52    parallel
    53    structure
    54    coercion
    55    misc
    56    databases
    57    interfaces
    58    libs
    59    cryptography
    60    logic
    61    sat
    62    combinat/index
    63    numerical
    64    probability
    65    stats
    66    finance
    67    categories
    68    monoids
    69    groups
    70    rings
    71    rings_standard
    72    rings_numerical
    73    finite_rings
    74    number_fields
    75    function_fields
    76    padics
    77    polynomial_rings
    78    power_series
    79    semirings
    80    algebras
    81    quadratic_forms
    82    quat_algebras
    83    matrices
    84    modules
    85    geometry
    86    homology
    87    lfunctions
    88    schemes
    89    plane_curves
    90    coding
    91    arithgroup
    92    hecke
    93    modsym
    94    modfrm
    95    modabvar
    96    modmisc
    97    tensor
     37   * `The Sage Command Line <cmd/index.html>`_
     38   * `The Sage Notebook <notebook/index.html>`_
     39 
     40Calculus, Plotting
     41------------------
     42 
     43   * `Symbolic Calculus <calculus/index.html>`_
     44   * `Constants <constants/index.html>`_
     45   * `Functions <functions/index.html>`_
     46   * `2D Graphics <plotting/index.html>`_
     47   * `3D Graphics <plot3d/index.html>`_
     48 
     49Combinatorics, Discrete Mathematics
     50-----------------------------------
     51 
     52   * `Combinatorics <combinat/index.html>`_
     53   * `Graph Theory <graphs/index.html>`_
     54 
     55Structures, Coercion, Categories
     56--------------------------------
     57 
     58   * `Basic Structures <structure/index.html>`_
     59   * `Coercion <coercion/index.html>`_
     60   * `Category Theory and Categories <categories/index.html>`_
     61 
     62Rings, Fields, Algebras
     63-----------------------
     64 
     65   * `General Rings, Ideals, and Morphisms <rings/index.html>`_
     66   * `Standard Commutative Rings <rings_standard/index.html>`_
     67   * `Fixed and Arbitrary Precision Numerical Fields <rings_numerical/index.html>`_
     68   * `Finite Rings <finite_rings/index.html>`_
     69   * `Algebraic Number Fields <number_fields/index.html>`_
     70   * `Function Fields <function_fields/index.html>`_
     71   * `p-Adics <padics/index.html>`_
     72   * `Polynomial Rings <polynomial_rings/index.html>`_
     73   * `Power Series Rings <power_series/index.html>`_
     74   * `Standard Semirings <semirings/index.html>`_
     75   * `Algebras <algebras/index.html>`_
     76   * `Quaternion Algebras <quat_algebras/index.html>`_
     77 
     78Groups, Monoids, Matrices, Modules
     79----------------------------------
     80 
     81   * `Groups <groups/index.html>`_
     82   * `Monoids <monoids/index.html>`_
     83   * `Matrices and Spaces of Matrices <matrices/index.html>`_
     84   * `Modules <modules/index.html>`_
    9885
    99    todolist
     86Geometry and Topology
     87---------------------
    10088
    101    history_and_license
     89   * `Combinatorial Geometry <geometry/index.html>`_
     90   * `Cell Complexes and their Homology <homology/index.html>`_
     91   * `Differential Forms <tensor/index.html>`_
    10292
    103 Indices and tables
    104 ==================
     93Number Theory, Algebraic Geometry
     94---------------------------------
    10595
    106 * :ref:`genindex`
    107 * :ref:`modindex`
    108 * :ref:`search`
     96   * `Quadratic Forms <quadratic_forms/index.html>`_
     97   * `L-Functions <lfunctions/index.html>`_
     98   * `Schemes <schemes/index.html>`_
     99   * `Elliptic, Plane, and Hyperelliptic Curves <plane_curves/index.html>`_
     100   * `Arithmetic Subgroups of SL_2(Z) <arithgroup/index.html>`_
     101   * `General Hecke Algebras and Hecke Modules <hecke/index.html>`_
     102   * `Modular Symbols <modsym/index.html>`_
     103   * `Modular Forms <modfrm/index.html>`_
     104   * `Modular Abelian Varieties <modabvar/index.html>`_
     105   * `Miscellaneous Modular-Form-Related Modules <modmisc/index.html>`_
    109106
     107Miscellaneous Mathematics
     108-------------------------
     109
     110   * `Games <games/index.html>`_
     111   * `Symbolic Logic <logic/index.html>`_
     112   * `SAT solvers <sat/index.html>`_
     113   * `Cryptography <cryptography/index.html>`_
     114   * `Numerical Optimization <numerical/index.html>`_
     115   * `Probability <probability/index.html>`_
     116   * `Statistics <stats/index.html>`_
     117   * `Quantitative Finance <finance/index.html>`_
     118   * `Coding Theory <coding/index.html>`_
     119
     120Interfaces, Databases, Miscellany
     121---------------------------------
     122
     123   * `Interpreter Interfaces <interfaces/index.html>`_
     124   * `C/C++ Library Interfaces <libs/index.html>`_
     125   * `Databases <databases/index.html>`_
     126   * `Parallel Computing <parallel/index.html>`_
     127   * `Miscellaneous <misc/index.html>`_
     128
     129Other
     130-----
     131
     132   * `Sage's To Do List <todolist/index.html>`_
     133   * `History and License <history_and_license/index.html>`_
     134
     135.. include:: footer.txt
  • doc/en/reference/interfaces/index.rst

    diff --git a/doc/en/reference/interfaces/index.rst b/doc/en/reference/interfaces/index.rst
    a b  
    33
    44Sage provides a unified interface to the best computational
    55software. This is accomplished using both C-libraries (see
    6 :ref:`ch:libraries`) and interpreter interfaces, which are
     6`C/C++ Library Interfaces <../libs/index.html>`_)
     7and interpreter interfaces, which are
    78implemented using pseudo-tty's, system files, etc. This chapter is
    89about these interpreter interfaces.
    910
     
    1819    There is overhead associated with each call to one of these
    1920    systems. For example, computing ``2+2`` thousands of times using
    2021    the GAP interface will be slower than doing it directly in
    21     Sage. In contrast, the C-library interfaces of :ref:`ch:libraries`
     22    Sage. In contrast, the C-library interfaces of
     23    `C/C++ Library Interfaces <../libs/index.html>`_
    2224    incur less overhead.
    2325
    2426
  • doc/en/reference/misc/index.rst

    diff --git a/doc/en/reference/misc/index.rst b/doc/en/reference/misc/index.rst
    a b  
    5656.. toctree::
    5757   :maxdepth: 2
    5858
    59    other/sagetex
     59   sagetex
    6060   sage/misc/latex
    6161   sage/misc/latex_macros
    6262
  • doc/en/reference/todolist.rst

    diff --git a/doc/en/reference/todolist.rst b/doc/en/reference/todolist.rst
    a b  
    1515        Rewrite the hand-written TODOs by using the correct ``.. todo::``
    1616        markup.
    1717
     18The combined to do list is only available in the html version of the reference manual.
     19
    1820.. todolist::
  • doc/en/website/templates/index.html

    diff --git a/doc/en/website/templates/index.html b/doc/en/website/templates/index.html
    a b  
    137137        <a class="biglink" href="reference/index.html">
    138138          Reference Manual
    139139        </a>
    140         <a title="Download PDF" class="pdf" href="../../pdf/en/reference/reference.pdf">
     140        <a title="Link to PDF" class="pdf" href="../../pdf/en/reference/index.html">
    141141          <img class="icon" src="_static/pdf.png"></img>
    142142        </a>
    143143        <br>
  • sage/combinat/tutorial.py

    diff --git a/sage/combinat/tutorial.py b/sage/combinat/tutorial.py
    a b  
    209209
    210210.. _figure-examples-catalan-trees:
    211211
    212 .. figure:: ../../media/combinat/complete-binary-trees-4.png
     212.. figure:: ../../media/complete-binary-trees-4.png
    213213    :scale: 150 %
    214214
    215215    Figure: The five complete binary trees with four leaves
     
    866866
    867867    sage: C.unrank(20).plot()
    868868
    869 .. image:: ../../media/combinat/a_poset.png
     869.. image:: ../../media/a_poset.png
    870870
    871871One can iterate through all graphs up to isomorphism. For example,
    872872there are 34 simple graphs with 5 vertices::
     
    878878
    879879    sage: show(graphs(5, lambda G: G.size() <= 4))
    880880
    881 .. image:: ../../media/combinat/graphs-5.png
     881.. image:: ../../media/graphs-5.png
    882882
    883883However, the *set* ``C`` of these graphs is not yet available in
    884884``Sage``; as a result, the following commands are not yet
     
    16091609
    16101610.. _figure-prefix-tree-partitions:
    16111611
    1612 .. figure:: ../../media/combinat/prefix-tree-partitions-5.png
     1612.. figure:: ../../media/prefix-tree-partitions-5.png
    16131613    :scale: 150%
    16141614
    16151615    Figure: The prefix tree of the partitions of 5.
     
    16741674
    16751675.. _figure-polytope:
    16761676
    1677 .. figure:: ../../media/combinat/polytope.png
     1677.. figure:: ../../media/polytope.png
    16781678    :scale: 75%
    16791679
    16801680    Figure: The polytope `L` and its integer points, in cross-eyed stereographic perspective.
     
    18401840the ones that are still canonical [4]_. Recursively, one obtains all
    18411841the canonical graphs.
    18421842
    1843 .. figure:: ../../media/combinat/prefix-tree-graphs-4.png
     1843.. figure:: ../../media/prefix-tree-graphs-4.png
    18441844
    18451845   Figure: The generation tree of simple graphs with `4` vertices.
    18461846
  • sage/graphs/base/static_sparse_graph.pyx

    diff --git a/sage/graphs/base/static_sparse_graph.pyx b/sage/graphs/base/static_sparse_graph.pyx
    a b  
    2424Data structure
    2525--------------
    2626
    27 .. image:: ../../../media/graphs/structure.png
     27.. image:: ../../../media/structure.png
    2828
    2929The data structure is actually pretty simple and compact. ``short_digraph`` has
    3030three fields
  • sage/graphs/graph_decompositions/graph_products.pyx

    diff --git a/sage/graphs/graph_decompositions/graph_products.pyx b/sage/graphs/graph_decompositions/graph_products.pyx
    a b  
    6464
    6565  A contradiction indeed.
    6666
    67   .. image:: ../../../media/graphs/cycle.png
     67  .. image:: ../../../media/cycle.png
    6868
    6969  That means that, for instance, the edges of a triangle necessarily have the
    7070  same color.
     
    7676  In this situation, opposed edges necessarily have the same colors because of
    7777  the previous remark.
    7878
    79   .. image:: ../../../media/graphs/square.png
     79  .. image:: ../../../media/square.png
    8080
    8181  **1st criterion** : As a corollary, we know that:
    8282
  • sage/graphs/graph_latex.py

    diff --git a/sage/graphs/graph_latex.py b/sage/graphs/graph_latex.py
    a b  
    1616LaTeX Versions of Graphs
    1717-------------------------------------
    1818
    19 .. image:: ../../media/graphs/heawood-graph-latex.png
     19.. image:: ../../media/heawood-graph-latex.png
    2020   :align: center
    2121
    2222Many mathematical objects in Sage have LaTeX representations, and graphs are no exception.  For a graph ``g``, the command ``view(g)``, issued at the Sage command line or in the notebook, will create a graphic version of ``g``.  Similarly, ``latex(g)`` will return a (long) string that is a representation of the graph in LaTeX.  Other ways of employing LaTeX in Sage, such as ``%latex`` in a notebook cell, or the Typeset checkbox in the notebook, will handle ``g`` appropriately.
  • sage/graphs/graph_plot.py

    diff --git a/sage/graphs/graph_plot.py b/sage/graphs/graph_plot.py
    a b  
    106106      settings from ``DEFAULT_SHOW_OPTIONS`` only affects ``G.show()``.
    107107
    108108    * In order to define a default value permanently, you can add a couple of
    109       lines to :doc:`Sage's startup scripts <../../startup>`. Example ::
     109      lines to `Sage's startup scripts <../../../cmd/startup.html>`_. Example ::
    110110
    111111       sage: import sage.graphs.graph_plot
    112112       sage: sage.graphs.graph_plot.DEFAULT_SHOW_OPTIONS['figsize'] = [4,4]
  • sage/homology/delta_complex.py

    diff --git a/sage/homology/delta_complex.py b/sage/homology/delta_complex.py
    a b  
    149149      first in the prescribed way.  The three edges each start and end
    150150      at the single vertex, ``Simplex(0)``.
    151151
    152       .. image:: ../../media/homology/torus_labelled.png
     152      .. image:: ../../media/torus_labelled.png
    153153
    154154    - ``data`` may be nested lists or tuples.  The nth entry in the
    155155      list is a list of the n-simplices in the complex, and each
     
    178178      If one draws two triangles and identifies them according to this
    179179      description, the result is the real projective plane.
    180180
    181       .. image:: ../../media/homology/rp2.png
     181      .. image:: ../../media/rp2.png
    182182
    183183      ::
    184184
     
    14831483        A `\Delta`-complex representation of the torus, consisting of one
    14841484        vertex, three edges, and two triangles.
    14851485
    1486         .. image:: ../../media/homology/torus.png
     1486        .. image:: ../../media/torus.png
    14871487
    14881488        EXAMPLES::
    14891489
     
    14971497        A `\Delta`-complex representation of the real projective plane,
    14981498        consisting of two vertices, three edges, and two triangles.
    14991499
    1500         .. image:: ../../media/homology/rp2.png
     1500        .. image:: ../../media/rp2.png
    15011501
    15021502        EXAMPLES::
    15031503
     
    15181518        A `\Delta`-complex representation of the Klein bottle, consisting
    15191519        of one vertex, three edges, and two triangles.
    15201520
    1521         .. image:: ../../media/homology/klein.png
     1521        .. image:: ../../media/klein.png
    15221522
    15231523        EXAMPLES::
    15241524
  • sage/homology/simplicial_complex.py

    diff --git a/sage/homology/simplicial_complex.py b/sage/homology/simplicial_complex.py
    a b  
    3434denote both the simplicial complex and the associated topological
    3535space.
    3636
    37 .. image:: ../../media/homology/simplices.png
     37.. image:: ../../media/simplices.png
    3838
    3939For any simplicial complex `K` and any commutative ring `R` there is
    4040an associated chain complex, with differential of degree `-1`.  The
  • sage/modular/arithgroup/farey_symbol.pyx

    diff --git a/sage/modular/arithgroup/farey_symbol.pyx b/sage/modular/arithgroup/farey_symbol.pyx
    a b  
    419419        Farey symbol of the arithmetic group. The sides of the
    420420        hyperbolic polygon are numbered 0, 1, ... from left to right.
    421421
    422         .. image:: ../../../media/modular/arithgroup/pairing.png
     422        .. image:: ../../../media/pairing.png
    423423
    424424        EXAMPLES::
    425425