Re: [sphinx-users] Are there way to generate RST file from translated PO file

2023-01-06 Thread 藤田祐治
Hi Shimazu-san,

Thank you for the email.

That is exactly what I thought as possible solution.

The po file contain the information of the location of the string and
source string as msgid and translated string as msgrd.

It looks ok if sorce string is the plain sentence,
But I am not sure I can have one to one mapping of the string  and simply
replace if the source comes from table,

But it will be interesting challenge and will try.

Again thank you very much for the email.

Yuji

2023年1月6日(金) 21:37 Takayuki Shimizukawa :

> Hi Yuji,
>
> I think there is no easy way to do this.
> Sphinx reads the source and converts it to an AST: Abstract Syntax Tree
> (doctree), where it replaces the messages matching the po file.
> The problem is that we cannot reproduce the reST sources from the AST,
> because most of the structure of the directives is lost upon conversion to
> the AST.
>
> For this reason, I think a possible practical approach would be to look
> for a string in the document source that matches the message in the po file
> and replace it.
>
> Regards,
> --
> Takayuki SHIMIZUKAWA
> http://about.me/shimizukawa
>
>
> 2023年1月4日(水) 14:48 藤田祐治 :
>
>> Hi there!
>>
>> I am using Sphinx for the translated html and pdf by using command
>>
>> make -e SPHINXOPTS="-D language='ja'" html
>> make -e SPHINXOPTS="-D language='ja'" latexpdf
>>
>> from translated PO files.
>>
>> I am just wondering if there is any good way to generate rst file from
>> translated PO file?
>> If I can, it will be very helpful and useful.
>>
>> I saw one to generate an xml file and then xml2rst.
>> But it looks very complex.
>>
>> Are there any handy ways to do it?
>>
>> Thanks
>> Yuji Fujita
>>
>> e-mail: yujfuj...@open-lc.co.jp
>>
>> --
>> 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 sphinx-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/sphinx-users/CABdx1LvJvU60f5bwAXo-YXUT4a5URmtMM7cJV0M3shLJMrqvvQ%40mail.gmail.com
>> 
>> .
>>
> --
> 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 sphinx-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sphinx-users/CADstH-6naRsjuNu39_ecuM1%3DuuWU%2BgvSB6zdbV-a6yF891UZyg%40mail.gmail.com
> 
> .
>
-- 
藤田 祐治
オープンリンク株式会社
代表取締役 社長
住所:千葉県千葉市美浜区打瀬2-9-16-414
携帯:080-3694-5550
e-mail: yujfuj...@open-lc.co.jp

-- 
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 sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/CABdx1LujuqwJrXdHo27NLFo91nKnzR0drpJ%3DzfyjO%3DBXdf0thQ%40mail.gmail.com.


[sphinx-users] wrong hierarchy in latexpdf

2023-01-06 Thread Yaroslav Nikitenko
Dear Sphinx users,

I want to have documentation in both html and pdf formats. While all works 
fine for html, for LaTeX I have to use things like

.. raw:: latex
\chapter{Manual} 

.. only:: latex
 .. include:: yarsync.1.md

because otherwise section hierarchy is wrong.

I filled the bug at https://github.com/sphinx-doc/sphinx/issues/11097, you 
can find more details there.

Do you have any suggestions how to produce a proper hierarchy (it works 
fine in html and epub)? Should I wait until that bug is fixed or is there a 
workaround?

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 sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/ff532311-7518-4bda-9359-f8177afdcccdn%40googlegroups.com.


[sphinx-users] Re: The xrst sphinx wrapper

2023-01-06 Thread bradley...@gmail.com
This is not a problem with readthedoc, it is a problem with how firefox 
handles redirects.

xrst is using a redirect in the index.html file to load any page that one 
chooses on the command line; e.g.,
```
 window.location.href="user-guide.html" 
```
The problem is that once firefox gets the redirect it never reloads it when 
it changes.
I had to clear my cache to get it to reload.

On Friday, January 6, 2023 at 5:52:12 AM UTC-7 bradley...@gmail.com wrote:

> I changed the name user_guide to user-guide (as a test) and there seems to 
> be a problem with readthedocs. 
> The link
> https://xrst.readthedocs.io/en/latest/index.html
> works fine and gets to the user-guide.html page, but the link
> https://xrst.readthedocs.io/
> tries to go to the old user_guide.html page (which is no longer there).
>
> On Sunday, January 1, 2023 at 10:22:00 AM UTC-7 bradley...@gmail.com 
> wrote:
>
>> This is an announcement for the first stable release of xrst
>> https://xrst.readthedocs.io
>>
>> This wrapper was motivated by cases like the GNU Scientific library, 
>> which is written in C, uses sphinx for its documentation, and has its 
>> documentation in separate files from the corresponding source code. 
>>
>> The following link lists the features that xrst adds to sphinx:
>> https://xrst.readthedocs.io/en/latest/purpose.html
>>
>> The following is a list of problems and possible improvements:
>> https://xrst.readthedocs.io/en/latest/wish_list.html
>>
>>
>>

