Skip to content

Commit 4cf4a1b

Browse files
committed
Revise handling of chunks XML file
Also remove AUTODOC_AbsolutePath
1 parent d92a6a2 commit 4cf4a1b

File tree

6 files changed

+12
-31
lines changed

6 files changed

+12
-31
lines changed

gap/AutoDocMainFunction.gd

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ DeclareGlobalFunction( "AutoDocScanFiles" );
1616
## Global option record
1717
DeclareGlobalVariable( "_AUTODOC_GLOBAL_OPTION_RECORD" );
1818

19-
##
20-
_AUTODOC_GLOBAL_CHUNKS_FILE := fail;
21-
2219
##
2320
## This function creates a title file. It must be called with the package name and the path to doc files.
2421
DeclareGlobalFunction( "CreateTitlePage" );

gap/AutoDocMainFunction.gi

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,7 @@ end );
436436
# The following function is based on code by Alexander Konovalov
437437
BindGlobal("AUTODOC_ExtractMyManualExamples",
438438
function( pkgname, pkgdir, docdir, main, files, opt )
439-
local tst, i, s, basename, name, output, ch, a, location, pos, comment,
440-
pkgdirString, absPkgdirString,
439+
local tst, i, s, basename, name, output, ch, a, location, pos, comment, pkgdirString,
441440
nonempty_units_found, number_of_digits, lpkgname, tstdir;
442441
Print("Extracting manual examples for ", pkgname, " package ...\n" );
443442

@@ -450,7 +449,6 @@ function( pkgname, pkgdir, docdir, main, files, opt )
450449
tst:=ExtractExamples( docdir, main, files, opt.units );
451450
Print(Length(tst), " ", LowercaseString( opt.units ), "s detected\n");
452451
pkgdirString := Filename(pkgdir, "");
453-
absPkgdirString := AUTODOC_AbsolutePath(pkgdirString);
454452

455453
# ensure the 'tst' directory exists
456454
tstdir := Filename(pkgdir, "tst");
@@ -510,8 +508,6 @@ function( pkgname, pkgdir, docdir, main, files, opt )
510508
location := a[2][1];
511509
if StartsWith(location, pkgdirString) then
512510
comment := location{[ Length(pkgdirString)+1 .. Length(location) ]};
513-
elif StartsWith(location, absPkgdirString) then
514-
comment := location{[ Length(absPkgdirString)+1 .. Length(location) ]};
515511
else
516512
pos := PositionSublist(location, LowercaseString(pkgname));
517513
if pos <> fail then

gap/DocumentationTree.gi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ BindGlobal( "WriteChunks",
396396
current_chunk;
397397

398398
filename := "_Chunks.xml";
399-
_AUTODOC_GLOBAL_CHUNKS_FILE := AUTODOC_AbsolutePath( path_to_xmlfiles, filename );
399+
400400
chunks_stream := AUTODOC_OutputTextFile( path_to_xmlfiles, filename );
401401
chunk_names := RecNames( tree!.chunks );
402402

gap/Magic.gi

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,15 @@ function( arg )
516516
#
517517
# Write AutoDoc XML files
518518
#
519-
_AUTODOC_GLOBAL_CHUNKS_FILE := fail;
520519
if IsBound( autodoc ) then
521520
WriteDocumentation( tree, doc_dir, autodoc.level );
521+
if IsBound( gapdoc ) then
522+
if IsBound( doc_dir_rel ) then
523+
Add( gapdoc.files, "_Chunks.xml" );
524+
else
525+
Add( gapdoc.files, Filename( doc_dir, "_Chunks.xml" ) );
526+
fi;
527+
fi;
522528
fi;
523529

524530

@@ -553,11 +559,6 @@ function( arg )
553559
"\\immediate\\write\\pagenrlog{[\"Ind\", 0, 0], \\arabic{page},}\n",
554560
GAPDoc2LaTeXProcs.Tail );
555561

556-
# Process Chunks.xml file, if present
557-
if IsString(_AUTODOC_GLOBAL_CHUNKS_FILE) then
558-
Add( gapdoc.files, _AUTODOC_GLOBAL_CHUNKS_FILE );
559-
fi;
560-
561562
# Default parameters for MakeGAPDocDoc
562563
args := [ doc_dir, gapdoc.main, gapdoc.files, gapdoc.bookname, "MathJax" ];
563564

gap/ToolFunctions.gd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
DeclareGlobalFunction( "AUTODOC_CreateDirIfMissing" );
99
DeclareGlobalFunction( "AUTODOC_CurrentDirectory" );
10-
DeclareGlobalFunction( "AUTODOC_AbsolutePath" );
1110

1211
DeclareGlobalFunction( "AUTODOC_OutputTextFile" );
1312
DeclareGlobalFunction( "AutoDoc_WriteDocEntry" );

gap/ToolFunctions.gi

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,15 @@ function(d)
2222
end );
2323

2424
InstallGlobalFunction( "AUTODOC_CurrentDirectory",
25-
function()
26-
return AUTODOC_AbsolutePath(DirectoryCurrent());
27-
end);
28-
29-
# given a path (relative or absolute), return an absolute path pointing to the
30-
# same file or directory.
31-
InstallGlobalFunction( "AUTODOC_AbsolutePath",
32-
function( dir, filename... )
25+
function(args...)
3326
local pwd, result;
3427
pwd := Filename( DirectoriesSystemPrograms(), "pwd" );
3528
if pwd = fail then
3629
Error("failed to locate 'pwd' tool");
3730
fi;
3831
result := "";
39-
Process(Directory(dir), pwd, InputTextNone(), OutputTextString(result, true), []);
40-
result := Chomp(result);
41-
if Length(filename) > 0 and Length(filename[1]) > 0 then
42-
Append(result, "/");
43-
Append(result, filename[1]);
44-
fi;
45-
return result;
32+
Process(DirectoryCurrent(), pwd, InputTextNone(), OutputTextString(result, true), []);
33+
return Chomp(result);
4634
end);
4735

4836

0 commit comments

Comments
 (0)