diff options
Diffstat (limited to 'src/sdp/output/xmls.d')
-rw-r--r-- | src/sdp/output/xmls.d | 130 |
1 files changed, 97 insertions, 33 deletions
diff --git a/src/sdp/output/xmls.d b/src/sdp/output/xmls.d index 2482f28..c7dd552 100644 --- a/src/sdp/output/xmls.d +++ b/src/sdp/output/xmls.d @@ -71,28 +71,25 @@ template outputXHTMLs() { o = format(q"¶<!DOCTYPE html> <html> <head> - <meta charset="utf-8"> - <title> - %s%s - </title> - <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> - <meta name="dc.title" content="Title" /> - <meta name="dc.author" content="Author" /> - <meta name="dc.publisher" content="SiSU http://www.jus.uio.no/sisu (this copy)" /> - <meta name="dc.date" content="year" /> - <meta name="dc.date.created" content="year" /> - <meta name="dc.date.issued" content="year" /> - <meta name="dc.date.available" content="year" /> - <meta name="dc.date.valid" content="year" /> - <meta name="dc.date.modified" content="year" /> - <meta name="dc.language" content="US" /> - <meta name="dc.rights" content="Copyright: Copyright (C) year holder /> - <meta name="generator" content="sdp [SiSU 7.1.8 of 2016w08/5 (2016-02-26)] (n*x and D)" /> - </meta> + <title> + %s%s + </title> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> + <meta name="dc.title" content="Title" /> + <meta name="dc.author" content="Author" /> + <meta name="dc.publisher" content="SiSU http://www.jus.uio.no/sisu (this copy)" /> + <meta name="dc.date" content="year" /> + <meta name="dc.date.created" content="year" /> + <meta name="dc.date.issued" content="year" /> + <meta name="dc.date.available" content="year" /> + <meta name="dc.date.valid" content="year" /> + <meta name="dc.date.modified" content="year" /> + <meta name="dc.language" content="US" /> + <meta name="dc.rights" content="Copyright: Copyright (C) year holder /> + <meta name="generator" content="sdp [SiSU 7.1.8 of 2016w08/5 (2016-02-26)] (n*x and D)" /> <link rel="generator" href="http://www.sisudoc.org/" /> <link rel="shortcut icon" href="../../image/rb7.ico" /> <link href="../../css/html.css" rel="stylesheet" /> - <link href="../../../css/html.css" rel="stylesheet" /> </head> <body lang="%s"> <a name="top" id="top"></a>¶", @@ -128,8 +125,7 @@ template outputXHTMLs() { <meta name="generator" content="sdp [SiSU 7.1.8 of 2016w08/5 (2016-02-26)] (n*x and D)" /> </meta> <link rel="generator" href="http://www.sisudoc.org/" /> - <link rel="shortcut icon" href="../../image/rb7.ico" /> - <link href="../../css/html.css" rel="stylesheet" /> + <link rel="shortcut icon" href="../../../image/rb7.ico" /> <link href="../../../css/html.css" rel="stylesheet" /> </head> <body lang="%s"> @@ -331,20 +327,88 @@ template outputXHTMLs() { auto t = inline_notes_seg(obj, _txt); return t; } - auto toc_seg(O)( + string lev4_heading_subtoc(O)( auto return ref const O obj, - string _txt, ) { - string o; - o = format(q"¶ <div class="substance"> - <p class="%s" indent="h%si%s"> - %s - </p> - </div>¶", - obj.is_a, - obj.indent_hang, - obj.indent_base, - _txt, + char[] lev4_subtoc; + lev4_subtoc ~= " <div class=\"nav\">\n"; + foreach (subtoc; obj.lev4_subtoc) { + if (auto m = subtoc.match(rgx.inline_link_subtoc)) { + auto indent = to!string(m.captures[1]); + auto text = to!string(m.captures[2]); + text = font_face(text); + auto link = to!string(m.captures[3]); + lev4_subtoc ~= subtoc.replaceFirst(rgx.inline_link_subtoc, + format(q"¶ <p class="minitoc" indent="h%si%s"> + <a href="%s">%s</a> + </p> + ¶", + indent, + indent, + link, + text, + )); + } + } + lev4_subtoc ~= " </div>\n"; + return lev4_subtoc.to!string; + } + string nav_pre_next_table(O)( + auto return ref const O obj, + ) { + string prev, next, toc; + if (obj.segname_prev == "") { + prev = ""; + } else { + prev = format(q"¶ + <td align="center" bgcolor="#ffffff"> + <a href="%s.html" target="_top"> + <img border="0" width="22" height="22" src="../../../image/arrow_prev_red.png" alt=" << [ prev ] " /> + </a> + </td> + ¶", + obj.segname_prev, + ); + } + if (obj.segname_next == "") { + next = ""; + } else { + next = format(q"¶ + <td align="center" bgcolor="#ffffff"> + <a href="%s.html" target="_top"> + <img border="0" width="22" height="22" src="../../../image/arrow_next_red.png" alt=" [ next ] >> " /> + </a> + </td> + ¶", + obj.segname_next, + ); + } + if (obj.segment_anchor_tag == "toc") { + toc = ""; + prev = ""; + } else { + toc = format(q"¶ + <td align="center" bgcolor="#ffffff"> + <a href="toc.html" target="_top"> + <img border="0" width="22" height="22" src="../../../image/arrow_up_red.png" alt=" [ toc ] " /> + </a> + </td> + ¶", + ); + } + string o = format(q"¶<div class="nav"> + <table summary="segment navigation pre/next" border="0" cellpadding="3" cellspacing="0"> + <tr> + %s + %s + %s + </tr> + </table> + </div> + ¶", + prev, + toc, + next, ); return o; } |