dedent transform
This commit is contained in:
parent
1e746fbd72
commit
2aaf3d2106
|
@ -1,5 +1,7 @@
|
||||||
#!/usr/bin/env wish
|
#!/usr/bin/env wish
|
||||||
|
|
||||||
|
package require textutil
|
||||||
|
|
||||||
set active_transform 0
|
set active_transform 0
|
||||||
|
|
||||||
proc oneline {text} {
|
proc oneline {text} {
|
||||||
|
@ -17,6 +19,10 @@ proc wordcount {text} {
|
||||||
return $out
|
return $out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc dedent {text} {
|
||||||
|
return [textutil::undent $text]
|
||||||
|
}
|
||||||
|
|
||||||
proc markdown_quote {text} {
|
proc markdown_quote {text} {
|
||||||
set text [string trimright $text]
|
set text [string trimright $text]
|
||||||
return [string cat "> " [regsub -all \n $text "\n> "]]
|
return [string cat "> " [regsub -all \n $text "\n> "]]
|
||||||
|
@ -24,6 +30,7 @@ proc markdown_quote {text} {
|
||||||
|
|
||||||
lappend transforms [list {One line} oneline]
|
lappend transforms [list {One line} oneline]
|
||||||
lappend transforms [list {Line/Word/Char} wordcount]
|
lappend transforms [list {Line/Word/Char} wordcount]
|
||||||
|
lappend transforms [list {Dedent} dedent]
|
||||||
lappend transforms [list {Markdown Quote} markdown_quote]
|
lappend transforms [list {Markdown Quote} markdown_quote]
|
||||||
|
|
||||||
wm geometry . 750x650
|
wm geometry . 750x650
|
||||||
|
|
Loading…
Reference in a new issue