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
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ XXX
AutoDoc version
- Deprecate @BeginAutoDocPlainText and @EndAutoDocPlainText; they will be
removed in a future AutoDoc version
- Fix @BeginCode / @EndCode / @InsertCode, which were broken in version 2019.07.03

2019.07.24
- Add support for ISO 8601 dates in package metadata (to prepare for GAP adding
Expand Down
1 change: 0 additions & 1 deletion gap/DocumentationTree.gd
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ DeclareOperation( "SectionInTree", [ IsTreeForDocumentation, IsString, IsString
DeclareOperation( "SubsectionInTree", [ IsTreeForDocumentation, IsString, IsString, IsString ] );
DeclareOperation( "DocumentationExample", [ IsTreeForDocumentation ] );
DeclareOperation( "DocumentationChunk", [ IsTreeForDocumentation, IsString ] );
DeclareOperation( "DocumentationCode", [ IsTreeForDocumentation, IsString ] );
DeclareOperation( "DocumentationManItem", [ IsTreeForDocumentation ] );
DeclareOperation( "SetManItemToDescription", [ IsTreeForDocumentationNode ] );
DeclareOperation( "SetManItemToReturnValue", [ IsTreeForDocumentationNode ] );
Expand Down
55 changes: 2 additions & 53 deletions gap/DocumentationTree.gi
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,6 @@ BindGlobal( "TheTypeOfDocumentationTreeExampleNodes",
NewType( TheFamilyOfDocumentationTreeNodes,
IsTreeForDocumentationExampleNodeRep ) );

DeclareRepresentation( "IsTreeForDocumentationCodeNodeRep",
IsTreeForDocumentationNodeRep,
[ ] );

BindGlobal( "TheTypeOfDocumentationTreeCodeNodes",
NewType( TheFamilyOfDocumentationTreeNodes,
IsTreeForDocumentationCodeNodeRep ) );

###################################
##
## Tools
Expand Down Expand Up @@ -238,27 +230,6 @@ InstallMethod( DocumentationChunk, [ IsTreeForDocumentation, IsString ],
return node;
end );

##
InstallMethod( DocumentationCode, [ IsTreeForDocumentation, IsString ],
function( tree, name )
local node;

name := Concatenation( "System_", name );

node := rec( content := [ ],
level := tree!.current_level );

ObjectifyWithAttributes( node, TheTypeOfDocumentationTreeCodeNodes,
Label, name );

if IsBound( tree!.nodes_by_label.( name ) ) then
Add( tree!.nodes_by_label.( name )!.content, node );
fi;

tree!.nodes_by_label.( name ) := node;
return node;
end );

##
InstallMethod( DocumentationManItem, [ IsTreeForDocumentation ],
function( tree )
Expand Down Expand Up @@ -537,8 +508,8 @@ InstallMethod( WriteDocumentation, [ IsString, IsStream, IsInt ],
## In case the list is empty, do nothing.
## Once the empty string = empty list bug is fixed,
## this could be removed.
text := NormalizedWhitespace( text );
if text = "" then
text := Chomp( text );
if NormalizedWhitespace( text ) = "" then
return;
fi;
AppendTo( filestream, text, "\n" );
Expand Down Expand Up @@ -657,25 +628,3 @@ InstallMethod( WriteDocumentation, [ IsTreeForDocumentationExampleNodeRep, IsStr
od;
AppendTo( filestream, "]]></", inserted_string, ">\n\n" );
end );

##
InstallMethod( WriteDocumentation, [ IsTreeForDocumentationCodeNodeRep, IsStream, IsInt ],
function( node, filestream, level_value )
local content, i;

if node!.level > level_value then
return;
fi;

content := node!.content;

if content = [ ] then
return;
fi;

AppendTo( filestream, "<Listing Type=\"Code\"><![CDATA[\n" );
for i in content do
AppendTo( filestream, i, "\n" );
od;
AppendTo( filestream, "]]></Listing>\n" );
end );
5 changes: 3 additions & 2 deletions gap/Parser.gi
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ InstallGlobalFunction( AutoDoc_Parser_ReadFiles,
end;
read_code := function( )
local code, temp_curr_line, comment_pos, before_comment;
code := [ ];
code := [ "<Listing Type=\"Code\"><![CDATA[\n" ];
while true do
temp_curr_line := ReadLineWithLineCount( filestream );
if temp_curr_line[ Length( temp_curr_line )] = '\n' then
Expand All @@ -430,6 +430,7 @@ InstallGlobalFunction( AutoDoc_Parser_ReadFiles,
fi;
Add( code, temp_curr_line );
od;
Add( code, "]]></Listing>\n" );
return code;
end;
read_example := function( is_tested_example )
Expand Down Expand Up @@ -744,7 +745,7 @@ InstallGlobalFunction( AutoDoc_Parser_ReadFiles,
@BeginCode := function()
local label_name, tmp_system;
label_name := ReplacedString( current_command[ 2 ], " ", "_" );
tmp_system := DocumentationCode( tree, label_name );
tmp_system := DocumentationChunk( tree, label_name );
Append( tmp_system!.content, read_code() );
end,
@Code := ~.@BeginCode,
Expand Down
Loading