diff options
author | marco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2017-04-27 16:09:46 +0000 |
---|---|---|
committer | marco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2017-04-27 16:09:46 +0000 |
commit | 144e6ee4d787ae00517e0adece349e2a7b4f8e6b (patch) | |
tree | 9fb7230081ae43798f9bc8aac31c143fb3ded81a /utils | |
parent | ee7ffd644aa145ca53dd7f5df419ccc89d073a4f (diff) | |
download | fpc-144e6ee4d787ae00517e0adece349e2a7b4f8e6b.tar.gz |
--- Merging r31366 into '.':
U utils/fpdoc/fpdocclasstree.pp
U utils/fpdoc/dglobals.pp
U utils/fpdoc/fpclasschart.pp
--- Recording mergeinfo for merge of r31366 into '.':
U .
--- Merging r31367 into '.':
G utils/fpdoc/fpclasschart.pp
G utils/fpdoc/fpdocclasstree.pp
--- Recording mergeinfo for merge of r31367 into '.':
G .
--- Merging r32183 into '.':
U packages/fcl-passrc/tests/tcstatements.pas
U packages/fcl-passrc/src/pparser.pp
--- Recording mergeinfo for merge of r32183 into '.':
G .
--- Merging r32360 into '.':
U utils/fpdoc/fpdoc.css
U utils/fpdoc/css.inc
--- Recording mergeinfo for merge of r32360 into '.':
G .
--- Merging r32374 into '.':
U utils/fpdoc/dw_html.pp
U utils/fpdoc/mkfpdoc.pp
G utils/fpdoc/dglobals.pp
U utils/fpdoc/fpdoc.pp
--- Recording mergeinfo for merge of r32374 into '.':
G .
--- Merging r32376 into '.':
A utils/fpdoc/examples
A utils/fpdoc/examples/gentest.sh
A utils/fpdoc/examples/project
A utils/fpdoc/examples/project/sample-project.xml
A utils/fpdoc/examples/project/readme.txt
A utils/fpdoc/examples/basedir
A utils/fpdoc/examples/basedir/readme.txt
A utils/fpdoc/examples/basedir/sample-project.xml
A utils/fpdoc/examples/simple
A utils/fpdoc/examples/simple/testunit.xml
A utils/fpdoc/examples/simple/html.bat
A utils/fpdoc/examples/simple/readme.txt
A utils/fpdoc/examples/simple/html.sh
A utils/fpdoc/examples/simple/testunit.pp
D utils/fpdoc/testunit.pp
D utils/fpdoc/testunit.xml
D utils/fpdoc/gentest.sh
--- Recording mergeinfo for merge of r32376 into '.':
G .
--- Recording mergeinfo for merge of r34113 into '.':
G .
--- Merging r34114 into '.':
U packages/fcl-passrc/src/pscanner.pp
--- Recording mergeinfo for merge of r34114 into '.':
G .
--- Merging r34132 into '.':
G packages/fcl-passrc/src/pscanner.pp
G packages/fcl-passrc/src/pparser.pp
--- Recording mergeinfo for merge of r34132 into '.':
G .
--- Merging r34169 into '.':
G packages/fcl-passrc/src/pscanner.pp
G packages/fcl-passrc/src/pparser.pp
--- Recording mergeinfo for merge of r34169 into '.':
G .
# revisions: 31366,31367,32183,32360,32374,32376,34113,34114,34132,34169
git-svn-id: http://svn.freepascal.org/svn/fpc/branches/fixes_3_0@35971 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'utils')
-rw-r--r-- | utils/fpdoc/css.inc | 91 | ||||
-rw-r--r-- | utils/fpdoc/dglobals.pp | 12 | ||||
-rw-r--r-- | utils/fpdoc/dw_html.pp | 2 | ||||
-rw-r--r-- | utils/fpdoc/examples/basedir/readme.txt | 11 | ||||
-rw-r--r-- | utils/fpdoc/examples/basedir/sample-project.xml | 29 | ||||
-rw-r--r-- | utils/fpdoc/examples/gentest.sh (renamed from utils/fpdoc/gentest.sh) | 0 | ||||
-rw-r--r-- | utils/fpdoc/examples/project/readme.txt | 10 | ||||
-rw-r--r-- | utils/fpdoc/examples/project/sample-project.xml | 29 | ||||
-rw-r--r-- | utils/fpdoc/examples/simple/html.bat | 2 | ||||
-rw-r--r-- | utils/fpdoc/examples/simple/html.sh | 2 | ||||
-rw-r--r-- | utils/fpdoc/examples/simple/readme.txt | 9 | ||||
-rw-r--r-- | utils/fpdoc/examples/simple/testunit.pp (renamed from utils/fpdoc/testunit.pp) | 0 | ||||
-rw-r--r-- | utils/fpdoc/examples/simple/testunit.xml (renamed from utils/fpdoc/testunit.xml) | 0 | ||||
-rw-r--r-- | utils/fpdoc/fpclasschart.pp | 18 | ||||
-rw-r--r-- | utils/fpdoc/fpdoc.css | 21 | ||||
-rw-r--r-- | utils/fpdoc/fpdoc.pp | 6 | ||||
-rw-r--r-- | utils/fpdoc/fpdocclasstree.pp | 16 | ||||
-rw-r--r-- | utils/fpdoc/mkfpdoc.pp | 67 |
18 files changed, 248 insertions, 77 deletions
diff --git a/utils/fpdoc/css.inc b/utils/fpdoc/css.inc index d0252e893c..c79971f330 100644 --- a/utils/fpdoc/css.inc +++ b/utils/fpdoc/css.inc @@ -1,6 +1,6 @@ Const - DefaultCSS : Array[0..2254] of byte = ( + DefaultCSS : Array[0..2649] of byte = ( 47, 42, 10, 32, 32, 36, 73,100, 58, 32,102,112,100,111, 99, 46, 99, 115,115, 44,118, 32, 49, 46, 49, 32, 50, 48, 48, 51, 47, 48, 51, 47, 49, 55, 32, 50, 51, 58, 48, 51, 58, 50, 48, 32,109,105, 99,104, 97, @@ -100,37 +100,60 @@ Const 111,108,111,114, 58, 32, 35,102,102,102,102, 99, 48, 59, 10,125, 10, 10,116, 97, 98,108,101, 46, 98, 97,114, 32,123, 10, 32, 32, 98, 97, 99,107,103,114,111,117,110,100, 45, 99,111,108,111,114, 58, 32, 35, - 97, 48, 99, 48,102,102, 59, 10,125, 10, 10,115,112, 97,110, 46, 98, - 97,114,116,105,116,108,101, 32,123, 10, 32, 32,102,111,110,116, 45, - 119,101,105,103,104,116, 58, 32, 98,111,108,100, 59, 10, 32, 32,102, - 111,110,116, 45,115,116,121,108,101, 58, 32,105,116, 97,108,105, 99, - 59, 10, 32, 32, 99,111,108,111,114, 58, 32,100, 97,114,107, 98,108, - 117,101, 10,125, 10, 10,115,112, 97,110, 46,102,111,111,116,101,114, - 32,123, 10, 32, 32,102,111,110,116, 45,115,116,121,108,101, 58, 32, - 105,116, 97,108,105, 99, 59, 10, 32, 32, 99,111,108,111,114, 58, 32, - 100, 97,114,107, 98,108,117,101, 10,125, 10, 10, 47, 42, 32,100,101, - 102,105,110,105,116,105,111,110, 32,108,105,115,116, 32, 42, 47, 10, - 100,108, 32,123, 10, 32, 98,111,114,100,101,114, 58, 32, 51,112,120, - 32,100,111,117, 98,108,101, 32, 35, 99, 99, 99, 59, 10, 32,112, 97, - 100,100,105,110,103, 58, 32, 48, 46, 53,101,109, 59, 10,125, 10, 10, + 97, 48, 99, 48,102,102, 59, 10,125, 10, 10,116,100, 32,112, 32,123, + 10, 32,109, 97,114,103,105,110, 58, 32, 48, 59, 10,125, 10, 10,115, + 112, 97,110, 46, 98, 97,114,116,105,116,108,101, 32,123, 10, 32, 32, + 102,111,110,116, 45,119,101,105,103,104,116, 58, 32, 98,111,108,100, + 59, 10, 32, 32,102,111,110,116, 45,115,116,121,108,101, 58, 32,105, + 116, 97,108,105, 99, 59, 10, 32, 32, 99,111,108,111,114, 58, 32,100, + 97,114,107, 98,108,117,101, 10,125, 10, 10,115,112, 97,110, 46,102, + 111,111,116,101,114, 32,123, 10, 32, 32,102,111,110,116, 45,115,116, + 121,108,101, 58, 32,105,116, 97,108,105, 99, 59, 10, 32, 32, 99,111, + 108,111,114, 58, 32,100, 97,114,107, 98,108,117,101, 10,125, 10, 10, 47, 42, 32,100,101,102,105,110,105,116,105,111,110, 32,108,105,115, - 116, 58, 32,116,101,114,109, 32, 42, 47, 10,100,116, 32,123, 10, 32, - 102,108,111, 97,116, 58, 32,108,101,102,116, 59, 10, 32, 99,108,101, - 97,114, 58, 32,108,101,102,116, 59, 10, 32,119,105,100,116,104, 58, - 32, 97,117,116,111, 59, 32, 47, 42, 32,110,111,114,109, 97,108,108, - 121, 32, 98,114,111,119,115,101,114,115, 32,100,101,102, 97,117,108, - 116, 32,119,105,100,116,104, 32,111,102, 32,108, 97,114,103,101,115, - 116, 32,105,116,101,109, 32, 42, 47, 10, 32,112, 97,100,100,105,110, - 103, 45,114,105,103,104,116, 58, 32, 50, 48,112,120, 59, 10, 32,102, - 111,110,116, 45,119,101,105,103,104,116, 58, 32, 98,111,108,100, 59, - 10, 32, 99,111,108,111,114, 58, 32,100, 97,114,107,103,114,101,101, - 110, 59, 10,125, 10, 10, 47, 42, 32,100,101,102,105,110,105,116,105, - 111,110, 32,108,105,115,116, 58, 32,100,101,115, 99,114,105,112,116, - 105,111,110, 32, 42, 47, 10,100,100, 32,123, 10, 32,109, 97,114,103, - 105,110, 58, 32, 48, 32, 48, 32, 48, 32, 49, 49, 48,112,120, 59, 10, - 32,112, 97,100,100,105,110,103, 58, 32, 48, 32, 48, 32, 48, 46, 53, - 101,109, 32, 48, 59, 10,125, 10, 10, 47, 42, 32,102,111,114, 32, 98, - 114,111,119,115,101,114,115, 32,105,110, 32,115,116, 97,110,100, 97, - 114,100,115, 32, 99,111,109,112,108,105, 97,110, 99,101, 32,109,111, - 100,101, 32, 42, 47, 10,116,100, 32,112, 32,123, 10, 32, 32,109, 97, - 114,103,105,110, 58, 32, 48, 59, 10,125, 10); + 116, 32, 42, 47, 10,100,108, 32,123, 10, 32, 98,111,114,100,101,114, + 58, 32, 51,112,120, 32,100,111,117, 98,108,101, 32, 35, 99, 99, 99, + 59, 10, 32,112, 97,100,100,105,110,103, 58, 32, 48, 46, 53,101,109, + 59, 10,125, 10, 10, 47, 42, 32,100,101,102,105,110,105,116,105,111, + 110, 32,108,105,115,116, 58, 32,116,101,114,109, 32, 42, 47, 10,100, + 116, 32,123, 10, 32,102,108,111, 97,116, 58, 32,108,101,102,116, 59, + 10, 32, 99,108,101, 97,114, 58, 32,108,101,102,116, 59, 10, 32,119, + 105,100,116,104, 58, 32, 97,117,116,111, 59, 32, 47, 42, 32,110,111, + 114,109, 97,108,108,121, 32, 98,114,111,119,115,101,114,115, 32,100, + 101,102, 97,117,108,116, 32,119,105,100,116,104, 32,111,102, 32,108, + 97,114,103,101,115,116, 32,105,116,101,109, 32, 42, 47, 10, 32,112, + 97,100,100,105,110,103, 45,114,105,103,104,116, 58, 32, 50, 48,112, + 120, 59, 10, 32,102,111,110,116, 45,119,101,105,103,104,116, 58, 32, + 98,111,108,100, 59, 10, 32, 99,111,108,111,114, 58, 32,100, 97,114, + 107,103,114,101,101,110, 59, 10,125, 10, 10, 47, 42, 32,100,101,102, + 105,110,105,116,105,111,110, 32,108,105,115,116, 58, 32,100,101,115, + 99,114,105,112,116,105,111,110, 32, 42, 47, 10,100,100, 32,123, 10, + 32,109, 97,114,103,105,110, 58, 32, 48, 32, 48, 32, 48, 32, 49, 49, + 48,112,120, 59, 10, 32,112, 97,100,100,105,110,103, 58, 32, 48, 32, + 48, 32, 48, 46, 53,101,109, 32, 48, 59, 10,125, 10, 10, 47, 42, 32, + 102,111,114, 32, 98,114,111,119,115,101,114,115, 32,105,110, 32,115, + 116, 97,110,100, 97,114,100,115, 32, 99,111,109,112,108,105, 97,110, + 99,101, 32,109,111,100,101, 32, 42, 47, 10,116,100, 32,112, 32,123, + 10, 32, 32,109, 97,114,103,105,110, 58, 32, 48, 59, 10,125, 10, 10, + 115,112, 97,110, 46,116,111,103,103,108,101,116,114,101,101, 99,108, + 111,115,101, 32,123, 10, 32, 32, 32, 32, 98, 97, 99,107,103,114,111, + 117,110,100, 58, 32,117,114,108, 40,109,105,110,117,115, 46,112,110, + 103, 41, 32, 99,101,110,116,101,114, 32,108,101,102,116, 32,110,111, + 45,114,101,112,101, 97,116, 59, 10, 32, 32, 32, 32,112, 97,100,100, + 105,110,103, 45,108,101,102,116, 58, 32, 50, 48,112,120, 59, 10,125, + 10,115,112, 97,110, 46,116,111,103,103,108,101,116,114,101,101,111, + 112,101,110, 32,123, 10, 32, 32, 32, 32, 98, 97, 99,107,103,114,111, + 117,110,100, 58, 32,117,114,108, 40,112,108,117,115, 46,112,110,103, + 41, 32, 99,101,110,116,101,114, 32,108,101,102,116, 32,110,111, 45, + 114,101,112,101, 97,116, 59, 10, 32, 32, 32, 32,112, 97,100,100,105, + 110,103, 45,108,101,102,116, 58, 32, 50, 48,112,120, 59, 10,125, 10, + 10,117,108, 46, 99,108, 97,115,115,116,114,101,101,108,105,115,116, + 32,108,105, 32,123, 32,112, 97,100,100,105,110,103, 45,108,101,102, + 116, 58, 32, 48,112,120, 59, 32,125, 10, 10,117,108, 46, 99,108, 97, + 115,115,116,114,101,101,108,105,115,116, 32,123, 32,108,105,115,116, + 45,115,116,121,108,101, 45,116,121,112,101, 58,110,111,110,101, 59, + 32,125, 10, 10,108,105, 46, 99,108, 97,115,115,116,114,101,101, 32, + 117,108, 32,123, 32,100,105,115,112,108, 97,121, 58, 32, 98,108,111, + 99,107, 59, 32,125, 10, 32, 10,108,105, 46, 99,108, 97,115,115,116, + 114,101,101, 99,108,111,115,101,100, 32,117,108, 32,123, 32,100,105, + 115,112,108, 97,121, 58, 32,110,111,110,101, 59, 32,125, 10); diff --git a/utils/fpdoc/dglobals.pp b/utils/fpdoc/dglobals.pp index 3f06445a34..01a8b82698 100644 --- a/utils/fpdoc/dglobals.pp +++ b/utils/fpdoc/dglobals.pp @@ -144,6 +144,8 @@ resourcestring SCopyright2 = '(c) 2005 - 2012 various FPC contributors'; SCmdLineHelp = 'Usage: %s [options]'; + SUsageOption008 = '--base-descr-dir=DIR prefix all description files with this directory'; + SUsageOption009 = '--base-input-dir=DIR prefix all input files with this directory'; SUsageOption010 = '--content Create content file for package cross-references'; SUsageOption020 = '--cputarget=value Set the target CPU for the scanner.'; SUsageOption030 = '--descr=file use file as description file, e.g.: '; @@ -711,9 +713,9 @@ var end; end; - function ResolvePackageModule(AName:String;var pkg:TPasPackage;var module:TPasModule;createnew:boolean):String; + function ResolvePackageModule(AName:String;out pkg:TPasPackage;out module:TPasModule;createnew:boolean):String; var - DotPos, DotPos2, i,j: Integer; + DotPos, DotPos2, i: Integer; s: String; HPackage: TPasPackage; @@ -809,7 +811,6 @@ var function CreateClass(const AName: String;InheritanceStr:String): TPasClassType; var - DotPos, DotPos2, i,j: Integer; s: String; HPackage: TPasPackage; Module: TPasModule; @@ -1446,9 +1447,7 @@ Var end; var - i: Integer; Node, Subnode, Subsubnode: TDOMNode; - Element: TDOMElement; Doc: TXMLDocument; PackageDocNode, TopicNode,ModuleDocNode: TDocNode; @@ -1601,9 +1600,6 @@ end; function TFPDocEngine.FindLinkedNode(ANode : TDocNode) : TDocNode; -Var - S: String; - begin If (ANode.Link='') then Result:=Nil diff --git a/utils/fpdoc/dw_html.pp b/utils/fpdoc/dw_html.pp index f41fe543da..c90903f9d1 100644 --- a/utils/fpdoc/dw_html.pp +++ b/utils/fpdoc/dw_html.pp @@ -2471,7 +2471,7 @@ begin try B.BuildTree(AList); // Classes - WriteXMLFile(B.ClassTree,'tree.xml'); + // WriteXMLFile(B.ClassTree,'tree.xml'); // Dummy TObject E:=B.ClassTree.DocumentElement; PushClassList; diff --git a/utils/fpdoc/examples/basedir/readme.txt b/utils/fpdoc/examples/basedir/readme.txt new file mode 100644 index 0000000000..57f5fddd22 --- /dev/null +++ b/utils/fpdoc/examples/basedir/readme.txt @@ -0,0 +1,11 @@ +This directory demonstrates the use of a fpdoc project file. +It uses the files in the examples/simple directory. + +The project file contains the names of the files without paths. +That means that fpdoc must be executed from this directory, +supplying the paths to the input and description files + +fpdoc --project=sample-project.xml --base-input-dir=../simple --base-descr-dir=../simple + +The docs will be written to a subdirectory doc. +This directory can be deleted if it is no longer necessary. diff --git a/utils/fpdoc/examples/basedir/sample-project.xml b/utils/fpdoc/examples/basedir/sample-project.xml new file mode 100644 index 0000000000..a9d32738d9 --- /dev/null +++ b/utils/fpdoc/examples/basedir/sample-project.xml @@ -0,0 +1,29 @@ +<docproject> + <packages> + <!-- Multiple packages can be entered. + If only one is specified, it is selected. + "name" is a mandatory attribute + a "units" tag is required, and a "descriptions" tag as well + --> + <package name="fpdocsample" output="doc" contentfile="fpdocsample.cnt"> + <!-- All input files, one "unit" tag per unit --> + <units> + <!-- "file" is a mandatory attribute, "options" is not mandatory --> + <unit file="testunit.pp" options="-S2"/> + </units> + <descriptions> + <!-- Description files here. One "description" tag per file. + "file" is the only mandatory attribute --> + <description file="testunit.xml"/> + </descriptions> + </package> + </packages> + <options> + <!-- All command-line options can be specified here with the same name + and value as on the actual command-line. Boolean options must have + a value of 'true', '1' or 'yes' --> + <option name="format" value="html"/> + <option name="hide-protected" value="true"/> + <option name="footer-date" value="yyyy-mm-dd"/> + </options> +</docproject>
\ No newline at end of file diff --git a/utils/fpdoc/gentest.sh b/utils/fpdoc/examples/gentest.sh index aff9eababf..aff9eababf 100644 --- a/utils/fpdoc/gentest.sh +++ b/utils/fpdoc/examples/gentest.sh diff --git a/utils/fpdoc/examples/project/readme.txt b/utils/fpdoc/examples/project/readme.txt new file mode 100644 index 0000000000..5915c5a95e --- /dev/null +++ b/utils/fpdoc/examples/project/readme.txt @@ -0,0 +1,10 @@ +This directory demonstrates the use of a fpdoc project file. +It uses the files in the examples/simple directory. + +The project file contains the names of the files with relative paths. +That means that fpdoc must be executed from this directory: + +fpdoc --project=sample-project.xml + +The docs will be written to a subdirectory doc. +This directory can be deleted if it is no longer necessary. diff --git a/utils/fpdoc/examples/project/sample-project.xml b/utils/fpdoc/examples/project/sample-project.xml new file mode 100644 index 0000000000..677bfa24c8 --- /dev/null +++ b/utils/fpdoc/examples/project/sample-project.xml @@ -0,0 +1,29 @@ +<docproject> + <packages> + <!-- Multiple packages can be entered. + If only one is specified, it is selected. + "name" is a mandatory attribute + a "units" tag is required, and a "descriptions" tag as well + --> + <package name="fpdocsample" output="doc" contentfile="fpdocsample.cnt"> + <!-- All input files, one "unit" tag per unit --> + <units> + <!-- "file" is a mandatory attribute, "options" is not mandatory --> + <unit file="../simple/testunit.pp" options="-S2"/> + </units> + <descriptions> + <!-- Description files here. One "description" tag per file. + "file" is the only mandatory attribute --> + <description file="../simple/testunit.xml"/> + </descriptions> + </package> + </packages> + <options> + <!-- All command-line options can be specified here with the same name + and value as on the actual command-line. Boolean options must have + a value of 'true', '1' or 'yes' --> + <option name="format" value="html"/> + <option name="hide-protected" value="true"/> + <option name="footer-date" value="yyyy-mm-dd"/> + </options> +</docproject>
\ No newline at end of file diff --git a/utils/fpdoc/examples/simple/html.bat b/utils/fpdoc/examples/simple/html.bat new file mode 100644 index 0000000000..f2d7401104 --- /dev/null +++ b/utils/fpdoc/examples/simple/html.bat @@ -0,0 +1,2 @@ +rem Command line to create html docs. +fpdoc --package=fpdocsample --output=doc --format=html --input="-S2 testunit.pp" --descr=testunit.xml diff --git a/utils/fpdoc/examples/simple/html.sh b/utils/fpdoc/examples/simple/html.sh new file mode 100644 index 0000000000..de9e772e9c --- /dev/null +++ b/utils/fpdoc/examples/simple/html.sh @@ -0,0 +1,2 @@ +#!/bin/sh +fpdoc --package=fpdocsample --output=doc --format=html --input='-S2 testunit.pp' --descr=testunit.xml diff --git a/utils/fpdoc/examples/simple/readme.txt b/utils/fpdoc/examples/simple/readme.txt new file mode 100644 index 0000000000..a1f2de4109 --- /dev/null +++ b/utils/fpdoc/examples/simple/readme.txt @@ -0,0 +1,9 @@ +This directory contains the files for the projects. + +You can create HTML documentation using just the command-line by executing the +following command in this directory: + +(on 1 line) +fpdoc --package=fpdocsample --output=doc --format=html --input='-S2 testunit.pp' --descr=testunit.xml + +Sample command-lines can be found in html.sh and html.bat diff --git a/utils/fpdoc/testunit.pp b/utils/fpdoc/examples/simple/testunit.pp index 615b8ac28a..615b8ac28a 100644 --- a/utils/fpdoc/testunit.pp +++ b/utils/fpdoc/examples/simple/testunit.pp diff --git a/utils/fpdoc/testunit.xml b/utils/fpdoc/examples/simple/testunit.xml index 794022e81c..794022e81c 100644 --- a/utils/fpdoc/testunit.xml +++ b/utils/fpdoc/examples/simple/testunit.xml diff --git a/utils/fpdoc/fpclasschart.pp b/utils/fpdoc/fpclasschart.pp index 24b139decc..b70ebb4d37 100644 --- a/utils/fpdoc/fpclasschart.pp +++ b/utils/fpdoc/fpclasschart.pp @@ -25,7 +25,6 @@ resourcestring STitle = 'fpClassTree - Create class tree from pascal sources'; SVersion = 'Version %s [%s]'; SCopyright = '(c) 2008 - Michael Van Canneyt, michael@freepascal.org'; - SCmdLineHelp = 'See documentation for usage.'; SCmdLineInvalidOption = 'Ignoring unknown option "%s"'; SDone = 'Done.'; SSkipMerge = 'Cannot merge %s into %s tree.'; @@ -213,7 +212,6 @@ end; procedure TClassChartFormatter.EmitClass(E : TDomElement; HasSiblings: Boolean); Var - DidSub : Boolean; N : TDomNode; I : Integer; L : TFPList; @@ -235,7 +233,6 @@ begin end; DoEmitClass(E); N:=E.FirstChild; - DidSub:=False; L:=TFPList.Create; try While (N<>Nil) do @@ -432,8 +429,6 @@ function TClassTreeEngine.CreateElement(AClass: TPTreeElement; const AName: Stri AParent: TPasElement; AVisibility : TPasMemberVisibility; const ASourceFilename: String; ASourceLinenumber: Integer): TPasElement; -Var - DN : TDocNode; begin Result := AClass.Create(AName, AParent); @@ -478,6 +473,7 @@ Var begin + Result:=0; N:=Source.FirstChild; While (N<>Nil) do begin @@ -503,7 +499,6 @@ Function MergeTrees (Dest,Source : TXMLDocument) : Integer; Var S,D : TDomElement; - Count : Integer; begin Result:=0; @@ -524,28 +519,30 @@ Var Engine: TClassTreeEngine; begin + Result:=''; + ACount:=0; XML:=TXMLDocument.Create; Try //XML. - XML.AppendChild(XML.CreateElement(ObjKindNames[AObjectKind])); + XML.AppendChild(XML.CreateElement('TObject')); For I:=0 to MergeFiles.Count-1 do begin XMl2:=TXMLDocument.Create; ReadXMLFile(XML2,MergeFiles[i]); try - ACount:=MergeTrees(XML,XML2); + ACount:=ACount+MergeTrees(XML,XML2); WriteLn(StdErr,Format(SMergedFile,[ACount,MergeFiles[i]])); Finally FreeAndNil(XML2); end; end; - ACount:=0; For I:=0 to InputFiles.Count-1 do begin Engine := TClassTreeEngine.Create(XML,AObjectKind); Try ParseSource(Engine,InputFiles[I],OSTarget,CPUTarget); - ACount:=ACount+Engine.Ftree.BuildTree(Engine.FObjects); + Engine.Ftree.BuildTree(Engine.FObjects); + ACount:=ACount+MergeTrees(XML,Engine.FTree.ClassTree); Finally FreeAndNil(Engine); end; @@ -586,7 +583,6 @@ var InputFiles, MergeFiles : TStringList; DocLang : String; - PackageName, OutputName: String; procedure InitOptions; diff --git a/utils/fpdoc/fpdoc.css b/utils/fpdoc/fpdoc.css index 09218e5384..39eb15dc8d 100644 --- a/utils/fpdoc/fpdoc.css +++ b/utils/fpdoc/fpdoc.css @@ -127,6 +127,10 @@ table.bar { background-color: #a0c0ff; } +td p { + margin: 0; +} + span.bartitle { font-weight: bold; font-style: italic; @@ -164,3 +168,20 @@ dd { td p { margin: 0; } + +span.toggletreeclose { + background: url(minus.png) center left no-repeat; + padding-left: 20px; +} +span.toggletreeopen { + background: url(plus.png) center left no-repeat; + padding-left: 20px; +} + +ul.classtreelist li { padding-left: 0px; } + +ul.classtreelist { list-style-type:none; } + +li.classtree ul { display: block; } + +li.classtreeclosed ul { display: none; } diff --git a/utils/fpdoc/fpdoc.pp b/utils/fpdoc/fpdoc.pp index 39f1c928e9..8a06b438cc 100644 --- a/utils/fpdoc/fpdoc.pp +++ b/utils/fpdoc/fpdoc.pp @@ -73,6 +73,8 @@ Var begin Writeln(Format(SCmdLineHelp,[ExtractFileName(Paramstr(0))])); + Writeln(SUsageOption008); + Writeln(SUsageOption009); Writeln(SUsageOption010); Writeln(SUsageOption020); Writeln(SUsageOption030); @@ -321,6 +323,8 @@ begin AddToFileList(SelectedPackage.Descriptions, Arg) else if (Cmd = '--descr-dir') then AddDirToFileList(SelectedPackage.Descriptions, Arg, '*.xml') + else if (Cmd = '--base-descr-dir') then + FCreator.BaseDescrDir:=Arg else if (Cmd = '-f') or (Cmd = '--format') then begin Arg:=UpperCase(Arg); @@ -333,6 +337,8 @@ begin FCreator.Options.Language := Arg else if (Cmd = '-i') or (Cmd = '--input') then AddToFileList(SelectedPackage.Inputs, Arg) + else if (Cmd = '--base-input-dir') then + FCreator.BaseInputDir:=Arg else if (Cmd = '--input-dir') then begin AddDirToFileList(SelectedPackage.Inputs, Arg,'*.pp'); diff --git a/utils/fpdoc/fpdocclasstree.pp b/utils/fpdoc/fpdocclasstree.pp index 2cfe865463..fd12dbee20 100644 --- a/utils/fpdoc/fpdocclasstree.pp +++ b/utils/fpdoc/fpdocclasstree.pp @@ -30,8 +30,7 @@ implementation constructor TClassTreeBuilder.Create(APackage : TPasPackage; AObjectKind: TPasObjKind); -Var - N : TDomNode; + begin FCLassTree:=TXMLDocument.Create; FPackage:=APAckage; @@ -82,7 +81,7 @@ begin S:=N.NodeName; if NoPath then Begin - Result:= (CompareText(S,AElement.Name)=0); + Result:=(CompareText(S,AElement.Name)=0); end else begin @@ -132,10 +131,11 @@ Var N : TDomNode; begin - //Writeln('Enter TClassTreeBuilder.AddToClassTree'); + +// Writeln('Enter TClassTreeBuilder.AddToClassTree'); //if Assigned(AElement) then //Writeln('Addtoclasstree : ',aElement.Name); - Result:=Nil; N:=Nil;PE:=NIL; + Result:=Nil; M:=Nil; N:=Nil;PE:=NIL;PC:=Nil; If (AElement=Nil) then begin Result:=FTreeStart; @@ -145,9 +145,7 @@ begin begin N:=LookForElement(FTreeStart,AElement,True); If (N=Nil) then - begin PE:=FTreeStart; - end end else If (AElement is TPasClassType) then begin @@ -164,8 +162,6 @@ begin end; If (N<>Nil) then begin -// if Assigned(PC) then -// Writeln(PC.Name,' already in tree'); Result:=N as TDomElement end else if AElement.Name<>'' then @@ -180,10 +176,8 @@ begin end; if PE=Nil then begin - //Writeln('PE = nil detected for ',AElement.PathName); PE:=FTreeStart end; - //Writeln('Appending to ',PE.NodeName); // if not assigned, probably needs to be assigned to something else. if assigned(PE) then PE.AppendChild(Result); diff --git a/utils/fpdoc/mkfpdoc.pp b/utils/fpdoc/mkfpdoc.pp index 5afb6e0c2e..9d9fd8211b 100644 --- a/utils/fpdoc/mkfpdoc.pp +++ b/utils/fpdoc/mkfpdoc.pp @@ -19,6 +19,8 @@ Type TFPDocCreator = Class(TComponent) Private + FBaseDescrDir: String; + FBaseInputDir: String; FCurPackage : TFPDocPackage; FProcessedUnits : TStrings; FOnLog: TPasParserLogHandler; @@ -28,7 +30,11 @@ Type FVerbose: Boolean; function GetOptions: TEngineOptions; function GetPackages: TFPDocPackages; + procedure SetBaseDescrDir(AValue: String); + procedure SetBaseInputDir(AValue: String); Protected + Function FixInputFile(Const AFileName : String) : String; + Function FixDescrFile(Const AFileName : String) : String; Procedure DoBeforeEmitNote(Sender : TObject; Note : TDomElement; Var EmitNote : Boolean); virtual; procedure HandleOnParseUnit(Sender: TObject; const AUnitName: String; out AInputFile, OSTarget, CPUTarget: String); procedure SetVerbose(AValue: Boolean); virtual; @@ -49,6 +55,9 @@ Type // Easy access Property Options : TEngineOptions Read GetOptions; Property Packages : TFPDocPackages Read GetPackages; + // When set, they will be prepended to non-absolute filenames. + Property BaseInputDir : String Read FBaseInputDir Write SetBaseInputDir; + Property BaseDescrDir : String Read FBaseDescrDir Write SetBaseDescrDir; end; implementation @@ -72,13 +81,13 @@ begin end; end; -procedure TFPDocCreator.DoLog(const Msg: String); +Procedure TFPDocCreator.DoLog(Const Msg: String); begin If Assigned(OnLog) then OnLog(Self,Msg); end; -procedure TFPDocCreator.DoLog(const Fmt: String; Args: array of const); +procedure TFPDocCreator.DoLog(Const Fmt: String; Args: Array of Const); begin DoLog(Format(Fmt,Args)); end; @@ -103,7 +112,7 @@ begin SplitInputFIleOption(S,UN,Opts); if CompareText(ChangeFileExt(ExtractFileName(Un),''),AUnitName)=0 then begin - AInputFile:=S; + AInputFile:=FixInputFile(UN)+' '+Opts; OSTarget:=FProject.Options.OSTarget; CPUTarget:=FProject.Options.CPUTarget; FProcessedUnits.Add(UN); @@ -123,13 +132,45 @@ begin Result:=FProject.Packages; end; -procedure TFPDocCreator.DoBeforeEmitNote(Sender: TObject; Note: TDomElement; - var EmitNote: Boolean); +Function TFPDocCreator.FixInputFile(Const AFileName: String): String; +begin + Result:=AFileName; + If Result='' then exit; + if (ExtractFileDrive(Result)='') and (Result[1]<>PathDelim) then + Result:=BaseInputDir+Result; +end; + +Function TFPDocCreator.FixDescrFile(Const AFileName: String): String; +begin + Result:=AFileName; + If Result='' then exit; + if (ExtractFileDrive(Result)='') and (Result[1]<>PathDelim) then + Result:=BaseDescrDir+Result; +end; + +procedure TFPDocCreator.SetBaseDescrDir(AValue: String); +begin + if FBaseDescrDir=AValue then Exit; + FBaseDescrDir:=AValue; + If FBaseDescrDir<>'' then + FBaseDescrDir:=IncludeTrailingPathDelimiter(FBaseDescrDir); +end; + +procedure TFPDocCreator.SetBaseInputDir(AValue: String); +begin + if FBaseInputDir=AValue then Exit; + FBaseInputDir:=AValue; + If FBaseInputDir<>'' then + FBaseInputDir:=IncludeTrailingPathDelimiter(FBaseInputDir); +end; + +Procedure TFPDocCreator.DoBeforeEmitNote(Sender: TObject; Note: TDomElement; + Var EmitNote: Boolean); begin EmitNote:=True; end; -constructor TFPDocCreator.Create(AOwner: TComponent); +Constructor TFPDocCreator.Create(AOwner: TComponent); begin inherited Create(AOwner); FProject:=TFPDocProject.Create(Self); @@ -139,7 +180,7 @@ begin FProcessedUnits:=TStringList.Create; end; -destructor TFPDocCreator.Destroy; +Destructor TFPDocCreator.Destroy; begin FreeAndNil(FProcessedUnits); FreeAndNil(FProject); @@ -180,7 +221,8 @@ begin Engine.WriteContentFile(APackage.ContentFile); end; -procedure TFPDocCreator.CreateDocumentation(APackage: TFPDocPackage; ParseOnly : Boolean); +Procedure TFPDocCreator.CreateDocumentation(APackage: TFPDocPackage; + ParseOnly: Boolean); var i,j: Integer; @@ -201,7 +243,7 @@ begin Engine.ReadContentFile(Arg, Cmd); end; for i := 0 to APackage.Descriptions.Count - 1 do - Engine.AddDocFile(APackage.Descriptions[i],Options.donttrim); + Engine.AddDocFile(FixDescrFile(APackage.Descriptions[i]),Options.donttrim); Engine.SetPackageName(APackage.Name); Engine.Output:=APackage.Output; Engine.OnLog:=Self.OnLog; @@ -216,10 +258,11 @@ begin for i := 0 to APackage.Inputs.Count - 1 do try SplitInputFileOption(APackage.Inputs[i],Cmd,Arg); + Cmd:=FixInputFIle(Cmd); if FProcessedUnits.IndexOf(Cmd)=-1 then begin FProcessedUnits.Add(Cmd); - ParseSource(Engine, APackage.Inputs[i], Options.OSTarget, Options.CPUTarget); + ParseSource(Engine,Cmd+' '+Arg, Options.OSTarget, Options.CPUTarget); end; except on e: EParserError do @@ -239,7 +282,7 @@ begin end; end; -procedure TFPDocCreator.CreateProjectFile(Const AFileName: string); +Procedure TFPDocCreator.CreateProjectFile(Const AFileName: string); begin With TXMLFPDocOptions.Create(Self) do try @@ -249,7 +292,7 @@ begin end; end; -procedure TFPDocCreator.LoadProjectFile(const AFileName: string); +Procedure TFPDocCreator.LoadProjectFile(Const AFileName: string); begin With TXMLFPDocOptions.Create(self) do try |