Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-611

Pretty printer/code layout/reformat/minify

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • Engine
    • None
    • Cross platform

    Description

      I've always wanted to be able to re-layout a piece of generated text. It was a dream of mine since I was a little boy

      Even if you generate HTML most of the time the result is pretty ugly(not readable) and when it came to generating code(like Java, JavaScript, etc) is really important to have readable code.Especially when your trying to "debug" something, it is a lot easier to locate the problem with a "pretty" content layout.

      In case of JavaScript it is even more problematic, because different browsers can fail parsing generated JavaScript just because some separators are not on the same line. Of course you can generate your pages, copy the code in http://www.jslint.com/ and validate your code but is kind of .. not handy.Or you could even compress your generated JavaScript(or HTML) to have a smaller content or obfuscate your code a little bit.

      I'm pretty sure these needs are not only mine, so if somebody out there already have something (already) implemented(and it can be open sourced) or even suggestions about which library to use(I expect we could re-use some of the existing libraries to do pretty-print, at least HTML, XML it can be done pretty easy and not so easy with JS or Java) please let me know.

      I'm planning to create a public project to host this project and any suggestions are welcomed. The library will be designed to be independent of Velocity, so other template libraries could benefit of this work.

      Thanks.

      Attachments

        Activity

          People

            Unassigned Unassigned
            adrian.tarau Adrian Tarau
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: