restructuredtext - how to document a single space character within a string in reST/Sphinx? -
i've gotten lost in edge case of sorts. i'm working on conversion of old plaintext documentation rest/sphinx format, intent of outputting few formats (including html , text) there. of documented functions dealing bitstrings, , common case within these sentence following: starting character blank " " has value 0.
i tried writing inline literal following ways: starting character blank `` `` has value 0.
or starting character blank :literal:` ` has value 0.
there few problems how these end working:
- rest syntax objects whitespace inside of literal, , doesn't recognized.
- the above can "fixed"--it looks correct in html (
) , plaintext (
" "
) output--with non-breaking space character inside literal, technically lie in our case, , if user copied character, wouldn't copying expect. - the space can wrapped in regular quotes, allows literal recognized, , while output in html fine (
" "
), in plaintext ends double-quoted"" ""
. - in both 2/3 above, if literal falls on wrap boundary, plaintext writer (which uses
textwrap
) gladly wrap inside literal , trim space because it's @ start/end of line.
i feel i'm missing something; there way handle this?
try using unicode character codes. if understand question, should work.
here "|space|" , non-breaking space (|nbspc|) .. |space| unicode:: u+0020 .. space .. |nbspc| unicode:: u+00a0 .. non-breaking space
you should see:
here “ ” , non-breaking space ( )
Comments
Post a Comment