Le 15/10/2018 à 14:17, kim.wali...@gmail.com a écrit :
Hi,

I am using Sphinx to write French documentation for an internal project at my 
company.
I have set:

|
language ='fr'
|

inside my conf.py but unfortunately this does not enable French language 
punctuation
rules. According to French language punctuation rules there must be a space 
character
in front of every '?' and ':'

Here is an example:

Vous voulez récupérer une version d’un fichier ?

The extra space between 'fichier' and '?' can cause issues when later reading 
the
documentation on the website generated using Sphinx because Sphinx may put a new
line before the '?'. When this happens the text on the website generated using 
Sphinx
looks like this:

Vous voulez récupérer une version d’un fichier
?

So my question is whether there is a setting which prevents this issue i.e. 
prevent
newline characters between '?' and the previous word (and prevent newline 
characters
between ':' and the previous word).


Hi, not sure if this answers your question, but I (usually) use a nobreak space 
U+00A0


(option space on my Mac French keyboard)

Example:

Voici un exemple<U+00A0>:

Vous voulez récupérer une version d’un fichier<U+00A0>?

(where due to Thunderbird converting my pasted U+00A0 I indicate it this way.

Gives in html:

<p>Voici un exemple&nbsp;:</p>
<p>Vous voulez récupérer une version d’un fichier&nbsp;?</p>

I use at times some cumbersome substitution method of insert U+202F (NARROW 
NO-BREAK SPACE)

.. |_| unicode:: 0x202F
   :trim:

I often forget to add the |_| in source and need to do it by search replace) 
but if I recall correctly the reason for |_| is because in my Emacs buffer the 
U+202F is not displayed differently (I use monospace font) than normal space.

Example:


Voici un exemple |_|:

Vous voulez récupérer une version d’un fichier |_|?

which gives:

<p>Voici un exemple :</p>
<p>Vous voulez récupérer une version d’un fichier ?</p>

where the spaces are indeed U+202F.

The substitution method is cumbersome,

You definitely can use U+202F in source and it gives U+202F in output, and at 
least in my testing with current Firefox this is rendered as expected.

(I am using "classic" theme for HTML rendering)

For the guillemets « and » a nobreak space gives the expected spacing for 
French typographical rule (sort of) (anyway, a wider space than the narrow one 
in front of high punctuation)

Best,

Jean-François






--
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 post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to