Opened 8 years ago
Last modified 6 years ago
#13230 new PLEASE CHANGE
Should use a better sphinx patch to make documentation examples interactive
Reported by: | pcpa | Owned by: | mvngu |
---|---|---|---|
Priority: | major | Milestone: | sage-6.4 |
Component: | documentation | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
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.
Change History (7)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
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.
comment:3 Changed 8 years ago by
Perhaps it would be better to patch sagenb/notebook/docHTMLProcessor.py
and whatever other files produce the live docs from the html docs.
comment:4 Changed 7 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:5 Changed 7 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:6 Changed 6 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:7 Changed 6 years ago by
- Milestone changed from sage-6.3 to sage-6.4
I opened a fedora bug report about it also, at https://bugzilla.redhat.com/show_bug.cgi?id=839321