Sphinx Docs

So we’re adding auto-doc’ing capabilities to Nudge, and I’m in charge of Sphinx docs right now.  They’re a PITA…  One space is off? FFFFFFUUUUUUUUUUUUUUUUUUU.  Yup about that awesome.  They also don’t like having table items be longer than the column separators.  I’m not sure what they’re really called, but they’re the set of = signs used to surround the column headers and the data.  SO, given the varied length data in a table, you have to do some fancy trickery to get them to line up perfectly.  TIL you can multiply a char (C) by an int (N) and get a resulting string of length N filled with C.

"x" * 2 = "xx"
"c"*4 = "cccc"


Fancypants! Any other language and it would probably barf on you saying you can’t multiply things of char type with things of int type.


Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>