Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RsT support in docstrings #1027

Draft
wants to merge 35 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a4478bb
* more docstrings and annotations
mmatera Feb 11, 2024
9f462e0
Update docpipeline.py
mmatera Mar 13, 2024
00ba03e
black
mmatera Mar 14, 2024
42c160a
removing trailing code
mmatera Mar 14, 2024
4f89b07
* more docstrings and annotations
mmatera Feb 11, 2024
5f17c0e
Update docpipeline.py
mmatera Mar 13, 2024
4674e20
split mathics.doc.common_doc
mmatera Mar 14, 2024
1c5e6fb
mathics.doc.doctests->mathics.doc.doc_entries and fix pytests
mmatera Mar 14, 2024
612a47a
DRY test_section_in_chapter. Include the tests in chapter.doc.
mmatera Mar 14, 2024
2ab499b
black
mmatera Mar 14, 2024
d86487f
restore docpipeline break with the parameter -x
mmatera Mar 14, 2024
4445a12
test chapters by name
mmatera Mar 14, 2024
00d74f6
more doctests
mmatera Mar 16, 2024
993c0ad
split common_doc
mmatera Mar 16, 2024
b3777f1
django compatibility
mmatera Mar 16, 2024
cd9bb92
issue with subsection_re
mmatera Mar 16, 2024
1f274e8
more moving code around
mmatera Mar 16, 2024
47be542
more
mmatera Mar 16, 2024
715eb6c
Merge branch 'master' into more_docpipeline_fixes
mmatera Mar 24, 2024
2f6eabb
black
mmatera Mar 25, 2024
3750d5f
Adding support for markdown notation in figures and references. This …
mmatera Mar 25, 2024
d3dba50
markdown_to_native after processing tests
mmatera Mar 26, 2024
ae20c96
rst parser
mmatera Mar 27, 2024
76a894b
docstring
mmatera Mar 27, 2024
7339c7d
removing prints
mmatera Mar 27, 2024
30c56a5
* more docstrings and annotations
mmatera Feb 11, 2024
d9f64fa
split mathics.doc.common_doc
mmatera Mar 14, 2024
36cc410
mathics.doc.doctests->mathics.doc.doc_entries and fix pytests
mmatera Mar 14, 2024
af690a7
DRY test_section_in_chapter. Include the tests in chapter.doc.
mmatera Mar 14, 2024
e31d807
split common_doc
mmatera Mar 16, 2024
cd0d92c
django compatibility
mmatera Mar 16, 2024
cb203ce
merging more_docpipeline_fixes_2_revert
mmatera Mar 30, 2024
ceb48c0
More docpipeline fixes 2 revert (#1028)
mmatera Mar 30, 2024
bbb19cd
merge
mmatera Mar 30, 2024
b0bb40c
Merge branch 'more_docpipeline_fixes' into RsT_urls
mmatera Mar 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mathics/builtin/atomic/numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ class Accuracy(Builtin):
<dd>examines the number of significant digits of $expr$ after the \
decimal point in the number x.
</dl>

<i>Notice that the result could be slightly different than the obtained \
in WMA, due to differencs in the internal representation of the real numbers.</i>

Expand Down
4 changes: 3 additions & 1 deletion mathics/builtin/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,9 @@ class RealValuedNumberQ(Builtin):
# No docstring since this is internal and it will mess up documentation.
# FIXME: Perhaps in future we will have a more explicite way to indicate not
# to add something to the docs.
no_doc = True
context = "Internal`"

summary_text = "test whether an expression is a real number"
rules = {
"Internal`RealValuedNumberQ[x_Real]": "True",
"Internal`RealValuedNumberQ[x_Integer]": "True",
Expand All @@ -639,6 +640,7 @@ class RealValuedNumericQ(Builtin):
# No docstring since this is internal and it will mess up documentation.
# FIXME: Perhaps in future we will have a more explicite way to indicate not
# to add something to the docs.
no_doc = True
context = "Internal`"

rules = {
Expand Down
29 changes: 25 additions & 4 deletions mathics/doc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
# -*- coding: utf-8 -*-
"""
Module for handling Mathics-style documentation.
A module and library that assists in organizing document data
located in static files and docstrings from
Mathics3 Builtin Modules. Builtin Modules are written in Python and
reside either in the Mathics3 core (mathics.builtin) or are packaged outside,
in Mathics3 Modules e.g. pymathics.natlang.

Right now this covers common LaTeX/PDF and routines common to
Mathics Django. When this code is moved out, perhaps it will
include the Mathics Django-specific piece.
This data is stored in a way that facilitates:
* organizing information to produce a LaTeX file
* running documentation tests
* producing HTML-based documentation

The command-line utility ``docpipeline.py``, loads the data from
Python modules and static files, accesses the functions here.

Mathics Django also uses this library for its HTML-based documentation.

The Mathics3 builtin function ``Information[]`` also uses to provide the
information it reports.
As with reading in data, final assembly to a LaTeX file or running
documentation tests is done elsewhere.

FIXME: This code should be replaced by Sphinx and autodoc.
Things are such a mess, that it is too difficult to contemplate this right now.
Also there higher-priority flaws that are more more pressing.
In the shorter, we might we move code for extracting printing to a
separate package.
"""
Loading