User login

formatting

Format code blocks within bulletted lists with ReStructured Text (rst)

The trick is to use the double-colon (::) at the end of the text where you want to introduce the code block with a single colon, and then indent the code block four spaces while only indenting the regular text two spaces. Do this even though you want the non-code lines of text to visually appear at the same indent as the code block and the original introducing line of the bullet.

The following ReStructured Text (ReST) markup, typically put in a .rst file, for example:

Indent lines in Vim

To indent a set of eight lines in vim, from the first one, in normal (esc) mode:

8>>

To indent a curly braces block, go to a curly brace and:

>%

To mark and indent (using 'm' as the marking letter, the first m is the marking command):

Enter mm at the top of block to indent, go down to the end of what needs to be indented, and type >'m

There's more than one way to span a date...

In theory you can put HTML code right into a custom date format declaration. Actually, this did not quite work for some reason... somewhere in class year the code just gave up and pled for mercy.

\<\d\i\v \c\l\a\s\s\="\m"\>M\<\/\d\i\v\>\<\d\i\v \c\l\a\s\s\="\d\y"\>d\<\/\d\i\v\>\<\d\i\v \c\l\a\s\s\="\y\r"\>Y\<\/\d\i\v\>

Syndicate content