How carve out Text Translator and Builder

16 views
Skip to first unread message

oglop zelgo

unread,
Jan 20, 2020, 4:40:09 AM1/20/20
to sphinx-users
Hello,

I'm trying to carve out Sphinx Text translator to be able to use it for my Pelican project and other things.


I kinda understand how docutils.writers._html_base.HTMLTranslator work and that it (somehow) stores results of states inside self.body and self.fragment

After looking for some inspiration (Flask RSTPages) I came up with this https://github.com/1oglop1/rst2text/blob/master/src/rst_2_plain/document.py#L30
The idea behind this was to compare behaviour of my TextTranslator with docutils original HTMLTranslator to be able to understand on what is happning there.
But as you can see my object txtrst lacks the actual processed content and I do not know where the problem is at the moment.
I assume it might be something with the method depart_document() but it can be something completely different.


Screenshot 2020-01-20 at 10.34.31.png


I'd appreciate all help I can get.

Thank you!


Reply all
Reply to author
Forward
Message has been deleted
0 new messages