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:

  1. rest syntax objects whitespace inside of literal, , doesn't recognized.
  2. 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.
  3. the space can wrapped in regular quotes, allows literal recognized, , while output in html fine (" "), in plaintext ends double-quoted "" "".
  4. 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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -