int address_section, visible_version_id;
int leaf_contains_contents, leaf_smallest_contents;
int navlinks;
+ int rellinks;
char *contents_filename;
char *index_filename;
char *template_filename;
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.leaf_contains_contents = FALSE;
ret.leaf_smallest_contents = 4;
ret.navlinks = TRUE;
+ ret.rellinks = TRUE;
ret.single_filename = dupstr("Manual.html");
ret.contents_filename = dupstr("Contents.html");
ret.index_filename = dupstr("IndexPage.html");
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.achapter.just_numbers = utob(uadv(k));
} else if (!ustricmp(k, L"html-suppress-navlinks")) {
ret.navlinks = !utob(uadv(k));
+ } else if (!ustricmp(k, L"html-rellinks")) {
+ ret.rellinks = utob(uadv(k));
} else if (!ustricmp(k, L"html-chapter-suffix")) {
ret.achapter.number_suffix = uadv(k);
} else if (!ustricmp(k, L"html-leaf-level")) {
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")) {
element_close(&ho, "title");
html_nl(&ho);
+ if (conf.rellinks) {
+
+ if (prevf) {
+ element_empty(&ho, "link");
+ element_attr(&ho, "rel", "previous");
+ element_attr(&ho, "href", prevf->filename);
+ html_nl(&ho);
+ }
+
+ if (f != files.head) {
+ element_empty(&ho, "link");
+ element_attr(&ho, "rel", "ToC");
+ element_attr(&ho, "href", files.head->filename);
+ 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");
+ element_attr(&ho, "href", files.index->filename);
+ html_nl(&ho);
+ }
+
+ if (f->next) {
+ element_empty(&ho, "link");
+ element_attr(&ho, "rel", "next");
+ element_attr(&ho, "href", f->next->filename);
+ html_nl(&ho);
+ }
+
+ }
+
if (conf.head_end)
html_raw(&ho, conf.head_end);
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) {