-- 
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 sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/8467625b-6638-4ef9-939c-0dcd075d1decn%40googlegroups.com.


[sphinx-users] Re: The xrst sphinx wrapper

2023-01-06 Thread bradley...@gmail.com
I changed the name user_guide to user-guide (as a test) and there seems to 
be a problem with readthedocs. 
The link
https://xrst.readthedocs.io/en/latest/index.html
works fine and gets to the user-guide.html page, but the link
https://xrst.readthedocs.io/
tries to go to the old user_guide.html page (which is no longer there).

On Sunday, January 1, 2023 at 10:22:00 AM UTC-7 bradley...@gmail.com wrote:

> This is an announcement for the first stable release of xrst
> https://xrst.readthedocs.io
>
> This wrapper was motivated by cases like the GNU Scientific library, which 
> is written in C, uses sphinx for its documentation, and has its 
> documentation in separate files from the corresponding source code. 
>
> The following link lists the features that xrst adds to sphinx:
> https://xrst.readthedocs.io/en/latest/purpose.html
>
> The following is a list of problems and possible improvements:
> https://xrst.readthedocs.io/en/latest/wish_list.html
>
>
>

-- 
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 sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/2ef7df5d-bac4-4967-8127-b8ec8444e4d1n%40googlegroups.com.


Re: [sphinx-users] Are there way to generate RST file from translated PO file

2023-01-06 Thread Takayuki Shimizukawa
Hi Yuji,

I think there is no easy way to do this.
Sphinx reads the source and converts it to an AST: Abstract Syntax Tree
(doctree), where it replaces the messages matching the po file.
The problem is that we cannot reproduce the reST sources from the AST,
because most of the structure of the directives is lost upon conversion to
the AST.

For this reason, I think a possible practical approach would be to look for
a string in the document source that matches the message in the po file and
replace it.

Regards,
--
Takayuki SHIMIZUKAWA
http://about.me/shimizukawa


2023年1月4日(水) 14:48 藤田祐治 :

> Hi there!
>
> I am using Sphinx for the translated html and pdf by using command
>
> make -e SPHINXOPTS="-D language='ja'" html
> make -e SPHINXOPTS="-D language='ja'" latexpdf
>
> from translated PO files.
>
> I am just wondering if there is any good way to generate rst file from
> translated PO file?
> If I can, it will be very helpful and useful.
>
> I saw one to generate an xml file and then xml2rst.
> But it looks very complex.
>
> Are there any handy ways to do it?
>
> Thanks
> Yuji Fujita
>
> e-mail: yujfuj...@open-lc.co.jp
>
> --
> 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 sphinx-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sphinx-users/CABdx1LvJvU60f5bwAXo-YXUT4a5URmtMM7cJV0M3shLJMrqvvQ%40mail.gmail.com
> 
> .
>

-- 
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 sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/CADstH-6naRsjuNu39_ecuM1%3DuuWU%2BgvSB6zdbV-a6yF891UZyg%40mail.gmail.com.


[sphinx-users] Re: Builder and custom extension

2023-01-06 Thread Daniel Woste
Hi,
answered this also on SO:



If your output code is not too complex (for instance just some 
div-container, paragraphs, some text) I would try to avoid the custom 
builder visitor functions. Mainly as you need to maintain one solution for 
each builder, and as there are many builders, you may miss some.

I would try to transform your custom directive node to some standard 
docutils nodes, so that each builder can handle it.

So you can add a handler to the sphinx event "doctree-resolved", then you 
search for your custom node in the current doctree. This node get then 
replaced by a nested list of standard docutil nodes, e.g. 
node.replace_self(docutils.nodes.Text('Some 
simple text')).

The creation of this nested docutils-node-tree for your directive may be 
more complex than just adding a HTML-string in a visitor function. But the 
benefit is, you have to do it only once and support 100% of all Sphinx 
builders out of the box.

Disclaimer: I'm a maintainer of Sphinx-Needs 
, which is using the above 
mechanism for all its directives.


paulant...@gmail.com schrieb am Donnerstag, 5. Januar 2023 um 18:26:05 
UTC+1:

> Hi all,
>
> I would love to be able to make custom directive work with Docxbuilder, 
> but I'm pretty much lost with the topic.
>
> I logged my answer of this SO topic 
> 
>  but 
> was unable to get any valuable answer.
>
> Is this task even possible to do?
>

-- 
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 sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/3d6859e6-592f-4caa-ad4e-2e76c624648cn%40googlegroups.com.