コード例 #1
0
    def gen_target_section(self, target, section="Intro"):
        pieces = Writer.gen_target_section(self, target, section)
        if pieces != None:
            text = "".join(pieces).strip()
            text = text[0].upper() + text[1:] if len(text) > 0 else text
            return text

        else:
            return None
コード例 #2
0
    def gen_target_section(self,
                           target,
                           title=None,
                           section="Intro",
                           newline="\n"):
        pieces = Writer.gen_target_section(self, target, section)
        if pieces != None and len(pieces) >= 1:
            first = pieces[0].lstrip()
            pieces[0] = (first[0].upper() +
                         first[1:] if len(first) > 0 else first)
            if newline:
                pieces.append(newline)
            pieces = rstparser.parse(pieces)
            if title:
                pieces = [(title, "bold")] + pieces

        return pieces or []