Monday, May 11, 2009

No reST for the wicked...

As I dive headlong into the task of converting the Open Book Project materials from lore to reST, I'm getting a feel for what works and what doesn't with reST. I spent the better part of an hour trying to figure out how to put non-breaking spaces into a line block.

I still don't know if there is any sensible way to do that, but I gave up and decided it was better to change my markup to match what is natural to do with reST, rather than to keep trying to bend
reST to my will. I'm finding that after the thrill of learning basic reST with so much ease, the learning curve for non-trivial things is much steeper. I wanted to markup a sample program run, with the user input appearing in italics:
What’s 6 times 7? 49
No, I’m afraid the answer is 42.
What’s 3 times 2? 6
That’s right – well done.
... And so on, with several more questions...
What’s 5 times 9? 45
That’s right – well done.

I asked you 10 questions. You got 7 of them right.
Well done!
In the original LaTeX version, and in the lore version we made from it, the line "And so on, with several more quesitons...", was indented 25 spaces or so, and did not have the leading ellipses. Since character-level inline markup does not work with white space, there is no easy solution to this problem apparent to me. I'll ask Douglas when I see him on irc later today.

No comments:

Post a Comment