Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HTML report output for cli #6

Open
rbuckton opened this issue Jun 17, 2015 · 0 comments
Open

Add HTML report output for cli #6

rbuckton opened this issue Jun 17, 2015 · 0 comments
Assignees
Milestone

Comments

@rbuckton
Copy link
Owner

Add support for a html report output in the grammarkdown cli:

grammarkdown source.grammar --format html

This would have the following characteristics:

  • Grammar emit to a <dl> (HTML definition list).
    • LHS of each production emit as a <dt> (HTML definition term).
      • id attribute for hyperlink navigation using url fragments (e.g. #Identifier).
      • Identifier as a <var> (HTML variable).
      • Identifier linked via <a> (HTML anchor/link) to an index at the end of the report.
    • Production Parameters linked via <a> (HTML anchor/link) to an index at the end of the report.
    • RHS of each production emit as a <dd> (HTML definition)
      • id attribute for hyperlink navigation using url fragments (e.g. #Identifier-AlternateId).
    • Each Nonterminal is enclosed in a <var> (HTML variable) element.
    • Each Nonterminal is linked via <a> (HTML anchor/link) to the first instance of the declaring production.
    • Nonterminal arguments linked via <a> to the first instance of the declaring parameter.
    • Each Terminal is enclosed in a <kbd> (HTML keyboard input) element.
  • Index following the grammar:
    • Entries for each Nonterminal used in the grammar.
    • Unordered list of each production in which the Nonterminal is used.

Example:

<section id="grammar">
<h1>Grammar</h1>
<dl class="grammar">
  ...
  <dt id="ImportDeclaration">
    <var><a href="#index-ImportDeclaration">ImportDeclaration</a></var>
  </dt>
  <dd id="ImportDeclaration-ade9f438">
    <span>
      <kbd>import</kbd>
      <var><a href="#ImportClause">ImportClause</a></var>
      <var><a href="#FromClause">FromClause</a></var>
      <kbd>;</kbd>
    </span>
  </dd>
  <dd>
    <span>
      <kbd>import</kbd>
      <var><a href="#ModuleSpecifier">ModuleSpecifier</a></var>
      <kbd>;</kbd>
    </span>
  </dd>

  <dt id="ImportClause">
    <var><a href="#index-ImportClause">ImportClause</a></var>
  </dt>
  ...
</dl>
</section>

<section id="index">
<h1>Index</h1>
<dl class="index">
  <dt id="index-ImportClause">
    <var><a href="#ImportClause">ImportClause</a></var>
  </dt>
  <dd>
    <var><a href="#ImportDeclaration">ImportDeclaration</a></var> : 
    <span>
      <kbd>import</kbd>
      <var>ImportClause</var>
      <var><a href="#FromClause">FromClause</a></var>
      <kbd>;</kbd>
    </span>
  </dd>
  ...
</dl>
</section>
@rbuckton rbuckton added this to the 1.0.0 milestone Oct 5, 2015
@rbuckton rbuckton self-assigned this Oct 5, 2015
@rbuckton rbuckton modified the milestones: 1.1.0, 1.0.0 Feb 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant