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

Doc code revision order1 #986

Merged
merged 2 commits into from
Feb 2, 2024
Merged

Doc code revision order1 #986

merged 2 commits into from
Feb 2, 2024

Conversation

mmatera
Copy link
Contributor

@mmatera mmatera commented Feb 1, 2024

Another round of incremental changes. This branch requires small tweaks in mathics-django to keep compatibility (just about the names of certain properties in the documentation classes)

  • Start adding pytests for LaTeX documentation.
  • Fix mathics.doc.Documentation class, which seems to be mixed and smashed with the DocChapter class in an old merge.
  • Split the part of the code associated with mathics.doc.Documentation which does not depend on the mathics.builtin code, which was moved to mathics.doc.MathicsMainDocumentation.
  • Small tweaks and reorganization to make the code closer to the @rocky's branch doc-code-revision.
  • Classes that are not used like LaTeXDocumentation were removed.
  • Tweaks to make the LaTeX documentation to compile

@mmatera
Copy link
Contributor Author

mmatera commented Feb 1, 2024

Mathics3/mathics-django#201 is needed in Mathics-Django to keep the compatibility

@@ -67,4 +67,3 @@ is now being repeated.
Yours very truly,
A. Einstein
(Albert Einstein)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These files where modified automatically by the new pre-commit script...

@@ -594,79 +596,15 @@ def latex(self, doc_data: dict) -> str:
return text


class LaTeXDocumentation(Documentation):
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 class was never used. The class that we use along the code is LaTeXMathicsDocumentation.

@mmatera mmatera force-pushed the doc-code-revision-order1 branch from adb6371 to 75bd82e Compare February 2, 2024 14:16
latex_test

temporal fixing for utf8 issues in compiling the documentation

more tests. catch duplicated entries in DocGuideSections
@mmatera mmatera force-pushed the doc-code-revision-order1 branch from a5da249 to 1a681d8 Compare February 2, 2024 19:56
@@ -48,3 +48,11 @@ sed -i -e "s/°/\\\\degree{}/g" documentation.tex
# from Properties in a Section heading.
# TODO: figure out how to fix that bug.
sed -i -e "s/Propertie\\\\/Properties\\\\/g" documentation.tex

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 fixes almost all the errors that prevent that mathics.tex from compiling.

Copy link
Member

Choose a reason for hiding this comment

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

Note though that for release we need the reorganization started in #984 which is what motivated all of this refactoring.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know, and I am trying to go in that direction, trying to work over something that works.

@@ -446,8 +446,9 @@ class PythonCProfileEvaluation(Builtin):
<dd>profile $expr$ with the Python's cProfiler.
</dl>

>> PythonCProfileEvaluation[a + b + 1]
= ...
## This produces an error in the LaTeX documentation.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The result of this doctest produces a wrong LaTeX output, that spoils the mathics.pdf generation.

@mmatera
Copy link
Contributor Author

mmatera commented Feb 2, 2024

With these changes, the documentation is generated without complaint.

@rocky
Copy link
Member

rocky commented Feb 2, 2024

LGTM

@mmatera mmatera merged commit 9fd4f37 into master Feb 2, 2024
11 checks passed
@mmatera mmatera deleted the doc-code-revision-order1 branch February 2, 2024 21:51
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