summaryrefslogtreecommitdiff
path: root/bk_xhtml.c
diff options
context:
space:
mode:
authorJames Aylett <james@tartarus.org>2002-01-29 11:23:26 +0000
committerJames Aylett <james@tartarus.org>2002-01-29 11:23:26 +0000
commite3830e1c8ab8c93b18f196cf2a0f78f92cf5d65b (patch)
tree26c96070637de88a34c9e0fd91c2ba32612ec890 /bk_xhtml.c
parent1e43991a687d30949a8fb63b21c93ceae1bd7ad0 (diff)
downloadhalibut-e3830e1c8ab8c93b18f196cf2a0f78f92cf5d65b.zip
halibut-e3830e1c8ab8c93b18f196cf2a0f78f92cf5d65b.tar.gz
halibut-e3830e1c8ab8c93b18f196cf2a0f78f92cf5d65b.tar.bz2
halibut-e3830e1c8ab8c93b18f196cf2a0f78f92cf5d65b.tar.xz
xhtml-navigation-attributes config option (try {align='center'} for instance.
Contents entries are now, eg, "Chapter 1: Introduction" rather than just "Introduction". [originally from svn r1552]
Diffstat (limited to 'bk_xhtml.c')
-rw-r--r--bk_xhtml.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/bk_xhtml.c b/bk_xhtml.c
index 4f6de4e..77d3b0e 100644
--- a/bk_xhtml.c
+++ b/bk_xhtml.c
@@ -68,7 +68,7 @@ typedef struct {
int leaf_smallest_contents;
int include_version_id;
wchar_t *author, *description;
- wchar_t *head_end, *body, *body_start, *body_end, *address_start, *address_end;
+ wchar_t *head_end, *body, *body_start, *body_end, *address_start, *address_end, *nav_attrs;
int suppress_address;
} xhtmlconfig;
@@ -132,6 +132,7 @@ static xhtmlconfig xhtml_configure(paragraph *source)
ret.body_end = NULL;
ret.address_start = NULL;
ret.address_end = NULL;
+ ret.nav_attrs = NULL;
ret.suppress_address = FALSE;
for (; source; source = source->next)
@@ -179,6 +180,8 @@ static xhtmlconfig xhtml_configure(paragraph *source)
ret.address_start = uadv(source->keyword);
} else if (!ustricmp(source->keyword, L"xhtml-address-end")) {
ret.address_end = uadv(source->keyword);
+ } else if (!ustricmp(source->keyword, L"xhtml-navigation-attributes")) {
+ ret.nav_attrs = uadv(source->keyword);
}
}
}
@@ -649,10 +652,16 @@ static char* xhtml_index_filename = "Index.html";
static void xhtml_donavlinks(FILE *fp, xhtmlfile *file)
{
xhtmlfile *xhtml_next_file = NULL;
+ fprintf(fp, "<p");
+ if (conf.nav_attrs!=NULL) {
+ fprintf(fp, " %ls>", conf.nav_attrs);
+ } else {
+ fprintf(fp, ">");
+ }
if (xhtml_last_file==NULL) {
- fprintf(fp, "<p>Previous | ");
+ fprintf(fp, "Previous | ");
} else {
- fprintf(fp, "<p><a href='%s'>Previous</a> | ", xhtml_last_file->filename);
+ fprintf(fp, "<a href='%s'>Previous</a> | ", xhtml_last_file->filename);
}
fprintf(fp, "<a href='Contents.html'>Contents</a> | ");
if (file != NULL) { /* otherwise we're doing nav links for the index */
@@ -941,9 +950,13 @@ static int xhtml_add_contents_entry(FILE *fp, xhtmlsection *section, int limit)
fprintf(fp, "<ul>\n");
}
fprintf(fp, "<li><a href=\"%s#%s\">", section->file->filename, section->fragment);
-/* if (section->para->kwtext) {
+ if (section->para->kwtext) {
xhtml_para(fp, section->para->kwtext);
- } else */if (section->para->words) {
+ if (section->para->words) {
+ fprintf(fp, ": ");
+ }
+ }
+ if (section->para->words) {
xhtml_para(fp, section->para->words);
}
fprintf(fp, "</a></li>\n");