mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-01 18:42:57 +02:00
* Support for date in footer
git-svn-id: trunk@11043 -
This commit is contained in:
parent
7d236da474
commit
f7f2008447
@ -76,6 +76,7 @@ resourcestring
|
||||
SDocSynopsis = 'Synopsis';
|
||||
SDocVisibility = 'Visibility';
|
||||
SDocOpaque = 'Opaque type';
|
||||
SDocDateGenerated = 'Documentation generated on: %s';
|
||||
|
||||
// Topics
|
||||
SDocRelatedTopics = 'Related topics';
|
||||
@ -98,6 +99,7 @@ resourcestring
|
||||
|
||||
// HTML usage
|
||||
SHTMLUsageFooter = 'Append xhtml from file as footer to html page';
|
||||
SHTMLUsageFooterDate = 'Append footer with date. fmt is Optional format for FormatDateTime';
|
||||
|
||||
// CHM usage
|
||||
SCHMUsageTOC = 'Use [File] as the table of contents. Usually a .hhc file.';
|
||||
|
@ -104,7 +104,8 @@ type
|
||||
HighlighterFlags: Byte;
|
||||
|
||||
FooterFile: string;
|
||||
|
||||
FIDF : Boolean;
|
||||
FDateFormat: String;
|
||||
function ResolveLinkID(const Name: String): DOMString;
|
||||
function ResolveLinkWithinPackage(AElement: TPasElement;
|
||||
ASubpageIndex: Integer): String;
|
||||
@ -240,7 +241,8 @@ type
|
||||
property Allocator: TFileAllocator read FAllocator;
|
||||
property Package: TPasPackage read FPackage;
|
||||
property PageCount: Integer read GetPageCount;
|
||||
|
||||
Property IncludeDateInFooter : Boolean Read FIDF Write FIDF;
|
||||
Property DateFormat : String Read FDateFormat Write FDateFormat;
|
||||
property OnTest: TNotifyEvent read FOnTest write SetOnTest;
|
||||
Function InterPretOption(Const Cmd,Arg : String) : boolean; override;
|
||||
Procedure WriteDoc; override;
|
||||
@ -1949,9 +1951,24 @@ begin
|
||||
end;
|
||||
|
||||
procedure THTMLWriter.AppendFooter;
|
||||
|
||||
Var
|
||||
S : String;
|
||||
F : TDomElement;
|
||||
begin
|
||||
if FooterFile<>'' then
|
||||
ReadXMLFragment(BodyElement, FooterFile);
|
||||
ReadXMLFragment(BodyElement, FooterFile)
|
||||
else if IncludeDateInFooter then
|
||||
begin
|
||||
CreateEl(BodyElement, 'hr');
|
||||
F:=CreateEl(BodyElement,'span');
|
||||
F['class']:='footer';
|
||||
If (FDateFormat='') then
|
||||
S:=DateToStr(Date)
|
||||
else
|
||||
S:=FormatDateTime(FDateFormat,Date);
|
||||
AppendText(F,Format(SDocDateGenerated,[S]));
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure THTMLWriter.FinishElementPage(AElement: TPasElement);
|
||||
@ -2971,6 +2988,11 @@ begin
|
||||
SearchPage := Arg
|
||||
else if Cmd = '--footer' then
|
||||
FooterFile := Arg
|
||||
else if Cmd = '--footer-date' then
|
||||
begin
|
||||
FIDF:=True;
|
||||
FDateFormat:=Arg;
|
||||
end
|
||||
else
|
||||
Result:=False;
|
||||
end;
|
||||
@ -2985,6 +3007,8 @@ class procedure THTMLWriter.Usage(List: TStrings);
|
||||
begin
|
||||
List.add('--footer');
|
||||
List.Add(SHTMLUsageFooter);
|
||||
List.Add('--footer-date[=Fmt]');
|
||||
List.Add(SHTMLUsageFooterDate);
|
||||
end;
|
||||
|
||||
// private methods
|
||||
|
@ -132,3 +132,8 @@ span.bartitle {
|
||||
font-style: italic;
|
||||
color: darkblue
|
||||
}
|
||||
|
||||
span.footer {
|
||||
font-style: italic;
|
||||
color: darkblue
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user