From 809f557e18377351019b802c07e27844555949eb Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 27 Jun 2012 08:21:41 +0000 Subject: [PATCH] 2012-06-27 10:20 UTC+0200 Viktor Szakats (harbour syenar.net) * examples/hbdoc/genhtml.prg * write well-formatted CSS code * examples/hbdoc/hbdoc.ch * examples/hbdoc/hbdoc.prg * examples/hbdoc/tmplates.prg % eliminated one PUBLIC var --- harbour/ChangeLog | 9 +++++ harbour/examples/hbdoc/genhtml.prg | 58 +++++++++++++++++++++++------ harbour/examples/hbdoc/hbdoc.ch | 1 - harbour/examples/hbdoc/hbdoc.prg | 4 +- harbour/examples/hbdoc/tmplates.prg | 3 +- 5 files changed, 60 insertions(+), 15 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f826542cbe..93bb7735f8 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,15 @@ The license applies to all entries newer than 2009-04-28. */ +2012-06-27 10:20 UTC+0200 Viktor Szakats (harbour syenar.net) + * examples/hbdoc/genhtml.prg + * write well-formatted CSS code + + * examples/hbdoc/hbdoc.ch + * examples/hbdoc/hbdoc.prg + * examples/hbdoc/tmplates.prg + % eliminated one PUBLIC var + 2012-06-27 00:22 UTC+0200 Viktor Szakats (harbour syenar.net) + examples/hbdoc/genbase.prg - examples/hbdoc/gentpl.prg diff --git a/harbour/examples/hbdoc/genhtml.prg b/harbour/examples/hbdoc/genhtml.prg index 65e8313bdb..a77b2f44a9 100644 --- a/harbour/examples/hbdoc/genhtml.prg +++ b/harbour/examples/hbdoc/genhtml.prg @@ -294,18 +294,54 @@ METHOD Append( cText, cFormat ) CLASS GenerateHTML RETURN self METHOD RecreateStyleDocument( cStyleFile ) CLASS GenerateHTML + LOCAL cString - IF ! hb_MemoWrit( ::cFolder + hb_ps() + cStyleFile,; - "/* Harbour Documents Stylesheet */" + hb_eol() + ; - "body {font-family:arial;font-size:14px;line-height:18px;}" + hb_eol() + ; - /* ".classtitle {font-weight:bold;font-size:22px;padding-bottom:4px;}" + hb_eol() + */ ; - ".name {font-weight:bold;font-size:18px;margin-left:0px;padding-top:0px;padding-bottom:4px;}" + hb_eol() + ; - ".oneliner {font-style:italic;margin-bottom:12px;}" + hb_eol() + ; - ".itemtitle {font-weight:bold;margin-left:0px;padding-top:0px;padding-bottom:4px;}" + hb_eol() + ; - ".itemtext {margin-left:10px;padding-bottom:4px;}" + hb_eol() + ; - ".examples {margin-left:10px;padding-bottom:4px;}" + hb_eol() + ; - ".tests {margin-left:10px;padding-bottom:4px;}" + hb_eol() + ; - "" ) + #pragma __cstream|cString := %s +/* Harbour Documents Stylesheet */ + +body { + font-family: arial; + font-size: 14px; + line-height: 18px; +} + +.name { + font-weight: bold; + font-size: 18px; + margin-left: 0px; + padding-top: 0px; + padding-bottom: 4px; +} + +.oneliner { + font-style: italic; + margin-bottom: 12px; +} + +.itemtitle { + font-weight: bold; + margin-left: 0px; + padding-top: 0px; + padding-bottom: 4px; +} + +.itemtext { + margin-left: 10px; + padding-bottom: 4px; +} + +.examples { + margin-left: 10px; + padding-bottom: 4px; +} + +.tests { + margin-left: 10px; + padding-bottom: 4px; +} + #pragma __endtext + + IF ! hb_MemoWrit( ::cFolder + hb_ps() + cStyleFile, cString ) // TODO: raise an error, could not create style file ENDIF diff --git a/harbour/examples/hbdoc/hbdoc.ch b/harbour/examples/hbdoc/hbdoc.ch index 781975147d..87e96dee10 100644 --- a/harbour/examples/hbdoc/hbdoc.ch +++ b/harbour/examples/hbdoc/hbdoc.ch @@ -57,7 +57,6 @@ #define HBDOC_CH_ MEMVAR p_aCategories -MEMVAR p_hsSwitches MEMVAR p_aCompliance MEMVAR p_aPlatforms MEMVAR p_aStatus diff --git a/harbour/examples/hbdoc/hbdoc.prg b/harbour/examples/hbdoc/hbdoc.prg index e121ff336c..37c475e621 100644 --- a/harbour/examples/hbdoc/hbdoc.prg +++ b/harbour/examples/hbdoc/hbdoc.prg @@ -109,6 +109,8 @@ REQUEST HB_GT_CGI_DEFAULT STATIC s_aExclusions := { "class_tp.txt", "hdr_tpl.txt" } +MEMVAR p_hsSwitches + PROCEDURE Main( ... ) LOCAL aArgs := HB_AParams() LOCAL idx, idx2, idx3, idx4 @@ -957,7 +959,7 @@ PROCEDURE ShowHelp( cExtraMessage, aArgs ) aHelp := { ; iif( Len( aArgs ) >= 3, aArgs[ 3 ] + " template is:", "Defined templates are:" ), ; "", ; - {|| ShowTemplatesHelp( iif( Len( aArgs ) >= 3, aArgs[ 3 ], NIL ) ) } ; + {|| ShowTemplatesHelp( iif( Len( aArgs ) >= 3, aArgs[ 3 ], NIL ), p_hsSwitches[ "DELIMITER" ] ) } ; } CASE aArgs[ 2 ] == "Compliance" diff --git a/harbour/examples/hbdoc/tmplates.prg b/harbour/examples/hbdoc/tmplates.prg index 4c60c10025..a9f4513ef0 100644 --- a/harbour/examples/hbdoc/tmplates.prg +++ b/harbour/examples/hbdoc/tmplates.prg @@ -487,10 +487,9 @@ PROCEDURE init_Templates() RETURN -PROCEDURE ShowTemplatesHelp( cTemplate ) +PROCEDURE ShowTemplatesHelp( cTemplate, cDelimiter ) LOCAL o := Entry():New() LOCAL idxTemplates, nFrom := 1, nTo := Len( o:Templates ) - LOCAL cDelimiter := p_hsSwitches[ "DELIMITER" ] LOCAL idx IF ! Empty( cTemplate ) .AND. cTemplate != "Template"