Version 4 of EasyTextPrint

Updated 2016-02-07 00:11:08 by HJG

if 0 {


Summary

HJG 2016-02-02: This is another attempt at quick, easy, ad-hoc printing of simple textfiles.

I often have some informations in a textfile, and if I need to print that, I want a nice looking page,
e.g. with a few headers, some text in bold etc., but I don't want to use an 'Office'-textprocessor for that.

The idea is to convert that textfile to a html-file, then print that with the webbrowser.

The basic operation of that converter is to copy the inputfile x.txt to x.html,
add some lines like "<html>" "<head>", "<body>" etc. and wrap the first line of text in <h1>-tags.
Also, replace some chars (like &, <, >) with html-entities.

Then I can drop the resulting file x.html into the browser and print.
Or, with a fixed location for the output-file, use a bookmark in the browser.

Add some CSS to taste, and extent the converters "basic operation" to cover more markup, as need arises.

There are some programs available that work like that, e.g. Markdown.
But Markdown uses Perl, and I want even more minimal markup.


With ideas and code from the following pages:

}


Code

 # EasyTextPrint001.tcl - HaJo Gurt - 2016-02-02
 # http://wiki.tcl.tk/42409

  puts "EasyTextPrint:"
  set i 0
  foreach s { foo bar grill }  { incr i; puts "$i $s" }

...

 ### EOF ###

Comments

...


See also:

  • ...