From f0ce2c71743058e27427b326f6e5efb916c7d64e Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Tue, 3 Jan 2012 17:04:01 -0600 Subject: [PATCH] Documentation expanded. Started v1.4 * Expanded README.md * Fixed typos in documentation * Started on an inline CSS for inline output. --- README.md | 33 +++++++++- project.properties | 6 +- resources/main/css/inline.css | 75 ++++++++++++++++++++++ resources/main/css/jlp.css | 3 +- src/main/com/jdblabs/jlp/JLPMain.groovy | 2 +- src/main/com/jdblabs/jlp/JLPPegParser.java | 2 +- 6 files changed, 112 insertions(+), 9 deletions(-) create mode 100644 resources/main/css/inline.css diff --git a/README.md b/README.md index 650ee29..bd0ed86 100644 --- a/README.md +++ b/README.md @@ -23,13 +23,13 @@ but was more full-featured. To that end, JLP currently features: default settings for several languages. Ultimately I hope to cover most of the common programming languages. -This project is in its infancy and some of the larger goals are still unmet: - * *Syntax highligting.* All code blocks will be highlighted according to the language they are written in. +This project is in its infancy and some of the larger goals are still unmet: + * *Code awareness.* JLP will understand the code it is processing. This will require building @@ -66,7 +66,24 @@ This project is in its infancy and some of the larger goals are still unmet: The Processor processes one batch of input files to create a set of output files. It holds the intermediate state needed by the generators and coordinates the - work of the parsers and generators for each of the input files. + work of the parsers and generators for each of the input files. This + processor only generates HTML documentation and will likely be renamed in + the future to reflect this. + +* [JLPBaseGenerator](jlp://jlp.jdb-labs.com/JLPBaseGenerator) + + The Generator processes one input file. It parses the AST for the input file + and emits the final documentation for the file. JLPBaseGenerator + implementations are expected to be tightly coupled to Processor + implementations. + +* [LiterateMarkdownGenerator](jlp://jlp.jdb-labs.com/LiterateMarkdownGenerator) + + This implemetation of JLPBaseGenerator generates literate-style + documentation (as opposed to API-style), using [Markdown] to format the + documentation blocks. + + [Markdown]: http://daringfireball.net/projects/markdown/ ## Parsing @@ -74,6 +91,16 @@ This project is in its infancy and some of the larger goals are still unmet: A very simple interface for parsing JLP input. +* [JLPPegParser](jlp://jlp.jdb-labs.com/JLPPegParser) + + A [PEG parser] implemented using the [parboiled] library. This is the + default source code parser. It is able to parse JLP documentation but leaves + code unparsed. It can be parameterized to fit the differing documentation + styles of source languages. + + [PEG parser]: http://en.wikipedia.org/wiki/Parsing_expression_grammar + [parboiled]: http://www.parboiled.org + ## Abstract Syntax Tree * [SourceFile](jlp://jlp.jdb-labs.com/ast/SourceFile) diff --git a/project.properties b/project.properties index ae09524..b415bc3 100644 --- a/project.properties +++ b/project.properties @@ -1,7 +1,7 @@ -#Mon, 02 Jan 2012 20:27:05 -0600 +#Tue, 03 Jan 2012 14:03:49 -0600 name=jlp -version=1.3 -build.number=1 +version=1.4a +build.number=18 lib.local=true release.dir=release main.class=com.jdblabs.jlp.JLPMain diff --git a/resources/main/css/inline.css b/resources/main/css/inline.css new file mode 100644 index 0000000..9d151d9 --- /dev/null +++ b/resources/main/css/inline.css @@ -0,0 +1,75 @@ +body { + font-family: 'Palatine Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; + font-size: 15px; + line-height: 22px; + color: #252519; + margin: 0; + padding 0; } + +a { color: #261a3b; } +a:visited { color: #261a3b; } + +p{ margin: 0 0 15px 0; } + +h1, h2, h3, h4, h5, h6 { margin: 0 0 15px 0; } + +h1 { margin-top: 40px; } + +dt { font-weight: bold; } + +ul { + margin: 0; + padding-top: 0; } + +#container { + background-color: white; + border-left: thin solid #aaa; + border-right: thin solid #aaa; + min-width: 600px; + max-width: 960px; + margin-left: auto; + margin-right: auto; + margin-top: 0; + padding: 1rem; + position: relative; } + +.jlp-docs { + color: #464; + max-width: 600px; + margin-top: 0.5rem; } + +.jlp-code { + margin-top: -1rem;} + +.jlp-docs pre { + background: #f8f8ff; + border: 1px solid #dedede; + margin: 15px 0 15px; + padding-left: 15px; } + +.jlp-docs tt, .jlp-docs code { + background: #f8f8ff; + border: 1px solid #dedede; + font-size: 12px; + padding: 0 0.2em; } + +/* No border for code tags already inside pre tags. */ +.jlp-docs pre > code { + border: 0; } + +.jlp-docs table { + border: thin solid #dedede; + margin-left: 60px; } + +td.code, th.code { + padding: 14px 15px 16px 25px; + width: 100%; + vertical-align: top; + border-left: 1px solid #e5e5ee; + font-size: 14px; } + +pre, tt, code { + font-size: 12px; + line-height: 18px; + font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace; + margin: 0; padding: 0; } diff --git a/resources/main/css/jlp.css b/resources/main/css/jlp.css index 07e9f90..535d265 100644 --- a/resources/main/css/jlp.css +++ b/resources/main/css/jlp.css @@ -56,7 +56,8 @@ td.code, th.code { padding: 14px 15px 16px 25px; width: 100%; vertical-align: top; - border-left: 1px solid #e5e5ee; } + border-left: 1px solid #e5e5ee; + font-size: 14px; } pre, tt, code { font-size: 12px; diff --git a/src/main/com/jdblabs/jlp/JLPMain.groovy b/src/main/com/jdblabs/jlp/JLPMain.groovy index b74e70c..b0a8f0a 100644 --- a/src/main/com/jdblabs/jlp/JLPMain.groovy +++ b/src/main/com/jdblabs/jlp/JLPMain.groovy @@ -18,7 +18,7 @@ import org.slf4j.LoggerFactory */ public class JLPMain { - public static final String VERSION = "1.3" + public static final String VERSION = "1.4" private static Logger log = LoggerFactory.getLogger(JLPMain.class) diff --git a/src/main/com/jdblabs/jlp/JLPPegParser.java b/src/main/com/jdblabs/jlp/JLPPegParser.java index 71460de..0fe3145 100644 --- a/src/main/com/jdblabs/jlp/JLPPegParser.java +++ b/src/main/com/jdblabs/jlp/JLPPegParser.java @@ -90,7 +90,7 @@ public class JLPPegParser extends BaseParser implements JLPParser { * * Pushes a [`SourceFile`] node on the stack. * - * [`SourceFile`}: jlp://jlp.jdb-labs.com/ast/SourceFile + * [`SourceFile`]: jlp://jlp.jdb-labs.com/ast/SourceFile */ public Rule SourceFile() { return Sequence(