From bb662808db2be22b349dc0aa0b4d4be934df666b Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 18 Oct 2019 18:31:50 -0400 Subject: [PATCH] GNUmakefile: fix blank line handling in SageMath listings. --- GNUmakefile | 5 +++-- sage_listings/example.listing | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) 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("") + -- 2.43.2