From: Michael Orlitzky Date: Fri, 18 Oct 2019 22:31:50 +0000 (-0400) Subject: GNUmakefile: fix blank line handling in SageMath listings. X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mjotex.git;a=commitdiff_plain;h=bb662808db2be22b349dc0aa0b4d4be934df666b GNUmakefile: fix blank line handling in SageMath listings. --- diff --git a/GNUmakefile b/GNUmakefile index 19bde1d..e9b7d11 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -175,9 +175,10 @@ $(PN).log: $(SRCS) $(MAKE) # How do we convert a raw listing into something testable by sage? We -# append/prepend triple quotes to make the whole thing into a doctest. +# append/prepend triple quotes to make the whole thing into a doctest, +# and then we replace any blank lines by "". sage_listings/%.py: sage_listings/%.listing - echo '"""' > $@ && cat $< >> $@ && echo '"""' >> $@ + echo '"""' > $@ && cat $< >> $@ && echo '"""' >> $@ && sed -i 's/^[[:space:]]*$$//' $@ # Ensure that there are no overfull or underfull boxes in the output # document by parsing the log for said warnings. diff --git a/sage_listings/example.listing b/sage_listings/example.listing index d475764..c59a662 100644 --- a/sage_listings/example.listing +++ b/sage_listings/example.listing @@ -1,2 +1,4 @@ sage: Cone([(1,0),(0,1)]).lyapunov_rank() 2 +sage: print("") +