diff options
| author | Simon Tatham <anakin@pobox.com> | 2006-06-02 19:19:12 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2006-06-02 19:19:12 +0000 |
| commit | 9e8ca006788e2148154711e1e67b88f495d94e26 (patch) | |
| tree | b3886338af0052ddf9dfbd6eb7212e317eb2bea5 /bk_paper.c | |
| parent | 9c7ee9bd5c91b41792c40e12669b43aceea2a544 (diff) | |
| download | halibut-9e8ca006788e2148154711e1e67b88f495d94e26.zip halibut-9e8ca006788e2148154711e1e67b88f495d94e26.tar.gz halibut-9e8ca006788e2148154711e1e67b88f495d94e26.tar.bz2 halibut-9e8ca006788e2148154711e1e67b88f495d94e26.tar.xz | |
Introduce global (cross-backend) \cfg{contents} and \cfg{index}
commands, allowing the fixed words "Contents" and "Index" generated
in various output formats to be reconfigured into other languages.
[originally from svn r6724]
Diffstat (limited to 'bk_paper.c')
| -rw-r--r-- | bk_paper.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -120,6 +120,7 @@ struct paper_conf_Tag { int pagenum_fontsize; int footer_distance; wchar_t *lquote, *rquote, *bullet; + wchar_t *contents_text, *index_text; /* These are derived from the above */ int base_width; int page_height; @@ -283,6 +284,8 @@ static paper_conf paper_configure(paragraph *source, font_list *fontlist) { ret.lquote = L"\x2018\0\x2019\0'\0'\0\0"; ret.rquote = uadv(ret.lquote); ret.bullet = L"\x2022\0-\0\0"; + ret.contents_text = L"Contents"; + ret.index_text = L"Index"; /* * Two-pass configuration so that we can pick up global config @@ -309,6 +312,10 @@ static paper_conf paper_configure(paragraph *source, font_list *fontlist) { ret.lquote = uadv(p->keyword); ret.rquote = uadv(ret.lquote); } + } else if (!ustricmp(p->keyword, L"contents")) { + ret.contents_text = uadv(p->keyword); + } else if (!ustricmp(p->keyword, L"index")) { + ret.index_text = uadv(p->keyword); } else if (!ustricmp(p->keyword, L"paper-bullet")) { ret.bullet = uadv(p->keyword); } else if (!ustricmp(p->keyword, L"paper-page-width")) { @@ -547,7 +554,7 @@ void *paper_pre_backend(paragraph *sourceform, keywordlist *keywords, */ { word *contents_title; - contents_title = fake_word(L"Contents"); + contents_title = fake_word(conf->contents_text); firstcont = make_para_data(para_UnnumberedChapter, 0, 0, 0, NULL, NULL, contents_title, conf); @@ -615,7 +622,8 @@ void *paper_pre_backend(paragraph *sourceform, keywordlist *keywords, if (has_index) { pdata = make_para_data(para_Normal, 0, 0, conf->contents_margin, - NULL, NULL, fake_word(L"Index"), conf); + NULL, NULL, + fake_word(conf->index_text), conf); pdata->next = NULL; pdata->contents_entry = &index_placeholder_para; lastcont->next = pdata; @@ -835,7 +843,7 @@ void *paper_pre_backend(paragraph *sourceform, keywordlist *keywords, /* * Create a set of paragraphs for the index. */ - index_title = fake_word(L"Index"); + index_title = fake_word(conf->index_text); firstidx = make_para_data(para_UnnumberedChapter, 0, 0, 0, NULL, NULL, index_title, conf); |