-
-
Notifications
You must be signed in to change notification settings - Fork 559
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
sage --docbuild: Add options to list all documents #31353
Comments
comment:1
While we're at it, we should perhaps upgrade from |
comment:2
Something like this will allow the use of diff --git a/src/sage_setup/docbuild/__init__.py b/src/sage_setup/docbuild/__init__.py
index f4e8522e28..77547ec6d0 100644
--- a/src/sage_setup/docbuild/__init__.py
+++ b/src/sage_setup/docbuild/__init__.py
@@ -1466,9 +1466,16 @@ def help_wrapper(option, opt_str, value, parser):
print(help_documents(), end="")
if option.dest == 'formats':
print(help_formats(), end="")
+ if option.dest == 'all_documents':
+ if value == 'en/reference' or value == 'reference':
+ b = ReferenceBuilder('reference')
+ refdir = os.path.join(os.environ['SAGE_DOC_SRC'], 'en', b.name)
+ s = sorted(b.get_all_documents(refdir))
+ else:
+ s = get_documents()
+ print(s)
setattr(parser.values, 'printed_list', 1)
@@ -1581,6 +1588,10 @@ def setup_parser():
advanced.add_option("-k", "--keep-going", dest="keep_going",
default=False, action="store_true",
help="Do not abort on errors but continue as much as possible after an error")
+ advanced.add_option("--all-documents", dest="all_documents",
+ type="str", action="callback", callback=help_wrapper,
+ help="list ALL available DOCUMENTs, including subdocuments "
+ "of en/reference. Mainly for internal use.")
parser.add_option_group(advanced)
return parser |
comment:3
Sample output:
|
comment:4
Great. For using this from Makefiles it's probably better to print it one item a line without decoration such as commas |
Branch: u/jhpalmieri/print-all-docs |
Commit: |
comment:6
Here's a branch. I did a little sorting on the document names to reflect the order in which things should get built (reference manual first, reference/references first within that). New commits:
|
Author: John Palmieri |
comment:7
It's ready for review in terms of my code, but I don't know if it's printing in the format you want. |
comment:8
The output is perfect, thanks a lot! But in terms of the interface, I think it would be better if passing anything that is not |
comment:10
Okay, how about this? |
comment:11
Perfect except for a possible typo here
should be |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:13
Thanks for catching that; fixed. |
comment:14
I've opened #31366 for converting from optparse to argparse. |
Reviewer: Matthias Koeppe |
Changed branch from u/jhpalmieri/print-all-docs to |
In contrast to the existing
-D
option, it would be a simple machine-readable output; and given a document such asen/reference
, it would list its subdocuments.Using this output we can reimplement the parallel build of all documents (
AllBuilder._wrapper
) using a simple Makefile.CC: @jhpalmieri
Component: documentation
Author: John Palmieri
Branch/Commit:
b67798e
Reviewer: Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/31353
The text was updated successfully, but these errors were encountered: