Skip to content

SQL Preview document generation

Tako Lee edited this page Apr 22, 2014 · 16 revisions

Generate a "SQL coding standard and guideline" html document based on sql format options user selected via this web app: sql style: http://www.wangz.net/sqlstyle/

User can set format options one by one, or loading from existing json file.

https://github.com/sqlparser/sql-pretty-printer/blob/master/sqlFormatOption.json

  1. Generate a single html file, css should be included inline, user can download this file.
  2. Use Javascript to generate this html file based on format options.
  3. Structure of this html
  • TOC
    • Including only the first and second level nodes
    • Create css for TOC
  • Main content
    • Create dedicated css for each level node title (From 1st to 5th, 5 CSS for 5 level node, the most frequently used css should the first 3 levels)
    • Create css for "format option area"
    • Create css for "sample sql area" (don't use ace editor in this html document)
    • Sample SQL in the preview area should be fetched dynamically based on current format options from back-end program.
  1. When generating html file, there should be a visual process hint.
  2. Always add those 3 titles at the bottom of TOC
Clone this wiki locally