Esempio n. 1
0
 def convert(self, libdoc, output):
     formatter = htmlwriter.DocFormatter(
         libdoc.keywords, libdoc.doc, libdoc.doc_format
     )
     data = htmlwriter.JsonConverter(formatter).convert(libdoc)
     with open(output, "w") as fd:
         json.dump(data, fd, indent=4)
Esempio n. 2
0
    def convert(self, libdoc, output):
        formatter = htmlwriter.DocFormatter(libdoc.keywords, libdoc.doc,
                                            libdoc.doc_format)

        doc = self._raw_html(formatter.html(libdoc.doc))
        try:
            # Robot Framework < 3.2
            libdoc.doc = doc
        except AttributeError:
            # Robot Framework >= 3.2
            libdoc._doc = doc

        for init in libdoc.inits:
            init.doc = self._raw_html(formatter.html(init.doc))
        for kw in libdoc.keywords:
            kw.doc = self._raw_html(formatter.html(kw.doc))

        super().convert(libdoc, output)