From 0697696a0dbe4eab6415f03b61eff72605fdc0e0 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Mon, 23 Mar 2015 21:47:54 +0100 Subject: bupa: Use entry id as prefix for auto ids --- scripts/bupa | 7 ++++--- 1 file 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, -- cgit v1.2.3-70-g09d2