diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2015-03-23 21:47:54 +0100 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2015-03-23 21:47:54 +0100 |
commit | 0697696a0dbe4eab6415f03b61eff72605fdc0e0 (patch) | |
tree | 5a06b59e2a5f8fc299de2604d4b032f68b75824b /scripts/bupa | |
parent | 173f78679fd36d71f244ffccf15ca4b8fdf06454 (diff) | |
download | website-0697696a0dbe4eab6415f03b61eff72605fdc0e0.tar.xz |
bupa: Use entry id as prefix for auto ids
Diffstat (limited to 'scripts/bupa')
-rwxr-xr-x | scripts/bupa | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/bupa b/scripts/bupa index 0676432..1208263 100755 --- a/scripts/bupa +++ b/scripts/bupa @@ -26,9 +26,10 @@ class Page(object): self.meta_keywords = page_dict['keywords'] self.body = page_dict['body'][0] -def reST_to_html(s): +def reST_to_html(s, id_prefix='id'): formated = core.publish_parts(s, writer_name='html4css1', - settings_overrides={'footnote_references': 'superscript'}) + settings_overrides={'footnote_references': 'superscript', + 'auto_id_prefix': str(id_prefix) + '-',}) return formated['fragment'] def filename_to_id(file_name): @@ -63,7 +64,7 @@ def build_entry(filename, atom_feed): entry.id = filename_to_id(filename) entry.page = filename_to_extless(filename) + '.html' entry.srcpage = filename_to_extless(filename) + '.rst' - entry.body = reST_to_html(entry.body) + entry.body = reST_to_html(entry.body, entry.id) atom_feed.add( title=entry.title, content=entry.body, |