I plan to write a command where you select one or more lines and then invoke the command to have it interpret the content and transform it into an AsciiDoc block.
Use Case 1: quotations
If every line follows the pattern of: text enclosed in double-quotes (or typographical ones) immediately followed by an em-dash, double n-dashes, or a tilde, followed by anything that begins with a letter, then each line is converted into a quotation block.
"The cure for boredom is curiosity. There is no cure for curiosity." -- Dorothy Parker
becomes
[quote,Dorothy Parker]
__________________________________________
The cure for boredom is curiosity. There is no cure for curiosity.
__________________________________________
Use Case 2: Comment Blocks
// a whole
// bunch
// of comments
becomes
////
a whole
bunch
of comments
////
Use Case 3: source code
If it can determine that the selected lines are some sort of source code, then it'll enclose it as a source code block.
I plan to write a command where you select one or more lines and then invoke the command to have it interpret the content and transform it into an AsciiDoc block.
Use Case 1: quotations
If every line follows the pattern of: text enclosed in double-quotes (or typographical ones) immediately followed by an em-dash, double n-dashes, or a tilde, followed by anything that begins with a letter, then each line is converted into a quotation block.
"The cure for boredom is curiosity. There is no cure for curiosity." -- Dorothy Parker
becomes
Use Case 2: Comment Blocks
becomes
Use Case 3: source code
If it can determine that the selected lines are some sort of source code, then it'll enclose it as a source code block.
sudo
then it's a bash script.import
orfrom ... import
then it's Python.In all cases, it would unindent the block if every line begins with white space.