Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge #32181
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Aug 5, 2022
2 parents 5f60c49 + 1ef7dd1 commit a856e5d
Show file tree
Hide file tree
Showing 20 changed files with 897 additions and 229 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ jobs:

- name: Prepare
run: |
# Reuse built SAGE_LOCAL contained in the Docker image
# Reuse built SAGE_LOCAL contained in the Docker image
./bootstrap
./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv --enable-download-from-upstream-url
make furo
- name: Build
run: make doc-html
Expand Down
4 changes: 4 additions & 0 deletions src/doc/common/static/custom-furo.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
span.sidebar-brand-text {
font-size: small;
text-align: center;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions src/doc/common/templates-furo/search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{#-
The search page template modified from theme/basic/search.html
-#}
{% extends "page.html" %}

{%- block regular_scripts -%}
{{ super() }}
<script src="{{ pathto('_static/searchtools.js', 1) }}"></script>
<script src="{{ pathto('_static/language_data.js', 1) }}"></script>
{%- endblock regular_scripts-%}

{%- block htmltitle -%}
<title>{{ _("Search") }} - {{ docstitle }}</title>
{%- endblock htmltitle -%}

{% block scripts -%}
{{ super() }}
<script src="{{ pathto('searchindex.js', 1) }}"></script>
{%- endblock scripts %}

{% block content %}
<h1 id="search-documentation">{{ _('Search') }}</h1>
{% block scriptwarning %}
<noscript>
<div class="admonition warning">
<p>
{% trans %}Please activate JavaScript to enable the search
functionality.{% endtrans %}
</p>
</div>
</noscript>
{% endblock %}
{% block searchtext %}
<p>
{% trans %}Searching for multiple words only shows matches that contain
all words.{% endtrans %}
</p>
<p>
{% trans %}Note also that you can also call "search_src(...)"
in Sage to search Sage's source code.{% endtrans %}
</p>
{% endblock %}
{% block searchbox %}
<form action="" method="get">
<input type="text" name="q" aria-labelledby="search-documentation" value="" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="{{ _('search') }}" />
<span id="search-progress" style="padding-left: 10px"></span>
</form>
{% endblock %}
{% block searchresults %}
{% if search_performed %}
<h2>{{ _('Search Results') }}</h2>
{% if not search_results %}
<p>{{ _('Your search did not match any documents.') }}</p>
{% endif %}
{% endif %}
<div id="search-results">
{% if search_results %}
<ul>
{% for href, caption, context in search_results %}
<li><a href="{{ pathto(item.href) }}">{{ caption }}</a>
<div class="context">{{ context|e }}</div>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endblock %}
{% endblock %}

21 changes: 21 additions & 0 deletions src/doc/common/templates-furo/sidebar/brand.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{#-
The sidebar brand template modified from theme/furo/sidebar/brand.html
-#}
<a class="sidebar-brand{% if logo %} centered{% endif %}" href="{% if refsub %}{{ reference_root }}{% else %}{{ documentation_root }}{% endif %}">
{% block brand_content %}
{%- if logo_url %}
<div class="sidebar-logo-container">
<img class="sidebar-logo" src="{{ logo_url }}" alt="Logo"/>
</div>
{%- endif %}
{%- if theme_light_logo and theme_dark_logo %}
<div class="sidebar-logo-container">
<img class="sidebar-logo only-light" src="{{ pathto('_static/' + theme_light_logo, 1) }}" alt="Light Logo"/>
<img class="sidebar-logo only-dark" src="{{ pathto('_static/' + theme_dark_logo, 1) }}" alt="Dark Logo"/>
</div>
{%- endif %}
{% if not theme_sidebar_hide_name %}
<span class="sidebar-brand-text">{% if refsub %}{{ reference_title }}{% else %}{{ documentation_title }}{% endif %}</span>
{%- endif %}
{% endblock brand_content %}
</a>
2 changes: 1 addition & 1 deletion src/doc/en/reference/categories/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Introduction
.. toctree::
:maxdepth: 2

sage/categories
sage/categories/all

The Sage Category Framework
---------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/website/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
# Hence some template context variables such as 'title' are not provided to
# this "additional" index.html.
html_additional_pages = {
'index': 'index.html',
'index': 'index_furo.html' if html_theme == 'furo' else 'index.html',
}

225 changes: 225 additions & 0 deletions src/doc/en/website/templates/index_furo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
{% extends "furo/page.html" %}

{% block htmltitle %}
<title>Sage Documentation{{ titlesuffix }}</title>
{% endblock %}

{%- block extrahead %}
<style type="text/css">
img.icon {
border: none;
}
a.pdf {
margin-left: 0.5em;
{%- if hide_pdf_links %}
display: none;
{%- endif %}
}
table.contentstable {
align: center;
border-spacing: 20px;
}
table.contentstable span { {# trac #33600 comment:22 #}
border-spacing: initial;
}
</style>
{% endblock %}

{% block content %}
<h1>{{ docstitle|e }}</h1>
<p>
This is documentation for Sage {{ release }}.
Documentations in other languages are available <a href="../../index.html">here</a>.
</p>
{% block tables %}
<h2>
<strong>
Tutorials and FAQ
</strong>
</h2>
<table class="contentstable">
<tr valign="top">
<td width="50%">
<p class="biglink">
<a class="biglink" href="a_tour_of_sage/index.html">
A Tour of Sage
</a>
<a title="Download PDF" class="pdf" href="../../pdf/en/a_tour_of_sage/a_tour_of_sage.pdf">
<img class="icon" src="_static/pdf.png"></img>
</a>
<br>
<span class="linkdescr">
This is a tour of Sage that closely follows the tour of
Mathematica that is at the beginning of the Mathematica
Book.
</span>
</p>
</td>
<td width="50%">
<p class="biglink">
<a class="biglink" href="prep/index.html">
PREP Tutorials
</a>
<a title="Download PDF" class="pdf" href="../../pdf/en/prep/prep_tutorials.pdf">
<img class="icon" src="_static/pdf.png"></img>
</a>
<br>
<span class="linkdescr">
This set of tutorials takes the reader from very minimal
computer background to a good understanding of basic
undergraduate Sage functionality. It includes several
thematic "Quickstart" tutorials, and was originally
developed as professional development material for the MAA.
</span>
</p>
</td>
</tr>
<tr valign="top">
<td width="50%">
<p class="biglink">
<a class="biglink" href="tutorial/index.html">
Tutorial
</a>
<a title="Download PDF" class="pdf" href="../../pdf/en/tutorial/sage_tutorial.pdf">
<img class="icon" src="_static/pdf.png"></img>
</a>
<br>
<span class="linkdescr">
This tutorial is the best way to become familiar with Sage
in only a few hours.
</span>
</p>
</td>
<td width="50%">
<p class="biglink">
<a class="biglink" href="constructions/index.html">
Constructions
</a>
<a title="Download PDF" class="pdf" href="../../pdf/en/constructions/constructions.pdf">
<img class="icon" src="_static/pdf.png"></img>
</a>
<br>
<span class="linkdescr">
This document collects answers to some questions along the line "How
do I construct ... in Sage?" Try to find out how to see the Riemann zeta
function \(\zeta(s)\) along the line \(s=\frac{1}{2}+it\).
</span>
</p>
</td>
</tr>
<tr valign="top">
<td width="50%">
<p class="biglink">
<a class="biglink" href="thematic_tutorials/index.html">
Thematic Tutorials
</a>
<a title="Download PDF" class="pdf" href="../../pdf/en/thematic_tutorials/thematic_tutorials.pdf">
<img class="icon" src="_static/pdf.png"></img>
</a>
<br>
<span class="linkdescr">
A collection of in-depth tutorials on specific topics. These
thematic tutorials are designed to help you get started on
Sage functionalities relating to topics such as coding
theory, combinatorics, cryptography, functional programming,
group theory, linear programming, etc. If you feel
uncomfortable consulting the reference manual, you are
encouraged to browse through these thematic tutorials.
</span>
</p>
</td>
<td width="50%">
<p class="biglink">
<a class="biglink" href="faq/index.html">
FAQ
</a>
<a title="Download PDF" class="pdf" href="../../pdf/en/faq/faq.pdf">
<img class="icon" src="_static/pdf.png"></img>
</a>
<br>
<span class="linkdescr">
A collection of frequently asked questions, together with
answers to those questions. You are encouraged to read these
before asking questions on one of many Sage mailing lists.
</span>
</p>
</td>
</tr>
</table>
<h2>
<strong>
Comprehensive Reference Manual
</strong>
</h2>
<table class="contentstable" align="center" cellspacing="20">
<tr valign="top">
<td width="50%">
<p class="biglink">
<a class="biglink" href="reference/index.html">
Reference Manual
</a>
<a title="Link to PDF" class="pdf" href="../../pdf/en/reference/index.html">
<img class="icon" src="_static/pdf.png"></img>
</a>
<br>
<span class="linkdescr">
This is the reference manual for the Sage mathematics
software system. The reference manual contains many examples
that illustrate the usage of Sage. It consists primarily of
documentation that has been automatically generated from the
Sage source code. The examples are all tested with each
release of Sage, and should produce exactly the same output
as in this manual, except for line breaks.
</span>
</p>
</td>
<td width="50%">
</td>
</tr>
</table>
<h2>
<strong>
Installation and Developer Guides
</strong>
</h2>
<table class="contentstable" align="center" cellspacing="20">
<tr valign="top">
<td width="50%">
<p class="biglink">
<a class="biglink" href="installation/index.html">
Installation Guide
</a>
<a title="Download PDF" class="pdf" href="../../pdf/en/installation/installation.pdf">
<img class="icon" src="_static/pdf.png"></img>
</a>
<br>
<span class="linkdescr">
A guide on how to install Sage. You can install a Sage
source distribution or a binary distribution. Also covered
are topics relating to a system-wide installation of Sage,
and installing Sage for your own personal use.
</span>
</p>
</td>
<td width="50%">
<p class="biglink">
<a class="biglink" href="developer/index.html">
Developer's Guide
</a>
<a title="Download PDF" class="pdf" href="../../pdf/en/developer/developer.pdf">
<img class="icon" src="_static/pdf.png"></img>
</a>
<br>
<span class="linkdescr">
This document describes guidelines and policies regarding
Sage development. It explains how to write programs using Sage,
how to modify and extend the core Sage libraries, and how to
modify Sage's documentation. It also discusses how to share
your new and modified code with other Sage users.
</span>
</p>
</td>
</tr>
</table>
{% endblock %}
{% endblock %}
5 changes: 1 addition & 4 deletions src/sage/categories/primer.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
r"""
Elements, parents, and categories in Sage: a (draft of) primer
.. contents::
:depth: 2
Elements, parents, and categories in Sage: a primer
Abstract
========
Expand Down
8 changes: 5 additions & 3 deletions src/sage/categories/tutorial.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
r"""
Implementing a new parent: a (draft of) tutorial
Implementing a new parent: a tutorial
The easiest approach for implementing a new parent is to start from a
Expand Down Expand Up @@ -50,7 +50,9 @@
extra functionalities available there? Implement iteration and
cardinality.
TODO: the tutorial should explain there how to reuse the enumerated
set of subsets, and endow it with more structure.
.. TODO::
The tutorial should explain there how to reuse the enumerated
set of subsets, and endow it with more structure.
"""
Loading

0 comments on commit a856e5d

Please sign in to comment.