timetrap_formatters
timetrap_formatters copied to clipboard
html formatter
I am currently thinking of writing a nice little html formatter that also display a few nice graphics on that page using charts.js and pure.css .
The only problem: it would just output the html on the console. Would it be okay if a formatter would store the output in a temporary file and opened a browser instead? The output would be the location of the file and a description on how to configure the browser in the timetrap config file.
That sounds awesome. You might look at the tempfile library (http://www.ruby-doc.org/stdlib-1.9.3/libdoc/tempfile/rdoc/Tempfile.html) for writing the file though it might make sense to put it in a more predictable location. The file location could be configurable using the t configure command.
I can't use the build in tempfile lib because that one will delete the created file when the interpreter shuts down.