User:ArielGlenn/Sandbox

Figuring out some standard formatting for code examples for dumps (and other) knowledge sharing sessions.

Here's a first sample...

This is an example of how not to exit from a python script.

You can see that the author has carefully kept to python style guidelines as far as use of indentation and blank lines, even going so far as to avoid extraneous code in __main__ to avoid pylint errors.

Nonetheless, blah blah blah.



This trick avoids pylint whines about how the constant you were going to define in __main__ doesn't have an approved uppercase name etc. Plus it's polite behavior to have all of your functionality in methods and invoke the ones you want out of __main__ if the script is executed as standalone.

Turn this into two templates:
 * one for everything through the syntaxighlighting tag, with params: number of brs to write if any, link target if you have one, language, highlight if any, start if needed, if syntax is omitted we just use plain text; also allow background color (only good for plain text boxes)
 * second one to close all the tags

Currently if content wraps in the commentary box, it pushes the commentary box a bit to the left into the first column (see second commentary box for example). Need to see why that is.

We might like a max text width for commentary anyways.