-
Notifications
You must be signed in to change notification settings - Fork 386
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
Sync with Doxygen (including LaTeX Equations) #517
Comments
Hello @Codym48 , thanks for sharing your use case! That's very interesting. Let me answer a few points and add a few more questions...
That's a great idea! And not only for DOxygen - even on GitHub sometimes we don't want to see the file metadata. Maybe we could offer an additional format option like e.g.
What is your expectation on round trips? I mean, if the Doxygen form is found in a notebook, say And the last question is mine... I see that Doxygen let you use long comments in the code itself, so you'll probably want to the markdown cell of notebooks represented as scripts to have a Doxygen-compatible representation. Do you think that commenting out Markdown cells with |
This seems reasonable to me. Note that there needs to be a blank whitespace line between For my own information, what's the value of leaving in and commenting out metadata rather than just removing it with
I just confirmed that Jupyter notebooks don't parse the So I'd support always converting them from those strings in .doxygen.md files to
I like where you're going! I haven't fully thought through the comments-in-Jupyter-notebooks-as-Doxygen-compatible-source-code-comments-in-.py-scripts use case, because it's not one we're using right now. For context, we have source code comments in C++ and Python files, and then we have some additional wrapper or frontpage documentation material captured in .dox and .md files. These files are purely Doxygen documentation and aren't required to compile and run the other source. It's these Doxygen documentation files (.md and .dox) that we'd like to augment with Jupyter notebook capability to make the documentation more interactive and visual, rather than the .py scripts themselves. But let me do some more prototyping of Doxygen-compatible-.py files over in CodyM48/aircraft-motion and I'll get back to you with my findings. |
Great! So in the short term, we will have two additional format options:
For user friendlyness we could have
As you found out, the metadata that is filtered out is indeed preserved in the |
Ok, I think I actually got a Doxygen-compatible-.py file working using either the grouping into global modules or the member group approach. Basically, any markdown cell would become Doxygen comments for a group that applies to all members (variables, classes, functions, etc.) in the code cells beneath it. I pushed my commits that demonstrate these approaches to Codym48/aircraft-motion. For detailed find-and-replace commands, see:
Note that these approaches have some caveats
In trying to find the "best" way to do this, I ended up discovering and then deciding not to leverage pandoc and Doxygen python filters like doxypypy and docstrings and many other tools... ultimately, these are two ways to do it with just Doxygen and jupytext, but no guarantee that either is the "best" way. I think the two additional format options that you list above would be super useful, regardless of if we decide to implement the Doxygen-compatible-.py files. So: how can I help contribute? |
This is very kind of you! Well, I am taking a few days off after the last release, but, sure, I am happy to discuss how we could be working on that...
and then implement the required changes in
|
This will come with release 1.6.0. My expectation is that if you create a
then you will get both the hidden metadata header, and the doxygen equation markers. Cf. this test: jupytext/tests/test_doxygen.py Lines 46 to 72 in a13df0d
Would you like to give a try to the development version and confirm whether it works as expected?
|
Outstanding project, @mwouts! I can see this being very useful.
For some other large mixed-language (Python and C++) repositories, we're using Doxygen as the main documentation tool. Any suggestions for the best way to use or update jupytext to support this workflow? I have a test project available at CodyM48/aircraft-motion that describes the problem statement in the README.md:
Example of page generated by coordinate-frames.doxygen.md:
It seems like the path of least resistance is adding a Doxygen-specific markdown format to jupytext that switches the metadata at the top to use
<!-- -->
instead of--- ---
(or just removes the metadata, which is already possible withdefault_notebook_metadata_filter
) and performs the following find-and-replace operations to match Doxygen LaTeX syntax:Am I on the right path? Would this be valuable?
The text was updated successfully, but these errors were encountered: