Skip to content

SQL Preview document generation

Tako Lee edited this page Apr 27, 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://demo.xicom.in/sql_pretty_printer/

the template of generated html file is here: https://github.com/sqlparser/sql-pretty-printer/blob/master/sqlstyle_document.png

This template is for your reference only, you should try your best to design a professional layout with your skill, this page should be search engine friendly as well.

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
  1. URLs at bottom:
Clone this wiki locally