Skip to content

Oxyd/cxxdraft-htmlgen

 
 

Repository files navigation

Introduction

  genhtml parses the LaTeX sources of the draft, and generates
  an HTML version, with figures embedded as inline SVG, and
  math formulas as LaTeX-rendered PNG images.

Prerequisites

  - various Hackage packages
  - graphviz
  - dvipng
  - git
  - latex

Usage

  First, follow the draft package instructions to build the pdf.
  As a side effect, this generates std-gram.ext, which we need.

  Then, do:

    runhaskell genhtml.hs path/to/draft [sectionfilestyle]

  Where sectionfilestyle is one of:

    Bare            (to generate e.g. intro.execution)
    WithExtension   (to generate e.g. intro.execution.html)
    InSubdir        (to generate e.g. intro.execution/index.html)

  The default is WithExtension, since this is suitable
  for direct browsing on a filesystem without a web server.

  Bare may be used in conjunction with web server configuration
  specifying a default text/html mime type for the directory
  containing the section pages, to get URLs such as:

    temp.res#temp.dep
    temp.dep#3

  InSubdir only requires defaulting to index.html, to give:

    temp.res/#temp.dep
    temp.dep/#3

Output

  The following will be created in ./14882/ :

  - index.html    A table of contents with links to...

  - ~1660 interlinked section pages

    These are named after the section abbreviation, which for
    the Bare section file style look like:

      stmt.goto
      class.member.lookup
      cpp
      iterator.requirements.general
      locale.moneypunct.virtuals

    Since sections nest, content is duplicated at every level.
    This allows one to specify more or less context for a given
    section or paragraph citation. For example, one can link to:

      temp.dep            (section 14.6.2 "Dependent names")

      temp.res#temp.dep   (the same section highlighted on the
                           page for section 14.6 "Name resolution")

      temp#temp.dep       (the same section highlighted on the
                           page for chapter 14 "Templates")

      full#temp.dep       (see below)

  - full         ~6 mbyte, the entire draft.

  - 14882.css    Used by all of the above.

  - math/        Subdirectory with .png images containing rendered
                 mathematical formulas.

Todo

  - list required hackage packages in prereqs
  - different kinds of enumeration
  - fix links to tables on other pages
  - very long section names screw up layout
  - the examples in temp.deduct.call#6 are not recognized as paragraphs, and so #11 is accidentally #7
  - table meta.unary.prop#tab:type-traits.properties is horribly wide due to lack of hyphenation
  - reparseCode mistakenly thinks there is a code comment in the example in path.gen#1
  - put note/example prefixes/suffixes in inline-block so the whitespace within
    them doesn't get stretched (will require recognizing note/example environments)
  - lex.charset#2 has an unwanted space in "the universal-character-name \ UNNNNNNNN is that character"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Haskell 94.8%
  • CSS 5.2%