Replies: 2 comments 22 replies
-
Guides in WRWR is a quite sophisticated documentation structure, which has different kinds of entries. Some of the main kinds of entries are:
The format is hypermedia and not hierarchic: two guides can include links to the same symbols, and there is no organization in chapters/ sections/ subsections. This scheme is OK for an online documentation system, but probably not for a book. Proposal to translate this to the Mathics Documentation SystemA way to translate this to our documentation system would be
With this pattern, each DocEntry appears exactly once. Thoughts? |
Beta Was this translation helpful? Give feedback.
-
Sphinx and readthedocs compatibilityAnother possible improvement to the documentation system would be to use more standard syntax like CommonMarkdown or reStructuredText. Using a more standard notation would be helpful to replace the homebrew parser, based on Python regex, with another existing parser library. My first impulse was to consider Markdown, because of its simpler syntax, but @rocky has a point when he proposes using RsT, which has a more precise syntax and plays better with Sphinx, and seems to be the current standard. #1026 provides support for some basic notation like links, images, and code blocks in common Markdown. When I have another chunk of time, I will try to do the same to support RsT.
|
Beta Was this translation helpful? Give feedback.
-
Now that mathics-core works again without issues in the CI, I continued working on the documentation system.
Among the pending tasks
mathics.doc
andmathics.docpipeline
.mathics.doc.common_doc
in a part related to the organization of the code, and a partrelated to parsing the documentation entries and organizing the doctests.
... (add other items that you think must be present in this list )
Today I think made some progress in the first of these points
#1021 addresses a. to d.
#1022 addresses partially e. and f.
#1025 goes further in c., g., h. and i.
In order to continue with this task, I think we need to discuss some details about the structure of the documentation. I will try to start the discussion here.
Guide Sections and builtin packages
Several of the "FIXME" comments inside the code of the documentation system are related to the way in which we are handiling packages (subfolders) inside
mathics.builtin
and pymathics modules. In the current code, each file and folder insidemathics.builtin
andpymathics
modules are mapped to "chapters" inside a part ("Reference of Built-in Symbols" and "Mathics3 Modules" respectively).For files inside these modules, the module docstring is used as the introduction to the chapter, which is followed by a Chapter index and a set of sections corresponding to each builtin symbol defined in the module.
For packages inside the top-level modules, the docstring in the
__init__.py
file is used to generate the introductory text of the chapter, which containsa "guide section" and "sections". The "guide section" starts with a documentation chunk containing exactly the same than the chapter introduction,
and "subsections", which maps the list of sub-modules. A the level of the chapter, after the "guide section" we find (regular) "sections", with are in correspondece with the submodules. The (regular) sections under a chapter have an initial text, built from the sub-module docstring, and "subsections" comming from the symbols defined inside the corresponding submodule.
To make this galimatias more clear, let's see two examples.
mathics.builtin.procedure
(a single file module) we producemathics.builtin.colors
Notice that with the current organization,
Black
and symbolBreak
are shown in different formats.These inconsistencies both in the structure and in the formatting of the documentation must be removed in order to make the code simpler, and the documentation more readable and compatible with other documentation systems.
Beta Was this translation helpful? Give feedback.
All reactions