-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
texinfo documentation for sage #21734
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
see also https://groups.google.com/forum/#!topic/sage-devel/MjhzbpqnLXs applying this patch and doing Currently I do not know how to make sage New commits:
|
Commit: |
Author: Martin Rubey |
This comment has been minimized.
This comment has been minimized.
comment:4
I am having some problems with the texinfo-hyperlinks. For example, in
the
|
comment:5
Replying to @mantepse:
in the standalone info program, this problem does not appear. There are some hints in the Sphinx FAQ http://www.sphinx-doc.org/en/stable/faq.html#texinfo-info but I do not see why they would apply. |
comment:6
Replying to @mantepse: Thank you for the patch. I attended a conference this week and will try the patch when I go back home. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:12
Florent, if you could help with the problem reported at https://groups.google.com/forum/#!topic/sphinx-users/-8cHf1ZD5S4 that would be great. This seems very much related to #9128! |
Changed keywords from none to Sphinx |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:14
Dear Sho, unfortunately, I still have no clue how to enable the crossreferences between the individual manuals. I asked on the sphinx user group https://groups.google.com/forum/#!topic/sphinx-users/-8cHf1ZD5S4 and also on the sphinx github page sphinx-doc/sphinx#3089, but have not got any response so far. meanwhile, I discovered I suspect that this (I mean |
comment:15
Replying to @mantepse: It is already convenient to view Sage document via info. Thank you very much. Concerning with sphinx, I cannot help you, sorry. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:17
The reference manual doesn't build for me (html, not texinfo) without this change: diff --git a/src/doc/en/reference/conf.py b/src/doc/en/reference/conf.py
index 5c7bbe95ec..22961d90ae 100644
--- a/src/doc/en/reference/conf.py
+++ b/src/doc/en/reference/conf.py
@@ -67,7 +67,7 @@ latex_elements['preamble'] += r'''
# @end direntry
texinfo_documents = [
-('index', name, title, u'The Sage Development Team', name, title, 'SageMath')
+('index', name, project, u'The Sage Development Team', name, project, 'SageMath')
]
#Ignore all .rst in the _sage subdirectory or something similar: |
comment:18
You could also consider adding a diff --git a/build/make/deps b/build/make/deps
index 371a56a767..65ad3fdc07 100644
--- a/build/make/deps
+++ b/build/make/deps
@@ -247,6 +247,8 @@ doc-src-clean:
doc-output-clean:
rm -rf "$(SAGE_SHARE)/doc/sage"
+doc-texinfo: $(DOC_DEPENDENCIES)
+ $(AM_V_at)cd ../.. && sage-logger -p './sage --docbuild all texinfo $(SAGE_DOCBUILD_OPTS)' logs/doctexinfo.log
###############################################################################
# Cleaning up (After doing this, |
comment:19
Thank you for looking into this! I'm afraid, however, that there is a shostopper: I couldn't get the links between the individual texinfo files to work. I filed sphinx-doc/sphinx#3089 but it was closed. The advice was: "Please integrate your project into single one." It may well be that I misunderstood the whole thing - but as far as I could tell at the time, the sage documentation consists of many subprojects, one for each folder below |
@mantepse a texinfo manual would be great and I would like to help but I have little familiarity with texinfo, sphinx and sage's docbuilder. I would like to try a working manual but my chances of succeeding are dim. I think the problems are:
I try your work and extend it but it will probably take a lot of time. Thanks for the foundation. |
@mantepse maybe the suggestion to integrate the project into a single one is worth considering. Not as a change to the sage project but for the more restricted purpose of building an info manual. With this diff @@ -75,6 +75,8 @@ multidocs_subdoc_list = sorted([x for x in os.listdir(ref_src)
# List of directories, relative to source directory, that shouldn't be
# searched for source files.
-exclude_patterns += multidocs_subdoc_list + [
- 'sage', 'options'
- ]
+# exclude_patterns += multidocs_subdoc_list + [
+# 'sage', 'options'
+# ]
+
+exclude_patterns = ['_sage'] to
from the directory with sage repo. This command actually fails after producing the texi due to errors like
and I have to run from the directory containing the texi
to produce the info file. A lot of cross references don't work but I am not sure why, since they are defined as
Do you have any idea? Might be due to the fact that there are multiple anchors for the same location in the |
The cross references actually work. Here is what I did: I used open the info file then Another thing, in addition to @@ -183,3 +183,9 @@ Indices and Tables
.. math::
:nowrap:
+
+.. toctree::
+ :maxdepth: 1
+ :glob:
+
+ */index
|
I find it very cool that you are obviously making progress! Do you think you could prepare a pull request at some point so that it is easy to follow your work? I use emacs and sage-shell-mode (and nothing else), so I'd be thrilled to see this working! |
I don't if there is a path for this hack to be upstreamed and I still don't understand how the sage build process works. Maybe conditionally excluding directories depending on the format will be acceptable for
Me too, though I feel I can get by with the hack I have in place now and build the documentation myself. Anyhow here is the gzipped manual I was able to obtain. You can download it and |
Even if it's not complete, it would be cool if you could create a pull request that contains the necessary modifications (if there are any), and a step by step list how to recreate |
@mantepse I created a branch https://github.com/aikrahguzar/sage/tree/info-manual, I don't want to create a draft pr since it is based off a branch which is not merged yet but which I need to build on my computer. To build the info manual, # Generate src/doc/en/reference/repl/options.txt
cd src/doc/
make doc-src
cd -
# Generate inventory
./sage --docbuild reference inventory
# Generate texi (replace target by the directory where build artifacts should go.)
./sage -sh -c "sphinx-build -b texinfo ./src/doc/en target"
# Generate info
makeinfo --no-split --force -o target/sage.info target/sage.texi The I am mostly satisfied with the state here. This setup allows for generating an info manual without messing with the regular build. However if someone wants to continue, here are some thing to figure out:
One problem I would like to solve is the math rendering. But that probably requires changes in texinfo so unlikely in the short term. |
Hi @aikrahguzar, thanks for sharing! I created a local branch that only contains your two commits with the modifications for texinfo. If you don't mind, I would turn it into a pull request. Did you have a look at my (ancient) modifications, i.e., u/mantepse/texinfo_documentation_for_sage? Have they become unnecessary? I do not remember what I did and what it was good for, unfortunately. Browsing through the info file your procedure produces, it seems that the structure of the documentation could be improved quite a bit. There are also a few issues with the typesetting - the current doc in sage-emacs-mode does a good job there (concerning colors and stripping unwanted information). Also, I really would like to be able to use
to jump to the correct node in the info manual. |
Please go ahead.
My guess is they are not needed. I don't understand them well enough but I think they were trying to use the sage docbuild system for building info manuals. This bypasses that and uses sphinx-build directly. There were others which addressed a couple of issues mentioned in sphinx-doc/sphinx#3089 but those have been addressed in sphinx.
Agreed, I think some of the issues could be addressed by a handwritten
The only typesetting problem I see is how the latex math code is copied verbatim. I sent en email to the info help mailing list about it. Coloring Class, Method, sage prompts etc should be possible with a custom jit-lock-function. I might try my hand at that and will let you know if I do. But even the Emacs manual doesn't do much coloring and I find the look alright there.
I think this is very doable. Use a custom |
I took a stab at the fontification here https://codeberg.org/rahguzar/sage-mode/src/commit/361e11ded046d5ffbb1e4eb89b7590c44dcf5e49/sage.el#L528-L618 It can be trivially adapted to I also asked on the mailing list for |
@aikrahguzar thanks a lot for your patches! Having documentation for sage right in the Emacs is extremely useful! |
@mantepse texinfo people have now implemented an option to generate images for math https://lists.gnu.org/archive/html/bug-texinfo/2024-12/msg00061.html It is a work in progress and it will take me a few days to try it out but if you can please try it out. It should help with making the manual more readable. |
@aikrahguzar, I am very interested in trying (I use emacs exclusively, almost as operating system) , but I did not look at this for a very long time. Am I right that I should first build the documentation with #38457? |
fails for me, but seems to be unnecessary after So, I can reproduce the |
It is unnecessary and I got the same errors when building We only need the inventory so
This is why If you want I can attach the compressed manual I obtained here. |
But I used '--force' |
If you are using It is fixed on Emacs 30 but for Emacs 29 (or lower) you can just revert the buffer and the links will start working. |
Wow, excellent! It would be great to integrate this into sage! Perhaps so that Apart from that, every second node in the
Finally, what would be absolutely wonderful for me, is integration with |
Making (push "~/.local/state/emacs/info/" Info-directory-list)
They are useless and as far as I can remember it is possible to remove them by adding manual
The closest thing I have to this is this-function. If you invoke it when the point is on a symbol, it will try to find the corresponding info node. It can be adapted to do what you want using a custom I have no idea about doctests. BTW: have you tried the images for math in info yet? |
texinfo is the native documentation format to emacs. sphinx can output texinfo. we should use that.
CC: [email protected] @hivert
Component: documentation
Keywords: Sphinx
Author: Martin Rubey
Branch/Commit: u/mantepse/texinfo_documentation_for_sage @
b3dac9d
Issue created by migration from https://trac.sagemath.org/ticket/21734
The text was updated successfully, but these errors were encountered: