Will's blog

purpose: Will Kahn-Greene's blog of Miro, PyBlosxom, Python, GNU/Linux, random content, PyBlosxom, Miro, and other projects mixed in there ad hoc, half-baked, and with a twist of lemon

[ home | blog home | recent activity ]

Sat, 06 Feb 2010

endash and emdash in Sphinx

PyBlosxom uses Sphinx for documentation now. I was having problems with using -- for em-dash and it not showing up like an em-dash in the HTML output.

The docutils FAQ says to use the actual unicode character for emdash. I don't really want to do that because I'm not sure about what happens when the source files are opened up by a non-unicode-friendly text editor.

Turns out that doesn't matter because Sphinx allows -- for en-dash and --- for em-dash. Is this something that should get added to the Sphinx documentation?

Comments:

Posted by Ben Finney on Sat Feb 6 19:16:16 2010
> I was having problems with using -- for em-dash and it not showing up like an em-dash in the HTML output.

This is, I think, better than writing ‘--’ in the document and having it unexpectedly come out as a different character. Why would I expect the text that I write not to come out as the characters I typed, if the markup specification doesn't say they will?

> The docutils FAQ  says to use the actual unicode character for emdash.

Right. That way, ‘--’, ‘—’, ‘–’ all represent exactly what they are.

> I don't really want to do that because I'm not sure about what happens when the source files are opened up by a non-unicode-friendly text editor.

Unicode is the only feasible way to work with text in the third millennium. Those few non-Unicode-friendly text editors that remain need to be deprecated as soon as possible. They are surely either old (and need to be upgraded) or broken (and need to be fixed or replaced) or both.


Posted by will on Sat Feb 6 19:26:46 2010
I see your points, but I'd rather use --- for em-dash since that's closer to what I expect and it's a lot easier to type when I'm doing documentation.


Post a new comment:

Three things:

  1. New comments get placed in a "draft" status and will NOT show up on the site until I explicitly approve it. Sometimes that happens within 24 hours.
  2. I reserve the right to reject/remove inappropriate comments.
  3. Sometimes I'll reply to a comment directly in email--so make sure your email address is correct.

If you can't for some reason post a comment, send me an email: willg at bluesock dot org.

Your name:


Your e-mail address (this doesn't get displayed to anyone--sometimes I'll reply directly to you):


URL of your website (optional):


Comment:


Yes, I am a human!


pyblosxom::1.5-dev git-master

Copyright 1996 to 2012, Will Guaraldi Kahn-Greene, under the Creative Commons BY-SA 3.0 license

Creative Commons License
Will's Blog by William Kahn-Greene is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.