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

Improving guide handling #203

Merged
merged 23 commits into from
Aug 3, 2024
Merged

Improving guide handling #203

merged 23 commits into from
Aug 3, 2024

Conversation

mmatera
Copy link
Contributor

@mmatera mmatera commented Mar 19, 2024

Changes needed to work together with Mathics3/mathics-core#1025 (comment)

@mmatera
Copy link
Contributor Author

mmatera commented Mar 19, 2024

This is how the documentation associated with a package looks:

imagen

imagen

And this is how it looks for a flat module:
imagen

Still, some aesthetic improvements must be done, like removing the blank lines in the index of a guide section.

@mmatera mmatera marked this pull request as ready for review August 1, 2024 17:11
rocky added a commit to Mathics3/mathics-core that referenced this pull request Aug 2, 2024
Another round of improvements for the docpipeline module. Now we allow
to specify the format of the output (latex, "xml") as well as the path
of the corresponding pickle datafile.
With this change, mathics-django docpipeline get a much simpler
implementation.

To work together with
Mathics3/mathics-django#203

---------

Co-authored-by: rocky <[email protected]>
Co-authored-by: R. Bernstein <[email protected]>
"""
Adds some HTML functions onto existing Django Document Elements.
"""

def href(self, ajax=False):
Copy link
Member

@rocky rocky Aug 3, 2024

Choose a reason for hiding this comment

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

My environment tells me that something is weird with calling self.get_ur<strike>l</strike>i() self.get_uri(). get_uri is not defined in this class and it does not inherit from anything. Therefore were this to get called, we'd have an error.

The similar thing holds for the functionget_title_html() on line 68.

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 couldn't find get_url in this file. What is there is get_uri, which is defined and used to build the navigation links. get_title_html is defined for DjangoDocElement, and I think we need it for doing the documentation format.

Copy link
Member

Choose a reason for hiding this comment

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

What the linter is saying is that if one tries to use it, you'll get an error.

I did some git archeology and this was added by me around 2020 when I split this off from what was in mathics-core. There was a lot of guess work there.

There is no such thing as "building" documentation for Django. So we can remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, but both functions seem to work properly, as they are called when navigating documentation. I added some comments in the docstrings to clarify where they are used.

@rocky
Copy link
Member

rocky commented Aug 3, 2024

LGTM - Many good improvements and simplification of code. Thanks! Merge when you are ready. See also the various comments should you want to address.

.github/workflows/osx.yaml Outdated Show resolved Hide resolved
@mmatera mmatera merged commit 6097500 into master Aug 3, 2024
9 checks passed
@mmatera mmatera deleted the improving_guide_handling branch August 3, 2024 18:25
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