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

Should use a better sphinx patch to make documentation examples interactive #13230

Closed
pcpa mannequin opened this issue Jul 11, 2012 · 4 comments
Closed

Should use a better sphinx patch to make documentation examples interactive #13230

pcpa mannequin opened this issue Jul 11, 2012 · 4 comments

Comments

@pcpa
Copy link
Mannequin

pcpa mannequin commented Jul 11, 2012

I believe the sphinx patch:

- if source.startswith('>>>'):

+ if source.startswith('>>>') or source.startswith('sage: '):

is too much intrusive to be applied on a system wide sphinx (actually, I applied it to Mandriva python-sphinx package long ago...).

But it was required to make examples interactive in my WIP fedora sagemath package using system wide packages.

Component: documentation

Issue created by migration from https://trac.sagemath.org/ticket/13230

@pcpa pcpa mannequin added this to the sage-5.11 milestone Jul 11, 2012
@pcpa pcpa mannequin added c: documentation labels Jul 11, 2012
@pcpa pcpa mannequin assigned sagetrac-mvngu Jul 11, 2012
@pcpa
Copy link
Mannequin Author

pcpa mannequin commented Jul 11, 2012

comment:1

I opened a fedora bug report about it also, at https://bugzilla.redhat.com/show_bug.cgi?id=839321

@pcpa
Copy link
Mannequin Author

pcpa mannequin commented Sep 8, 2012

comment:2

To generate working documentation, I am currently using this hack:

%if %{with_sphinx_hack}
    cp -far %{python_sitelib}/sphinx %{buildroot}%{python_sitearch}
    sed -i "s|\(source.startswith('>>>')\)|\1 or source.startswith('sage: ')|" \
	%{buildroot}%{python_sitearch}/sphinx/highlighting.py
%endif
[...]
%if %{with_sphinx_hack}
    rm -fr %{buildroot}%{python_sitearch}/sphinx
%endif

I still think it would be better to find a better solution, like the suggestion to use

.. code-block:: pycon
    # sage: interactive code

but that probably would require patching almost every source file.

@jhpalmieri
Copy link
Member

comment:3

Perhaps it would be better to patch sagenb/notebook/docHTMLProcessor.py and whatever other files produce the live docs from the html docs.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
@mkoeppe
Copy link
Member

mkoeppe commented Feb 29, 2024

outdated

@mkoeppe mkoeppe closed this as not planned Won't fix, can't repro, duplicate, stale Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants