Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions tst/worksheets.tst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,62 @@ gap> AUTODOC_TestWorkSheet("autoplain");
#I Chapter 1...
#I extracted 3 examples

#
gap> AUTODOC_TestWorkSheet("paired-structure");
#I Extracting manual examples for Paired Structure Test package ...
#I 1 chapters detected
#I Chapter 1...
#I no examples

#
gap> AUTODOC_TestWorkSheet("paired-structure-autoplain");
#I Extracting manual examples for Paired Structure Test package ...
#I 1 chapters detected
#I Chapter 1...
#I no examples

#
gap> AUTODOC_TestWorkSheet("paired-blocks");
#I Extracting manual examples for Paired Blocks Test package ...
#I 1 chapters detected
#I Chapter 1...
#I no examples

#
gap> AUTODOC_TestWorkSheet("paired-blocks-autoplain");
#I Extracting manual examples for Paired Blocks Test package ...
#I 1 chapters detected
#I Chapter 1...
#I no examples

#
gap> AUTODOC_TestWorkSheet("paired-examples");
#I Extracting manual examples for Paired Examples Test package ...
#I 1 chapters detected
#I Chapter 1...
#I extracted 4 examples

#
gap> AUTODOC_TestWorkSheet("paired-examples-autoplain");
#I Extracting manual examples for Paired Examples Test package ...
#I 1 chapters detected
#I Chapter 1...
#I extracted 4 examples

#
gap> AUTODOC_TestWorkSheet("paired-titlepage");
#I Extracting manual examples for Paired Titlepage Test package ...
#I 1 chapters detected
#I Chapter 1...
#I no examples

#
gap> AUTODOC_TestWorkSheet("paired-titlepage-autoplain");
#I Extracting manual examples for Paired Titlepage Test package ...
#I 1 chapters detected
#I Chapter 1...
#I no examples

#
#
gap> STOP_TEST( "worksheets.tst" );
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- This is an automatically generated file. -->
<!DOCTYPE Book SYSTEM "gapdoc.dtd"
[
<#Include SYSTEM "_entities.xml">
]
>
<Book Name="Paired_Blocks_Test">
<#Include SYSTEM "title.xml">
<TableOfContents/>
<Body>
<#Include SYSTEM "_AutoDocMainFile.xml">
</Body>
</Book>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- This is an automatically generated file. -->
<#Include SYSTEM "_Chapter_Blocks_Chapter.xml">
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- This is an automatically generated file. -->
<Chapter Label="Chapter_Blocks_Chapter">
<Heading>Blocks Chapter</Heading>

<Section Label="Chapter_Blocks_Chapter_Section_Primary_Blocks_Section">
<Heading>Primary Blocks Section</Heading>

Intro text for the block-oriented worksheet.
<P/>
</Section>


<Section Label="Chapter_Blocks_Chapter_Section_Injected_Section">
<Heading>Injected Section</Heading>

This section exists so the paired structure stays aligned.
<P/>
</Section>


<Section Label="Chapter_Blocks_Chapter_Section_Utility_Blocks_Section">
<Heading>Utility Blocks Section</Heading>

<P/>
Text before inserting the stored chunk.
<#Include Label="StoredChunk">

<P/>
Text before inserting the stored code.
<#Include Label="StoredCode">

<P/>
<Alt Only="LaTeX"><![CDATA[
\textbf{Latex-only inline text.}
]]></Alt>
<Alt Only="LaTeX"><![CDATA[
\emph{Latex-only block text.}
]]></Alt>
<P/>
<Alt Not="LaTeX"><![CDATA[
HTML-and-text inline output.
]]></Alt>
<Alt Not="LaTeX"><![CDATA[
HTML-and-text block output.
]]></Alt>
<P/>
<Subsection Label="Chapter_Blocks_Chapter_Section_Utility_Blocks_Section_Subsection_Stop_Here">
<Heading>Stop Here</Heading>

This text should appear before the parser stops.
</Subsection>


</Section>


</Chapter>

16 changes: 16 additions & 0 deletions tst/worksheets/paired-blocks-autoplain.expected/_Chunks.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<#GAPDoc Label="StoredChunk">
Chunk line one.
Chunk line two with <Code>inline code</Code>.

<#/GAPDoc>
<#GAPDoc Label="StoredCode">
<Listing Type="Code"><![CDATA[
block_value := 11;

if block_value > 10 then
Print("block code reached\n");
fi;
]]></Listing>


<#/GAPDoc>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!ENTITY Paired_Blocks_Test '<Package>Paired_Blocks_Test</Package>'>
11 changes: 11 additions & 0 deletions tst/worksheets/paired-blocks-autoplain.expected/title.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- This is an automatically generated file. -->
<TitlePage>
<Title>
Paired Blocks Test
</Title>
<Date>
7 March 2026
</Date>
</TitlePage>
44 changes: 44 additions & 0 deletions tst/worksheets/paired-blocks-autoplain.sheet/plain.autodoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@Title Paired Blocks Test
@Date 2026-03-07
@Chapter Blocks Chapter
@Section Primary Blocks Section
Intro text for the block-oriented worksheet.

