Replies: 1 comment
-
Hi @sowinski ! The following code should do the trick: >>> import pandoc
>>> html = "<p>This is a test</p>"
>>> doc = pandoc.read(html, format="html")
>>> doc
Pandoc(Meta({}), [Para([Str('This'), Space(), Str('is'), Space(), Str('a'), Space(), Str('test')])])
>>> markdown = pandoc.write(doc)
>>> markdown
'This is a test\n' Basically,
I agree that the documentation is not very beginner-friendly ; there is a lot of examples in the doc but most of them are rather advanced. The use case for If you have a simpler use case (say only convert from one format to another), I'd advise you to :
But if you need / want to stick with this library and need some additional information, I'll try to answer ; Discussions should be the appropriate place to ask for help most of the time. Cheers, Sébastien |
Beta Was this translation helpful? Give feedback.
-
Hi,
can someone help me to write some code to transform a html string into a plain text string?
Would be nice to see more examples in the docs
Beta Was this translation helpful? Give feedback.
All reactions