Repository navigation
Conversation
$ for f in *.tex; do pandoc -f latex -t rst -o ${f%.*}.rst $f; done
(A) Initial approach:
$ for f in *.tex; do pandoc -f latex -t rst -o ../${f%.*}.rst $f; done
This does not handle the references (e.g. to chapters) properly.
(B) However, this does - it just needs cutting up again:
$ pandoc -f latex -t rst -o Tutorial.rst Tutorial.tex
Wrote a simple script to do this (after earlier standardising the
chapter labels to help):
$ pandoc -f latex -t rst Tutorial.tex | ../.github/rst_chunk.py
Fixes the chapter numbers, but dumps the references to the
end of the appendix (poorly formatted anyway).
This then fixes links to other chapters (since pandoc was writing
a single large RST file, it made all the links internal HTML style
starting with hash):
$ sed -i.bak "s/<#chapter:/<chapter:/g" chapter_*.rst
(C) Wrote a script to convert the links to :ref: style instead,
First, run pandoc on each LaTeX file one-by-one
$ for f in *.tex; do pandoc -f latex -t rst -o ../${f%.*}.rst $f; done
Then fix links:
$ ../.github/ref_fix.py chapter_*.rst
Codecov Report
@@ Coverage Diff @@
## sphinx #2188 +/- ##
==========================================
+ Coverage 83.25% 84.62% +1.37%
==========================================
Files 316 317 +1
Lines 51222 51453 +231
==========================================
+ Hits 42644 43543 +899
+ Misses 8578 7910 -668
Continue to review full report at Codecov.
|
Original commit from Anil Tuncel, 27 July 2019, on pull request biopython#2188. Cherry-picked, conflicts fixed, path assumptions updated, documentation and error messages updated, by Peter Cock.
Original commit from Anil Tuncel, 27 July 2019, on pull request biopython#2188. Cherry-picked, conflicts fixed, path assumptions updated, documentation and error messages updated, by Peter Cock.
Original commit from Anil Tuncel, 27 July 2019, on pull request biopython#2188. Cherry-picked, conflicts fixed, path assumptions updated, documentation and error messages updated, by Peter Cock.
Original commit from Anil Tuncel, 27 July 2019, on pull request biopython#2188. Cherry-picked, conflicts fixed, path assumptions updated, documentation and error messages updated, by Peter Cock.
Original commit from Anil Tuncel, 27 July 2019, on pull request #2188. Cherry-picked, conflicts fixed, path assumptions updated, documentation and error messages updated, by Peter Cock.
|
Hi @peterjc I am happy to see the doctest extractor became useful :).
Thanks, yes that would be good. |
|
I'll do that along with adding a NEWS entry for the changes themselves. Note commits 9b103c0 and f9ec516 to drop blank lines within doctests. This might be a limitation of the current RST doctest extraction code, but those tests broke - I think because the second part was not included. That might be an easy fix, or we might at a later date want to experiment with parsing the RST files via docutils - but what we have now seems to work otherwise 👍 |
Part of work at the BOSC 2019 CoFest towards issue #907
I hereby agree to dual licence this and any previous contributions under both
the Biopython License Agreement AND the BSD 3-Clause License.
I have read the
CONTRIBUTING.rstfile, have runflake8locally, andunderstand that AppVeyor and TravisCI will be used to confirm the Biopython unit
tests and style checks pass with these changes.
I have added my name to the alphabetical contributors listings in the files
NEWS.rstandCONTRIB.rstas part of this pull request, am listedalready, or do not wish to be listed. (This acknowledgement is optional.)