From d887dee631335a8c44ef75250524e69e67fbc9b4 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 14 Feb 2013 16:25:23 +0100 Subject: [PATCH] fix empty instruction; add anchors and top links --- librarian/pyhtml.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/librarian/pyhtml.py b/librarian/pyhtml.py index d868a17..d138701 100644 --- a/librarian/pyhtml.py +++ b/librarian/pyhtml.py @@ -66,11 +66,12 @@ class EduModule(Xmill): toc.append("
  • %s
  • " % atxt) toc = "" % "".join(toc) add_header = "Lekcja: " if self.options['wldoc'].book_info.type in ('course', 'synthetic') else '' - return "

    %s" % add_header, "

    " + toc + return "

    %s" % add_header, "

    " + toc - @tagged("h2") def handle_naglowek_rozdzial(self, element): - return "", "".join(tag_open_close("a", name=self.naglowek_to_anchor(element))) + return_to_top = u"wróć do spisu treści" + anchor = "".join(tag_open_close("a", name=self.naglowek_to_anchor(element))) + return return_to_top + "

    ", anchor + "

    " def handle_uwaga(self, _e): return None @@ -361,14 +362,16 @@ class Exercise(EduModule): def get_instruction(self): if not self.instruction_printed: self.instruction_printed = True - return u'%s' % self.INSTRUCTION + if self.INSTRUCTION: + return u'%s' % self.INSTRUCTION + else: + return "" else: return "" class Wybor(Exercise): - INSTRUCTION = None def handle_cwiczenie(self, element): pre, post = super(Wybor, self).handle_cwiczenie(element) is_single_choice = True -- 2.20.1