char *body_tag, *nav_attr;
wchar_t *author, *description;
wchar_t *index_text, *contents_text, *preamble_text, *title_separator;
- wchar_t *nav_prev_text, *nav_next_text, *nav_separator;
+ wchar_t *nav_prev_text, *nav_next_text, *nav_up_text, *nav_separator;
wchar_t *index_main_sep, *index_multi_sep;
wchar_t *pre_versionid, *post_versionid;
int restrict_charset, output_charset;
ret.title_separator = L" - ";
ret.nav_prev_text = L"Previous";
ret.nav_next_text = L"Next";
+ ret.nav_up_text = L"Up";
ret.nav_separator = L" | ";
ret.index_main_sep = L": ";
ret.index_multi_sep = L", ";
ret.nav_prev_text = uadv(k);
} else if (!ustricmp(k, L"html-nav-next-text")) {
ret.nav_next_text = uadv(k);
+ } else if (!ustricmp(k, L"html-nav-up-text")) {
+ ret.nav_up_text = uadv(k);
} else if (!ustricmp(k, L"html-nav-separator")) {
ret.nav_separator = uadv(k);
} else if (!ustricmp(k, L"html-index-main-separator")) {
html_nl(&ho);
}
- /* FIXME: link rel="up" */
-
if (f != files.head) {
element_empty(&ho, "link");
element_attr(&ho, "rel", "ToC");
html_nl(&ho);
}
+ if (conf.leaf_level > 0) {
+ htmlsect *p = f->first->parent;
+ assert(p == f->last->parent);
+ if (p) {
+ element_empty(&ho, "link");
+ element_attr(&ho, "rel", "up");
+ element_attr(&ho, "href", p->file->filename);
+ html_nl(&ho);
+ }
+ }
+
if (has_index && files.index && f != files.index) {
element_empty(&ho, "link");
element_attr(&ho, "rel", "index");
if (f != files.head)
element_close(&ho, "a");
+ /* We don't bother with "Up" links for leaf-level 1,
+ * as they would be identical to the "Contents" links. */
+ if (conf.leaf_level >= 2) {
+ htmlsect *p = f->first->parent;
+ assert(p == f->last->parent);
+ html_text(&ho, conf.nav_separator);
+ if (p) {
+ element_open(&ho, "a");
+ element_attr(&ho, "href", p->file->filename);
+ }
+ html_text(&ho, conf.nav_up_text);
+ if (p) {
+ element_close(&ho, "a");
+ }
+ }
+
if (has_index && files.index) {
html_text(&ho, conf.nav_separator);
if (f != files.index) {
\dt \I{\cw{\\cfg\{html-nav-next-text\}}}\cw{\\cfg\{html-nav-next-text\}\{}\e{text}\cw{\}}
-\dd The text used for the \q{previous page} and \q{next page} links on
-the navigation bar.
+\dt \I{\cw{\\cfg\{html-nav-up-text\}}}\cw{\\cfg\{html-nav-up-text\}\{}\e{text}\cw{\}}
+
+\dd The text used for the \q{previous page}, \q{next page}, and \q{up}
+links on the navigation bar.
\dt \I{\cw{\\cfg\{html-nav-separator\}}}\cw{\\cfg\{html-nav-separator\}\{}\e{text}\cw{\}}
\c \cfg{html-post-versionid}{]}
\c \cfg{html-nav-prev-text}{Previous}
\c \cfg{html-nav-next-text}{Next}
+\c \cfg{html-nav-up-text}{Up}
\c \cfg{html-nav-separator}{ | }
\c
\c \cfg{html-output-charset}{ASCII}