-
Notifications
You must be signed in to change notification settings - Fork 15
Make @BeginExampleSession/@EndExampleSession respect plain_text_mode #168
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| ############################################################################# | ||
| ## | ||
| ## AutoDoc package | ||
| ## | ||
| ## Test the behavior of AutoDoc in plain text mode | ||
| ## | ||
| ## Copyright 2018 | ||
| ## Contributed by Glen Whitney, studioinfinity.org | ||
| ## | ||
| ## Licensed under the GPL 2 or later. | ||
| ## | ||
| ############################################################################# | ||
|
|
||
| gap> START_TEST( "AutoDoc package: plaintextmode.tst" ); | ||
| gap> tmpdir := DirectoryTemporary();; | ||
| gap> SetInfoLevel( InfoGAPDoc, 0 ); | ||
| gap> AutoDocWorksheet( "tst/plaintextmode.tst", rec( dir := tmpdir ) ); | ||
| gap> chap1 := Filename(tmpdir, "chap1.html");; | ||
| gap> IsReadableFile(chap1); | ||
| true | ||
| gap> ReadAll(InputTextFile(chap1)); | ||
| "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<!DOCTYPE html PUBLIC \"-//W3C/\ | ||
| /DTD XHTML 1.0 Strict//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1\ | ||
| -strict.dtd\">\n\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"\ | ||
| >\n<head>\n<title>GAP (Plain_Text_Mode_Test) - Chapter 1: Test</title>\n<meta \ | ||
| http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n<meta nam\ | ||
| e=\"generator\" content=\"GAPDoc2HTML\" />\n<link rel=\"stylesheet\" type=\"te\ | ||
| xt/css\" href=\"manual.css\" />\n<script src=\"manual.js\" type=\"text/javascr\ | ||
| ipt\"></script>\n<script type=\"text/javascript\">overwriteStyle();</script>\n\ | ||
| </head>\n<body class=\"chap1\" onload=\"jscontent()\">\n\n\n<div class=\"chli\ | ||
| nktop\"><span class=\"chlink1\">Goto Chapter: </span><a href=\"chap0.html\">To\ | ||
| p</a> <a href=\"chap1.html\">1</a> </div>\n\n<div class=\"chlinkprevnexttop\ | ||
| \"> <a href=\"chap0.html\">[Top of Book]</a> <a href=\"chap0.html#\ | ||
| contents\">[Contents]</a> <a href=\"chap0.html\">[Previous Chapte\ | ||
| r]</a> </div>\n\n<p id=\"mathjaxlink\" class=\"pcenter\"><a href=\"chap\ | ||
| 1_mj.html\">[MathJax on]</a></p>\n<p><a id=\"X87712F9D8732193C\" name=\"X87712\ | ||
| F9D8732193C\"></a></p>\n<div class=\"ChapSects\"><a href=\"chap1.html#X87712F9\ | ||
| D8732193C\">1 <span class=\"Heading\">Test</span></a>\n</div>\n\n<h3>1 <span c\ | ||
| lass=\"Heading\">Test</span></h3>\n\n<p>This is dummy text</p>\n\n\n<div class\ | ||
| =\"example\"><pre>\n<span class=\"GAPprompt\">gap></span> <span class=\"GAP\ | ||
| input\">S5 := SymmetricGroup(5);</span>\nSym( [ 1 .. 5 ] )\n<span class=\"GAPp\ | ||
| rompt\">gap></span> <span class=\"GAPinput\">Size(S5);</span>\n120\n\n# Thi\ | ||
| s next command is present to prevent Test() from\n# being misled by the remain\ | ||
| ing AutoDoc markup.\n<span class=\"GAPprompt\">gap></span> <span class=\"GA\ | ||
| Pinput\">STOP_TEST( \"dummy.tst\", 10000 );</span>\n</pre></div>\n\n<p>And we \ | ||
| wrap up with some dummy text But this should produce more text.</p>\n\n\n<div \ | ||
| class=\"chlinkprevnextbot\"> <a href=\"chap0.html\">[Top of Book]</a>&nbs\ | ||
| p; <a href=\"chap0.html#contents\">[Contents]</a> <a href=\"chap\ | ||
| 0.html\">[Previous Chapter]</a> </div>\n\n\n<div class=\"chlinkbot\"><s\ | ||
| pan class=\"chlink1\">Goto Chapter: </span><a href=\"chap0.html\">Top</a> <a \ | ||
| href=\"chap1.html\">1</a> </div>\n\n<hr />\n<p class=\"foot\">generated by <a\ | ||
| href=\"http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc\">GAPDoc2HTML</a>\ | ||
| </p>\n</body>\n</html>\n" | ||
| gap> STOP_TEST( "plaintextmode.tst", 10000 ); | ||
| #! @AutoDocPlainText | ||
| @Title Plain Text Mode Test | ||
| @Date 2018/08/17 | ||
| @Chapter Test | ||
| This is dummy text | ||
| @BeginExampleSession | ||
| gap> S5 := SymmetricGroup(5); | ||
| Sym( [ 1 .. 5 ] ) | ||
| gap> Size(S5); | ||
| 120 | ||
|
|
||
| # This next command is present to prevent Test() from | ||
| # being misled by the remaining AutoDoc markup. | ||
| gap> STOP_TEST( "dummy.tst", 10000 ); | ||
| @EndExampleSession | ||
| And we wrap up with some dummy text | ||
| @EndAutoDocPlainText | ||
| This line in the file should be completely ignored. | ||
| #! But this should produce more text. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That won't work, sorry.
The correct solution is to put the actual worksheet into a separate file, say
tst/plaintextmode.worksheet, and then read that, instead of trying to cram it all into the .tst file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well it certainly seemed to work, in that the test succeeded as expected. My motivation to merge both the testing code and the markup being tested in the same file was mostly that plaintextmode "should" work to interpolate plain text commands in any file AutoDoc() is processing, so it seemed perfectly reasonable that the test could process itself. A minor secondary motivation was economizing on the number of files in the test harness. But I am happy to re-do the pull request with separate worksheets and .tst file, and will do so ASAP, probably tonight.