From 8e0d84fac59c98b8f08ae3d6b71e1d2915b59936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Sat, 10 Mar 2012 13:55:05 +0100 Subject: [PATCH] Tools.Standalone.autodoc_to_split_html: Added hook for adding extra html headers. --- .../Standalone.pmod/autodoc_to_split_html.pike | 10 ++++++++++ refdoc/structure/modref.html | 1 + refdoc/structure/pelix_modref.html | 2 ++ 3 files changed, 13 insertions(+) diff --git a/lib/modules/Tools.pmod/Standalone.pmod/autodoc_to_split_html.pike b/lib/modules/Tools.pmod/Standalone.pmod/autodoc_to_split_html.pike index b62b2744d4..3882112f8f 100644 --- a/lib/modules/Tools.pmod/Standalone.pmod/autodoc_to_split_html.pike +++ b/lib/modules/Tools.pmod/Standalone.pmod/autodoc_to_split_html.pike @@ -639,6 +639,8 @@ class Node prev_url = make_link(prev); } + string extra_headers = ""; + string res = replace(template, (["$navbar$": make_navbar(), "$contents$": make_content(), @@ -652,6 +654,7 @@ class Node "$dotdot$": extra_prefix, "$imagedir$":image_prefix(), "$filename$": _Roxen.html_encode_string(make_filename()), + "$extra_headers$": extra_headers, ])); if (exporter) { @@ -865,6 +868,13 @@ int low_main(string doc_file, string template_file, string outdir, template = replace(template, ({ "$dotdot$/images/" }), ({ "$imagedir$" })); + + if (!has_value(template, "$extra_headers$")) { + template = replace(template, + ({ "<head>" }), + ({ "<head>\n" + "$extra_headers$" })); + } } top->make_html(template, outdir, exporter); diff --git a/refdoc/structure/modref.html b/refdoc/structure/modref.html index bca5b1b3cc..5c255952d8 100644 --- a/refdoc/structure/modref.html +++ b/refdoc/structure/modref.html @@ -2,6 +2,7 @@ <head> <title>Pike Reference Manual - $title$</title> <link rel='stylesheet' href='$style$' /> + $extra_headers$ </head> <body link="#0768b2" alink="#002040" vlink="#0768b2"> <header> diff --git a/refdoc/structure/pelix_modref.html b/refdoc/structure/pelix_modref.html index f0a70779de..b94779ec34 100644 --- a/refdoc/structure/pelix_modref.html +++ b/refdoc/structure/pelix_modref.html @@ -12,6 +12,8 @@ h2 { margin-bottom: 4px; } td { font-family: arial, helvetica, sans-serif; font-size: 13px; } </style> + $extra_headers$ + </head> <body leftmargin="0" vlink="#0768b2" marginheight="0" bottommargin="0" bgcolor="white" marginwidth="0" text="#343434" link="#0768b2" topmargin="0" rightmargin="0" alink="#002040" > -- GitLab