From 317ac1229c2c44f0fd4761d92d5f7341a2b52839 Mon Sep 17 00:00:00 2001 From: John Morrice Date: Tue, 3 Aug 2010 12:29:25 +0100 Subject: [PATCH] Added simple README --- snm_help.html | 2 +- snm_help/abuse.yaml | 6 +++++- snm_help/how/inline.yaml | 2 +- snm_help/how/inline/syntax.yaml | 18 ++++++++++++++++++ snm_help/how/paragraphs.yaml | 4 ++-- snm_help/how/syntax.yaml | 8 ++++++++ snm_help/syntax.yaml | 9 +++++++++ 7 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 snm_help/how/inline/syntax.yaml create mode 100644 snm_help/syntax.yaml diff --git a/snm_help.html b/snm_help.html index 189dbef..24cbd30 100644 --- a/snm_help.html +++ b/snm_help.html @@ -15,4 +15,4 @@ } body {font: arial; font-family: sans;} .boring {font-weight: bold} -

The Simple Nice-Looking Manual Generator

Copyright John Morrice 2010

Contact spoon@killersmurf.com

This document is released under the terms of the GNU Free Documentation License. See the file DOC-COPYING for details

All snm source code is released under the terms of the GNU General Public Licence Version 3. See the file COPYING for details.

The Simple Nice-Looking Manual Generator - A.K.A snm - generates nice looking manuals from YAML files.

Currently, it can produce XHTML and text manuals.

snm is hosted on github.

The sources for this manual are also in that repository, in the snm_help directory.

Contents:

1. What snm does and is
2. What snm does not do and is not
3. Building snm
   3.1. The Easy Way
   3.2. The Hard Way
   3.3. Install snm to /usr/bin
4. Invoking snm
5. How to use snm
   5.1. header.yaml
   5.2. Sections
      5.2.1. Subsections
   5.3. Paragraphs
   5.4. Banners
   5.5. Inline Elements
      5.5.1. Hyperlinks
      5.5.2. Literal text
      5.5.3. Inline classes
   5.6. Style: CSS
   5.7. Syntax Highlighting
6. Further help, misuse and shortfalls

snm allows you to write clean, web-friendly reports, user guides and manuals without having to edit fickle html.

snm allows you to structure your document in a modular fashion.

snm document sections are written in yaml and are easy to write and understand.

snm is a generator of small, valid xhtml files.

snm is not (currently) a man-page generator.

snm is not a web-page creator

snm is not a gui based tool

snm is not an adult activity.

First, install libsyck.

Then choose to proceed to build snm in either The Easy Way or The Hard Way.

The hard way is presented to give more information to people who may need it. The Easy Way is recommended for absolutely everyone else!

First install The Haskell Platform.

Then just do:

cabal install snm

Now install snm to /usr/bin

To build snm the hard way, you must install:

The Glasgow Haskell Compiler. snm has been tested with GHC 6.10.4

And from Hackage, the following libraries

base>=4, parsec>=3, filepath, directory, containers, HsSyck, safe, SpoonsUtilities, xhtml

Download the source distribution of snm from github

cd into its directory.

Run:

   cabal install

Now install snm to /usr/bin

cabal install typically installs snm into your local cabal directory, usually ~/.cabal/bin/snm

So you'll probably need to:

   sudo cp ~/.cabal/bin/snm /usr/bin

Now, try to invoke snm

Once it is installed, try invoking snm with

   snm --help

If it was successfully installed, you will see some helpful information and a list of snm's command line options:

   snm: The Simple Nice-Looking Manual Generator 
 
   usage:  
      snm documentation_source_directory options* 
 
   Where options* stands for zero or more of the options below. 
 
   Note: 
      Only one output format is permitted per invocation. 
      If -d or --dump is used, snm will not write a file unless -o or  
      --output is  used. 
      There can be no whitespace between -o and its argument, nor can 
      there be whitespace between --output= and its argument. 
      If no arguments are given to -o, then the file written will have  
      the same filename as the documentation source directory, with an  
      appropriate extension added. 
      snm will always add an appropriate extension to output files. 
      By default, snm will produce xhtml, and act as if the user had  
      specified -o without an argument. 
 
      -d               --dump                  Print output to stdout. 
      -o[A file name]  --output[=A file name]  Write output to a file.   
                                               Multiple outputs ignored,  
                                               printing warning to  
                                               stderr. 
      -h               --help                  Print usage information 
      -t               --text, --txt           Text output. 
      -x               --xhtml, --html         Output in xhtml format.

