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

Go over the documentation of the documentation system #982

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

mmatera
Copy link
Contributor

@mmatera mmatera commented Jan 31, 2024

This PR is mainly about clarifying the code in the documentation system

  • sort classes and functions in mathics.doc.common according to the order in doc-code-revision (and as in Fix gather tests and start adding pytests #981)
  • adding docstrings
  • changing some names of classes and functions to be more explicit about their role in the system
  • adding Pytests for the documentation system.
  • fix a typo (section ->section_all) in mathics.doc.latex_doc to allow load the GuideSections in the LaTeX documentation.
  • fix an indentation error in the former gather_tests function previously reported in Fix gather tests and start adding pytests #981.

 * sort classes and functions in mathics.doc.common according to the order in doc-code-revision
 * adding docstrings
 * changing some names of classes and functions to be more explicit about the role in the system
 * adding pytest.
 * fix a typo (section ->section_all) in mathics.doc.latex_doc  to allow load the GuideSections in the
   LaTeX documentation

# If the last block in the loop was not a Text block, append the
# last set of tests.
if tests is not None:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is one of the "active" changes.

@@ -774,7 +783,7 @@ def latex(self, doc_data: dict, quiet=False, filter_sections=None) -> str:
"\\chaptersections\n",
"\n\n".join(
section.latex(doc_data, quiet)
for section in sorted(self.sections)
for section in sorted(self.all_sections)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the other "active" change.

self.section, self.tests = section, doctests


# Note mmatera: I am confuse about this change of order in which the classes
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I follow the order in #981 to make the comparisons easier.

mmatera and others added 2 commits January 31, 2024 13:02
Some docstring corrections/elaborations, change few comments, some
spelling corrections and some lint.
@rocky
Copy link
Member

rocky commented Jan 31, 2024

LGTM - let's merge and iterate.

@rocky rocky merged commit 74436f1 into master Jan 31, 2024
11 checks passed
@rocky rocky deleted the doc-code-revision-0order branch January 31, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants