diff --git a/texttools.tcl b/texttools.tcl index abc1efc..57d8aa0 100755 --- a/texttools.tcl +++ b/texttools.tcl @@ -1,5 +1,7 @@ #!/usr/bin/env wish +package require textutil + set active_transform 0 proc oneline {text} { @@ -17,6 +19,10 @@ proc wordcount {text} { return $out } +proc dedent {text} { + return [textutil::undent $text] +} + proc markdown_quote {text} { set text [string trimright $text] 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 {Line/Word/Char} wordcount] +lappend transforms [list {Dedent} dedent] lappend transforms [list {Markdown Quote} markdown_quote] wm geometry . 750x650