snm generates a manual from a number of yaml files, held in a documentation source directory. In the snm source distribution, this directory is called 'snm_help'.

This source directory must contain a file called 'header.yaml'. The next sub-section deals with what you put in header.yaml, and what it means.

The header file has 1 required field:

   title: A  banner, the title of the manual.

The header file has 2 optional fields:

   banners: Zero or more  banners, used to announce important things at the start of a manual, for example, its author.  
   preamble: Zero or more  paragraphs, which are not included in the manual's  contents.

For example, here is a slightly simplified version of the header.yaml file for this document:

   title: "The Simple Nice-Looking Manual Generator" 
   banners: 
      - "Copyright John Morrice 2010" 
      - "Contact spoon@killersmurf.com" 
   preamble: 
      - "This document is released under the terms of the GNU Free Documentation License. See the file  DOC-COPYING for details" 
      - "All snm source code is released under the terms of the GNU General Public Licence Version 3.  See the file  COPYING for details." 
      - "The Simple Nice-Looking Manual Generator - A.K.A snm - generates nice looking manuals from  YAML files." 
      - "Currently, it can produce XHTML and text manuals."

You can see how snm processes this by looking at the top of the document.

When emitting xhtml, the notices displayed at the top of the page are automatically given the css class 'banner'.

An snm manual, much like other structured documents, is arranged into heirarchical sections and subsections.

Top level sections are described by yaml files in the documentation source directory.

A section file in the top directory can be given any filename, other than header.yaml and style.css which are reserved. This restriction does not apply to subsections.

Each section has 4 required fields:

   title: A  banner, the title of the section.  This section's title is 'Sections' 
   number: the number of the section.  This section's number is 2. 
   unique: A one-word, unique identifier for this section.  This is used in constructing  hyperlinks
   text: Zero or more  paragraphs.

For a concrete example, here is the beginning of the section file for this section.

   title: Sections 
   number: 2 
   unique: sections 
   text: 
      - 'An snm manual, much like other structured documents, is arranged into heirarchical sections...

A section is associated with subsections when the subsection files are located in a directory which has the same filename (excluding extensions) as its section file, in its same directory.

For example, here is a partial listing of this manual's source directory, snm_help:

   snm_help: 
      header.yaml 
      how 
      how.yaml 
      ...more files

Note the file 'how.yaml'. This is the file describing section 3, How to use snm, of this document.

Note also the directory called how. This directory contains the subsections associated with how.yaml. Inside the how directory:

   snm_help/how: 
      section 
      section.yaml 
      ...more files

Note the 'section.yaml' file, which describes section 3.2, Sections and its associated subsection directory 'section'.

Inside the section directory:

   snm_help/how/section: 
      subsection.yaml

how/section/subsection.yaml is the file describing this section.

A subsection's number is automatically computed by snm. Hence, according to the file describing this section, this section's number is 1. snm has discovered it is nested within section 3.2. It is an error to specify a subsection's whole number within a section file. Specify one number only!

When a sequence of paragraphs is called for in a manual yaml file, either a single text element, or a yaml sequence is expected.

Paragraphs are not just plain text: they may contain inline elements like hyperlinks or literal text.

In a produced manual, a series of paragraphs are rendered with two line breaks between each of them. This corresponds to two newline characters in a text document, and being within a <p> tag in an html document. An example:

   This is a valid, although boring, paragraph.

Paragraphs can be associated with a class, using a yaml map. When rendering xhtml documents, this class is becomes the value of the class attribute for the paragraph produced. This is useful when working using a style sheet. An example:

   class: curved_corner 
   text: This paragraph is a bit more exciting, because it is being given curved corners by css!

Word wrapping can be turned on or off on a paragraph basis, by setting wrap to True or false in a map paragraph. When emitting xhtml, if wrap is off, then all spaces are replaced by &nbsp; and all new-lines replaced by <br/>. By default wrapping is on. Example:

This paragraph...

   wrap: False 
   text: "Hey ho, 
          \n  let's go!"

Is rendered as:

   "Hey ho, 
        let's go!"

But this paragraph...

   wrap: True 
   text: "Hey ho, 
          \n  let's go!"

And this paragraph...

   "Hey ho, 
    \n  let's go!"

Are rendered as:

   Hey ho, let's go!