@Section Injected Section
This section exists so the paired structure stays aligned.

@Section Utility Blocks Section

@BeginChunk StoredChunk
Chunk line one.
Chunk line two with `inline code`.
@EndChunk

Text before inserting the stored chunk.
@InsertChunk StoredChunk

@BeginCode StoredCode
block_value := 11;

if block_value > 10 then
Print("block code reached\n");
fi;
@EndCode

Text before inserting the stored code.
@InsertCode StoredCode

@LatexOnly \textbf{Latex-only inline text.}
@BeginLatexOnly
\emph{Latex-only block text.}
@EndLatexOnly

@NotLatex HTML-and-text inline output.
@BeginNotLatex
HTML-and-text block output.
@EndNotLatex

@Subsection Stop Here
This text should appear before the parser stops.
@DoNotReadRestOfFile
This trailing text should never reach the expected XML.
15 changes: 15 additions & 0 deletions tst/worksheets/paired-blocks.expected/Paired_Blocks_Test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- This is an automatically generated file. -->
<!DOCTYPE Book SYSTEM "gapdoc.dtd"
[
<#Include SYSTEM "_entities.xml">
]
>
<Book Name="Paired_Blocks_Test">
<#Include SYSTEM "title.xml">
<TableOfContents/>
<Body>
<#Include SYSTEM "_AutoDocMainFile.xml">
</Body>
</Book>
4 changes: 4 additions & 0 deletions tst/worksheets/paired-blocks.expected/_AutoDocMainFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- This is an automatically generated file. -->
<#Include SYSTEM "_Chapter_Blocks_Chapter.xml">
78 changes: 78 additions & 0 deletions tst/worksheets/paired-blocks.expected/_Chapter_Blocks_Chapter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- This is an automatically generated file. -->
<Chapter Label="Chapter_Blocks_Chapter">
<Heading>Blocks Chapter</Heading>

<Section Label="Chapter_Blocks_Chapter_Section_Primary_Blocks_Section">
<Heading>Primary Blocks Section</Heading>

Intro text for the block-oriented worksheet.
<ManSection Label="block-group">
<Heading>Block Group Title</Heading>
<Oper Arg="obj[, flag]: eager := true" Name="GroupedBlockOperation" Label="grouped-operation-label"/>
<Attr Arg="arg" Name="GroupedBlockAttribute" Label="for IsObject"/>
<Prop Arg="obj" Name="LateJoinedBlockProperty" Label="for IsObject"/>
<Returns>an object
</Returns>
<Description>
First grouped operation description.
Second grouped declaration stays in the implicit group.
This property joins the earlier group explicitly.
</Description>
</ManSection>


</Section>


<Section Label="Chapter_Blocks_Chapter_Section_Injected_Section">
<Heading>Injected Section</Heading>

This section exists so @ChapterInfo has a concrete destination.
<ManSection>
<Attr Arg="source" Name="RedirectedBlockAttribute" Label="for IsObject"/>
<Returns>a record
</Returns>
<Description>
This attribute is redirected into the injected section.
</Description>
</ManSection>


</Section>


<Section Label="Chapter_Blocks_Chapter_Section_Utility_Blocks_Section">
<Heading>Utility Blocks Section</Heading>

Text before inserting the stored chunk.
<#Include Label="StoredChunk">

Text before inserting the stored code.
<#Include Label="StoredCode">

<Alt Only="LaTeX"><![CDATA[
\textbf{Latex-only inline text.}
]]></Alt>
<Alt Only="LaTeX"><![CDATA[
\emph{Latex-only block text.}
]]></Alt>
<Alt Not="LaTeX"><![CDATA[
HTML-and-text inline output.
]]></Alt>
<Alt Not="LaTeX"><![CDATA[
HTML-and-text block output.
]]></Alt>
<Subsection Label="Chapter_Blocks_Chapter_Section_Utility_Blocks_Section_Subsection_Stop_Here">
<Heading>Stop Here</Heading>

This text should appear before the parser stops.
</Subsection>


</Section>


</Chapter>

16 changes: 16 additions & 0 deletions tst/worksheets/paired-blocks.expected/_Chunks.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<#GAPDoc Label="StoredChunk">
Chunk line one.
Chunk line two with <Code>inline code</Code>.

<#/GAPDoc>
<#GAPDoc Label="StoredCode">
<Listing Type="Code"><![CDATA[
block_value := 11;

if block_value > 10 then
Print("block code reached\n");
fi;
]]></Listing>


<#/GAPDoc>
1 change: 1 addition & 0 deletions tst/worksheets/paired-blocks.expected/_entities.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!ENTITY Paired_Blocks_Test '<Package>Paired_Blocks_Test</Package>'>
11 changes: 11 additions & 0 deletions tst/worksheets/paired-blocks.expected/title.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- This is an automatically generated file. -->
<TitlePage>
<Title>
Paired Blocks Test
</Title>
<Date>
7 March 2026
</Date>
</TitlePage>
Loading