Thanks. No, I tried Python 3, but there was a syntax error.
вт, 28 апр. 2020 г., 13:55 Matt from Documatt <[email protected]>: > It looks you are using Python 2. xml2rst is last updated in 2018 and thus > maybe will work better in Python 3. But just an idea. It will probably not > help you :-( > > Matt > > On Tue, Apr 28, 2020 at 12:23 PM Yaroslav Nikitenko <[email protected]> > wrote: > >> Hello Matt, >> >> many thanks for your detailed suggestion. >> >> I created xml, but failed to run xml2rst (it prints >> ... File "/usr/lib/python2.7/site-packages/xml2rstlib/markup.py", line >> 61, in quoteInline >> match = self.patterns.initial.search(remaining) >> AttributeError: Inliner instance has no attribute 'patterns') >> >> Then I used pandoc to convert xml to rst. The result was not nice >> though, especially with code samples (they were made one-liners). >> >> I sent a question / bug report to the maintainer of xml2rst, but had no >> answer yet. >> >> >> >> 2020-04-27 13:35 GMT+03:00, Matt from Documatt <[email protected]>: >> > Hello Yaroslav, >> > I think there is no direct way. Such a tool is on Docutil's todo list >> too ( >> > >> https://docutils.sourceforge.io/docs/user/tools.html#restructuredtext-generating-tools >> ). >> > Just the idea that might help you: >> > >> > - Build your Sphinx to Docutils XML ( >> > >> > >> https://www.sphinx-doc.org/en/master/usage/builders/index.html#sphinx.builders.xml.XMLBuilder >> ). >> > For example, if you have French localization (fr), then sphinx-build >> -b >> > xml source_dir output_dir -D language="fr" in your project root. >> > - Use Docutils's tool "xml2rst" >> > https://docutils.sourceforge.io/sandbox/xml2rst/ >> > >> > If you succeed, let me know. >> > >> > On Mon, Apr 27, 2020 at 12:17 PM Yaroslav Nikitenko <[email protected]> >> > wrote: >> > >> >> How can I get translated .rst (or markdown) files? >> >> >> >> I'm writing a project documentation in Sphinx. >> >> >> >> I want to make translations of my .rst files, and I generated and >> >> translated .po files. >> >> >> >> Sphinx generates html translations fine, but I want to have .rst or >> >> markdown full articles (to use them on another site). >> >> >> >> >> >> Is it possible to recreate .rst or markdown files with translations >> from >> >> these .po (or .mo) files? >> >> >> >> If there is no such option in Sphinx, maybe someone knows how it could >> be >> >> done with gettext or Python? >> >> >> >> >> >> I posted this question on stackoverflow, but there was no answer yet >> >> >> >> ( >> >> >> https://stackoverflow.com/questions/61246851/how-to-make-translations-of-full-articles-from-po-files-in-sphinx-or-gettext >> >> ) >> >> >> >> >> >> Thank you. >> >> >> >> >> >> Best regards, >> >> >> >> Yaroslav Nikitenko >> >> >> >> -- >> >> You received this message because you are subscribed to the Google >> Groups >> >> "sphinx-users" group. >> >> To unsubscribe from this group and stop receiving emails from it, send >> an >> >> email to [email protected]. >> >> To view this discussion on the web visit >> >> >> https://groups.google.com/d/msgid/sphinx-users/fdf34636-ba94-4c18-8c32-ee81623935bc%40googlegroups.com >> >> < >> https://groups.google.com/d/msgid/sphinx-users/fdf34636-ba94-4c18-8c32-ee81623935bc%40googlegroups.com?utm_medium=email&utm_source=footer >> > >> >> . >> >> >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "sphinx-users" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an >> > email to [email protected]. >> > To view this discussion on the web visit >> > >> https://groups.google.com/d/msgid/sphinx-users/CAOGNDW8LiCrnDx8RU6CyThxB3cnb9N3NyQ8J9hzk8P3CRZdvng%40mail.gmail.com >> . >> > >> >> >> -- >> С уважением, >> Ярослав Никитенко >> +7 916 743 3759 >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sphinx-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/sphinx-users/CA%2BRLzGALTnzqKgb9qazyd53_Z%3DOt%2BR9XH54-%2Bg2dh5W1ZR3RBQ%40mail.gmail.com >> <https://groups.google.com/d/msgid/sphinx-users/CA%2BRLzGALTnzqKgb9qazyd53_Z%3DOt%2BR9XH54-%2Bg2dh5W1ZR3RBQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "sphinx-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sphinx-users/CAOGNDW9VKD%2Bk5NPhd6LMoSuYRMHZfsaGNoEODxfZZxcUrGh%2Bow%40mail.gmail.com > <https://groups.google.com/d/msgid/sphinx-users/CAOGNDW9VKD%2Bk5NPhd6LMoSuYRMHZfsaGNoEODxfZZxcUrGh%2Bow%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/CA%2BRLzGAxBygaZd90B-QC%2B_uX0R4f9pmZQ9Piddj_8POzTWZ%3DQA%40mail.gmail.com.