Paragraphs can also be associated with a formal language. This will trigger syntax highlighting.

An example:

   language: math 
   text: "forall A forsome B [A memberof C B memberof C . A + B ]"

Is rendered as:

   forall A forsome B [A memberof C B memberof C . A + B ]

Banners appear at the top of the manual, and at the beginning of sections.

Banners may contain inline elements in the same manner as a paragraph.

Banner defined in the header file are, by default, given the class 'intro_banner'. Banners defined in sections are given the class 'banner'.

The default banner classes can be replaced by user defined classes, in the same manner that a class can be assigned to a paragraph.

Inline elements within paragraphs and banners allow more expressive text. The idea of an inline snm element is roughly equivalent to an inline HTML element. Much as an xhtml anchor can only appear within an xhtml block element, an inline element can only appear within an snm paragraph or banner.

Inline elements appear within curly braces { }.

If you need to actually write an opening brace in your document, the opening brace may be escaped with a backslash \.

The following inline elements are available: section links, external links, inline classes, inline languages and literal text.

snm supports two types of links.

Section links are hyperlinks to a section of the document, using that section's unique name.

External links are a more traditional link to a URL.

As an inline element, links begin with an opening curly brace {.

Then either the word 'section', which indicates a section link, or the word 'external' which indicates an external link.

Then the link text. This may consist of a number of words separated by whitespace.

Then the destination. No explicit syntax separates the link text from the destination - the last word is taken to be the destination. Obviously, section links expect a section's unique name, whereas external links expect a URL.

As with all inline elements, a link is closed with a curly brace }.

Whitespace is optional throughout links.

Examples:

The link above, which is a section link to the unique identifier 'sections':

   {section section of the document sections}

