-
-
Couldn't load subscription status.
- Fork 682
Description
I think we would be able to generate import statements from the # optional (or # needs - #35779) annotations.
The necessary cross-referencing information is going to be in sage.features.sagemath.
See:
- Add style guide / reference for
# optional - sage....doctest tags, extendsage -tandsage -fixdoctestsfor modularization tasks #35749 (needs review)
(doc preview: https://deploy-preview-35749--sagemath-tobias.netlify.app/reference/misc/sage/features/sagemath.html#sage.features.sagemath.all_features)
This would also have the huge advantage to support users that want to use sage as a normal python package without loading the sage environment.
+1.
I could imagine that the code blocks in the formatted HTML could offers tabs for different views, as is done for example in https://setuptools.pypa.io/en/latest/userguide/package_discovery.html: The example in monolithic Sage (goes through preparser, no imports), and the example in plain Python (some prettified version of the preparsed example + imports). This would also address @williamstein's comment (https://groups.google.com/g/sage-devel/c/utA0N1it0Eo/m/79aD4-RQAAAJ)
Originally posted by @mkoeppe in #35750 (comment)