The external link in section 3.3 Paragraphs, to the 'YAML in Five Minutes' tutorial

   {external sequence http://yaml.kwiki.org/index.cgi?YamlInFiveMinutesMinuteOne}

Literal text can be specified through the literal inline element.

Literal text is not processed or transformed by snm: it is output directly into the output document.

This is risky because allows it you to write invalid xhtml, for instance; but it does allow you to write html that snm does not generate.

However, this approach suffers from many problems and is very much a working solution for current needs. Problems are discussed below.

Example:

   {literal <table><td>Embed a html table</td></table>}

snm supports inline classes. This allows a section of text to have a different style to the rest of the text block.

An inline class in an inline element beginning with the word class, and lasting until the closing brace.

An example:

   class: quote 
   text: "Don't make me angry. You wouldn't like me when I'm angry" {class -- David Banner, The Incredible Hulk, 1978. aside}

The text within the class element is assigned the class 'aside', allowing it to be rendered differently from the rest of the paragraph.

In the xhtml renderer, an inline class element:

   {class the text goes here x}

Corresponds to a span element thus:

   <span class="x">the text goes here</span> 

When generating xhtml, snm will look for a file called 'style.css' in the documentation source directory, and embed the contents of that file into the document's header as a CSS style sheet.

snm supports extensible syntax highlighting through dynamically loaded plugins.

Once a highlighting plugin is set up for a language, the language may be used in a paragraph or in an inline language element

Syntax highlighting is configured through the top-level syntax.yaml file.

This file contains either a syntax map, or a sequence of such maps.

The syntax map has four elements:

language: The name of the language. It gives a name to the syntax highlighter in the document.

package: The name of the Haskell package providing the plugin. Version number included.

module: The name of the module providing the plugin.

symbol: The name of the plugin.

Syntax plugins must have type Dynamic. However, this type must have been constructed from a SyntaxHighlighter, defined in snm's Manual.Structure.

snm provides a module Text.Syntax.Simple which makes it easy to write keyword-oriented syntax highlighters.

Be aware that snm will not html escape strings returned by the syntax highlighter. Text.XHtml.Strict.stringToHtmlString from the xhtml package may be useful.

As an example, here is this document's syntax.yaml:

If you use snm and need more help than is available in this manual then do not hesitate to contact the author at spoon@killersmurf.com.

Please note that snm suffers from a number of shortfalls:

Invalid xhtml can be generated through manipulation of the style sheet, literal text, link destinations, and the unique names of sections.

While I regret that this is possible, attempting xhtml kludges through these means ill-fitting means is misuse of snm and may result in generation shoddy manuals, a telling off and early bed-times all around. You have been warned!

\ No newline at end of file +

The Simple Nice-Looking Manual Generator

Copyright John Morrice 2010

Contact spoon@killersmurf.com

This document is released under the terms of the GNU Free Documentation License. See the file DOC-COPYING for details

All snm source code is released under the terms of the GNU General Public Licence Version 3. See the file COPYING for details.

The Simple Nice-Looking Manual Generator - A.K.A snm - generates nice looking manuals from YAML files.

Currently, it can produce XHTML and text manuals.

snm is hosted on github.

The sources for this manual are also in that repository, in the snm_help directory.

Contents:

1. What snm does and is
2. What snm does not do and is not
3. Building snm
   3.1. The Easy Way
   3.2. The Hard Way
   3.3. Install snm to /usr/bin
4. Invoking snm
5. How to use snm
   5.1. header.yaml
   5.2. Sections
      5.2.1. Subsections
   5.3. Paragraphs
   5.4. Banners
   5.5. Inline Elements
      5.5.1. Hyperlinks
      5.5.2. Literal text
      5.5.3. Inline classes
      5.5.4. Inline Syntax Highlighting
   5.6. Style: CSS
   5.7. Syntax Highlighting
6. Further help, misuse and shortfalls

snm allows you to write clean, web-friendly reports, user guides and manuals without having to edit fickle html.

snm allows you to structure your document in a modular fashion.

snm document sections are written in yaml and are easy to write and understand.

snm is a generator of small, valid xhtml files.

snm is not (currently) a man-page generator.

snm is not a web-page creator

snm is not a gui based tool

snm is not an adult activity.

First, install libsyck.

Then choose to proceed to build snm in either The Easy Way or The Hard Way.

The hard way is presented to give more information to people who may need it. The Easy Way is recommended for absolutely everyone else!

First install The Haskell Platform.

Then just do:

cabal install snm

Now install snm to /usr/bin

To build snm the hard way, you must install:

The Glasgow Haskell Compiler. snm has been tested with GHC 6.10.4

And from Hackage, the following libraries

base>=4, parsec>=3, filepath, directory, containers, HsSyck, safe, SpoonsUtilities, xhtml

Download the source distribution of snm from github

cd into its directory.

Run:

   cabal install

Now install snm to /usr/bin

cabal install typically installs snm into your local cabal directory, usually ~/.cabal/bin/snm

So you'll probably need to:

   sudo cp ~/.cabal/bin/snm /usr/bin

Now, try to invoke snm

Once it is installed, try invoking snm with

   snm --help

If it was successfully installed, you will see some helpful information and a list of snm's command line options:

   snm: The Simple Nice-Looking Manual Generator 
 
   usage:  
      snm documentation_source_directory options* 
 
   Where options* stands for zero or more of the options below. 
 
   Note: 
      Only one output format is permitted per invocation. 
      If -d or --dump is used, snm will not write a file unless -o or  
      --output is  used. 
      There can be no whitespace between -o and its argument, nor can 
      there be whitespace between --output= and its argument. 
      If no arguments are given to -o, then the file written will have  
      the same filename as the documentation source directory, with an  
      appropriate extension added. 
      snm will always add an appropriate extension to output files. 
      By default, snm will produce xhtml, and act as if the user had  
      specified -o without an argument. 
 
      -d               --dump                  Print output to stdout. 
      -o[A file name]  --output[=A file name]  Write output to a file.   
                                               Multiple outputs ignored,  
                                               printing warning to  
                                               stderr. 
      -h               --help                  Print usage information 
      -t               --text, --txt           Text output. 
      -x               --xhtml, --html         Output in xhtml format.

snm generates a manual from a number of yaml files, held in a documentation source directory. In the snm source distribution, this directory is called 'snm_help'.

This source directory must contain a file called 'header.yaml'. The next sub-section deals with what you put in header.yaml, and what it means.

The header file has 1 required field:

   title: A  banner, the title of the manual.

The header file has 2 optional fields:

   banners: Zero or more  banners, used to announce important things at the start of a manual, for example, its author.  
   preamble: Zero or more  paragraphs, which are not included in the manual's  contents.

For example, here is a slightly simplified version of the header.yaml file for this document:

   title: "The Simple Nice-Looking Manual Generator" 
   banners: 
      - "Copyright John Morrice 2010" 
      - "Contact spoon@killersmurf.com" 
   preamble: 
      - "This document is released under the terms of the GNU Free Documentation License. See the file  DOC-COPYING for details" 
      - "All snm source code is released under the terms of the GNU General Public Licence Version 3.  See the file  COPYING for details." 
      - "The Simple Nice-Looking Manual Generator - A.K.A snm - generates nice looking manuals from  YAML files." 
      - "Currently, it can produce XHTML and text manuals."

You can see how snm processes this by looking at the top of the document.

When emitting xhtml, the notices displayed at the top of the page are automatically given the css class 'banner'.

An snm manual, much like other structured documents, is arranged into heirarchical sections and subsections.

Top level sections are described by yaml files in the documentation source directory.

A section file in the top directory can be given any filename, other than header.yaml and style.css which are reserved. This restriction does not apply to subsections.

Each section has 4 required fields:

   title: A  banner, the title of the section.  This section's title is 'Sections' 
   number: the number of the section.  This section's number is 2. 
   unique: A one-word, unique identifier for this section.  This is used in constructing  hyperlinks
   text: Zero or more  paragraphs.

For a concrete example, here is the beginning of the section file for this section.

   title: Sections 
   number: 2 
   unique: sections 
   text: 
      - 'An snm manual, much like other structured documents, is arranged into heirarchical sections...

A section is associated with subsections when the subsection files are located in a directory which has the same filename (excluding extensions) as its section file, in its same directory.

For example, here is a partial listing of this manual's source directory, snm_help:

   snm_help: 
      header.yaml 
      how 
      how.yaml 
      ...more files

Note the file 'how.yaml'. This is the file describing section 3, How to use snm, of this document.

Note also the directory called how. This directory contains the subsections associated with how.yaml. Inside the how directory:

   snm_help/how: 
      section 
      section.yaml 
      ...more files

Note the 'section.yaml' file, which describes section 3.2, Sections and its associated subsection directory 'section'.

Inside the section directory:

   snm_help/how/section: 
      subsection.yaml

how/section/subsection.yaml is the file describing this section.

A subsection's number is automatically computed by snm. Hence, according to the file describing this section, this section's number is 1. snm has discovered it is nested within section 3.2. It is an error to specify a subsection's whole number within a section file. Specify one number only!

When a sequence of paragraphs is called for in a manual yaml file, either a single text element, or a yaml sequence is expected.

Paragraphs are not just plain text: they may contain inline elements like hyperlinks or literal text.

In a produced manual, a series of paragraphs are rendered with two line breaks between each of them. This corresponds to two newline characters in a text document, and being within a <p> tag in an html document. An example:

   This is a valid, although boring, paragraph.

Paragraphs can be associated with a class, using a yaml map. When rendering xhtml documents, this class is becomes the value of the class attribute for the paragraph produced. This is useful when working using a style sheet. An example:

   class: curved_corner 
   text: This paragraph is a bit more exciting, because it is being given curved corners by css!

Word wrapping can be turned on or off on a paragraph basis, by setting wrap to True or false in a map paragraph. When emitting xhtml, if wrap is off, then all spaces are replaced by &nbsp; and all new-lines replaced by <br/>. By default wrapping is on. Example:

This paragraph...

   wrap: False 
   text: "Hey ho, 
          \n  let's go!"

Is rendered as:

   "Hey ho, 
        let's go!"

But this paragraph...

   wrap: True 
   text: "Hey ho, 
          \n  let's go!"

And this paragraph...

   "Hey ho, 
    \n  let's go!"

Are rendered as:

   Hey ho, let's go!

Paragraphs can also be associated with a formal language. This will trigger syntax highlighting.

An example:

   language: math 
   text: "forall A. A !member empty"

Is rendered as:

    A. A  

Banners appear at the top of the manual, and at the beginning of sections.

Banners may contain inline elements in the same manner as a paragraph.

Banner defined in the header file are, by default, given the class 'intro_banner'. Banners defined in sections are given the class 'banner'.

The default banner classes can be replaced by user defined classes, in the same manner that a class can be assigned to a paragraph.

Inline elements within paragraphs and banners allow more expressive text. The idea of an inline snm element is roughly equivalent to an inline HTML element. Much as an xhtml anchor can only appear within an xhtml block element, an inline element can only appear within an snm paragraph or banner.

Inline elements appear within curly braces { }.

If you need to actually write an opening brace in your document, the opening brace may be escaped with a backslash \.

The following inline elements are available: section links, external links, inline classes, inline syntax highlighting and literal text.

snm supports two types of links.

Section links are hyperlinks to a section of the document, using that section's unique name.

External links are a more traditional link to a URL.

As an inline element, links begin with an opening curly brace {.

Then either the word 'section', which indicates a section link, or the word 'external' which indicates an external link.

Then the link text. This may consist of a number of words separated by whitespace.

Then the destination. No explicit syntax separates the link text from the destination - the last word is taken to be the destination. Obviously, section links expect a section's unique name, whereas external links expect a URL.

As with all inline elements, a link is closed with a curly brace }.

Whitespace is optional throughout links.

Examples:

The link above, which is a section link to the unique identifier 'sections':

   {section section of the document sections}

The external link in section 3.3 Paragraphs, to the 'YAML in Five Minutes' tutorial

   {external sequence http://yaml.kwiki.org/index.cgi?YamlInFiveMinutesMinuteOne}

Literal text can be specified through the literal inline element.

Literal text is not processed or transformed by snm: it is output directly into the output document.

This is risky because allows it you to write invalid xhtml, for instance; but it does allow you to write html that snm does not generate.

However, this approach suffers from many problems and is very much a working solution for current needs. Problems are discussed below.

Example:

   {literal <table><td>Embed a html table</td></table>}

snm supports inline classes. This allows a section of text to have a different style to the rest of the text block.

An inline class in an inline element beginning with the word class, and lasting until the closing brace.

An example:

   class: quote 
   text: "Don't make me angry. You wouldn't like me when I'm angry" {class -- David Banner, The Incredible Hulk, 1978. aside}

The text within the class element is assigned the class 'aside', allowing it to be rendered differently from the rest of the paragraph.

In the xhtml renderer, an inline class element:

   {class the text goes here x}

Corresponds to a span element thus:

   <span class="x">the text goes here</span> 

snm supports inline syntax highlighting through language inline elements. An example:

   Some logic:{language forall E. A subset B. E member A implies E member B math}

This is rendered as:

   Some logic:  E. A  B. E  A  E  B

When generating xhtml, snm will look for a file called 'style.css' in the documentation source directory, and embed the contents of that file into the document's header as a CSS style sheet.

snm supports extensible syntax highlighting through dynamically loaded plugins.

Once a highlighting plugin is set up for a language, the language may be used in a paragraph or in an inline language element

Syntax highlighting is configured through the top-level syntax.yaml file.

This file contains either a syntax map, or a sequence of such maps.

The syntax map has four elements:

language: The name of the language. It gives a name to the syntax highlighter in the document.

package: The name of the Haskell package providing the plugin. Version number included.

module: The name of the module providing the plugin.

symbol: The name of the plugin.

Syntax plugins must have type Dynamic. However, this type must have been constructed from a SyntaxHighlighter, defined in snm's Manual.Structure.

snm provides a module Text.Syntax.Simple which makes it easy to write keyword-oriented syntax highlighters.

Be aware that snm will not html escape strings returned by the syntax highlighter. Text.XHtml.Strict.stringToHtmlString from the xhtml package may be useful.

As an example, here is this document's syntax.yaml:

   language: math 
   package: snmmath-0.0.1 
   module: Text.Syntax.Math 
   symbol: math

snmmath is hosted on github, too.

If you use snm and need more help than is available in this manual then do not hesitate to contact the author at spoon@killersmurf.com.

Please note that snm suffers from a number of shortfalls:

Invalid xhtml can be generated through manipulation of the style sheet, literal text, link destinations, and the unique names of sections.

While I regret that this is possible, attempting xhtml kludges through these means ill-fitting means is misuse of snm and may result in generation of shoddy manuals, a telling off and early bed-times all around. You have been warned!

Other problems:

snm will not check that your section links actually point anywhere.

section numbering is difficult at the moment.

Track these issues at the repository

\ No newline at end of file diff --git a/snm_help/abuse.yaml b/snm_help/abuse.yaml index 166cbc9..bea95aa 100644 --- a/snm_help/abuse.yaml +++ b/snm_help/abuse.yaml @@ -10,4 +10,8 @@ text: - "If you use snm and need more help than is available in this manual then do not hesitate to contact the author at spoon@killersmurf.com." - "Please note that snm suffers from a number of shortfalls:" - "Invalid xhtml can be generated through manipulation of the {section style sheet style}, {section literal text literal}, {section link destinations links}, and the {section unique names of sections sections}." - - "While I regret that this is possible, attempting xhtml kludges through these means ill-fitting means is misuse of snm and may result in generation shoddy manuals, a telling off and early bed-times all around. You have been warned!" + - "While I regret that this is possible, attempting xhtml kludges through these means ill-fitting means is misuse of snm and may result in generation of shoddy manuals, a telling off and early bed-times all around. You have been warned!" + - "Other problems:" + - "snm will not check that your section links actually point anywhere." + - "section numbering is difficult at the moment." + - "Track these issues at the {external repository http://github.com/elginer/snm}" diff --git a/snm_help/how/inline.yaml b/snm_help/how/inline.yaml index 6c8f13c..f1017e5 100644 --- a/snm_help/how/inline.yaml +++ b/snm_help/how/inline.yaml @@ -10,4 +10,4 @@ text: - "Inline elements within paragraphs and banners allow more expressive text. The idea of an inline snm element is roughly equivalent to an inline HTML element. Much as an xhtml anchor can only appear within an xhtml block element, an inline element can only appear within an snm paragraph or banner." - "Inline elements appear within curly braces \{ }." - "If you need to actually write an opening brace in your document, the opening brace may be escaped with a backslash \." - - "The following inline elements are available: section links, external links, inline classes, inline languages and literal text." + - "The following inline elements are available: {section section links links}, {section external links links}, {section inline classes inlineclass}, {section inline syntax highlighting inlinesyntax} and {section literal text literal}." diff --git a/snm_help/how/inline/syntax.yaml b/snm_help/how/inline/syntax.yaml new file mode 100644 index 0000000..e78037a --- /dev/null +++ b/snm_help/how/inline/syntax.yaml @@ -0,0 +1,18 @@ +# Copyright John Morrice 2010 +# This document is part of The Simple Nice-Looking Manual Generator documentation +# This document is released under the terms of the GNU Free Documentation Licence +# See the file DOC-COPYING. +title: Inline Syntax Highlighting +number: 4 +unique: inlinesyntax +text: + - "snm supports inline {section syntax highlighting syntax} through {class language example} inline elements. An example:" + - class: example + wrap: False + text: " Some logic:\{language forall E. A subset B. E member A implies E member B math}" + - "This is rendered as:" + - class: example + wrap: False + text: " Some logic:{language forall E. A subset B. E member A implies E member B math}" + + diff --git a/snm_help/how/paragraphs.yaml b/snm_help/how/paragraphs.yaml index dd418f3..fbd8dd9 100644 --- a/snm_help/how/paragraphs.yaml +++ b/snm_help/how/paragraphs.yaml @@ -50,11 +50,11 @@ text: - wrap: False class: example text: " language: math - \n text: \"forall A forsome B [A memberof C B memberof C . A + B ]\"" + \n text: \"forall A. A !member empty\"" - "Is rendered as:" - language: math wrap: False - text: " forall A forsome B [A memberof C B memberof C . A + B ]" + text: " forall A. A !member empty" diff --git a/snm_help/how/syntax.yaml b/snm_help/how/syntax.yaml index a6a3622..4196fa5 100644 --- a/snm_help/how/syntax.yaml +++ b/snm_help/how/syntax.yaml @@ -20,3 +20,11 @@ text: - "snm provides a module {class Text.Syntax.Simple example} which makes it easy to write keyword-oriented syntax highlighters." - "Be aware that snm will not html escape strings returned by the syntax highlighter. {class Text.XHtml.Strict.stringToHtmlString example} from the {external xhtml package http://hackage.haskell.org/package/xhtml} may be useful." - "As an example, here is this document's syntax.yaml:" + - class: example + wrap: False + text: + " language: math + \n package: snmmath-0.0.1 + \n module: Text.Syntax.Math + \n symbol: math" + - "{external snmmath is hosted on github, too http://github.com/elginer/snm_math}." diff --git a/snm_help/syntax.yaml b/snm_help/syntax.yaml new file mode 100644 index 0000000..290afcf --- /dev/null +++ b/snm_help/syntax.yaml @@ -0,0 +1,9 @@ +# Copyright John Morrice 2010 +# This document is part of The Obelisk Programming Language documentation +# This document is released under the terms of the GNU Free Documentation Licence +# See the file DOC-COPYING. + +language: math +package: snmmath-0.0.1 +module: Text.Syntax.Math +symbol: math