nyctergatis.com

Contact

Projects
Sysquake Remote Live
NME
PDF
Hike
Sudoku
GifBuilder
jpeglib for Palm OS
MySQL Client
Cross-GCC for Mac OS
NMEMain.c File Reference

Test program for Nyctergatis Markup Engine. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "NME.h"
#include "NMETest.h"
#include "NMEEPub.h"
#include "NMEAutolink.h"
#include "NMEPluginRot13.h"
#include "NMEPluginReverse.h"
#include "NMEPluginUppercase.h"
#include "NMEPluginCalendar.h"
#include "NMEPluginRaw.h"
#include "NMEPluginTOC.h"
#include "NMEPluginWiki.h"

Go to the source code of this file.

Defines

#define INITIALSIZE   (32 * 1024)
 Initial size for reading input.
#define kHookCheckMaxDepth   256
 Maximum depth of nested constructs in HookCheckData.
#define isAlphaNum(c)
#define toHexa(d)   ((d) >= 10 ? (d) + ('a' - 10) : (d) + '0')

Functions

static NMEErr hookDump (NMEInt level, NMEInt item, NMEBoolean enter, NMEConstText markup, NMEInt srcIndex, NMEInt srcLineNumber, NMEContext *context, void *data)
 Hook for dumping information about input.
static NMEErr hookEdit (NMEInt level, NMEInt item, NMEBoolean enter, NMEConstText markup, NMEInt srcIndex, NMEInt srcLineNumber, NMEContext *context, void *data)
 Hook for editing a fragment of input source.
static NMEErr hookCheck (NMEChar hook, NMEInt level, NMEInt item, NMEBoolean enter, NMEConstText markup, NMEInt srcIndex, NMEInt srcLineNumber, HookCheckData *hookCheckData)
 Hook for checking hooks.
static NMEErr divHookCheck (NMEInt level, NMEInt item, NMEBoolean enter, NMEConstText markup, NMEInt srcIndex, NMEInt srcLineNumber, NMEContext *context, void *data)
 Hook for checking div hook.
static NMEErr parHookCheck (NMEInt level, NMEInt item, NMEBoolean enter, NMEConstText markup, NMEInt srcIndex, NMEInt srcLineNumber, NMEContext *context, void *data)
 Hook for checking par hook.
static NMEErr spanHookCheck (NMEInt level, NMEInt item, NMEBoolean enter, NMEConstText markup, NMEInt srcIndex, NMEInt srcLineNumber, NMEContext *context, void *data)
 Hook for checking span hook.
NMEErr encodeURLEasylink (NMEConstText link, NMEInt linkLen, NMEContext *context, void *data)
 Easylink callback (replace dollar in string pointed by data with link, where letters, digits, hyphens, commas, dots, apostrophes, parentheses, colons and underscores are preserved, spaces are converted to underscores, non-ascii characters are URL-encoded, and other characters are ignored;.
int main (int argc, char **argv)
 Application entry point.

Variables

static NMEOutputFormat const NMEOutputFormatSlidesHTML
 Format strings for slides in HTML.
static NMEOutputFormat const NMEOutputFormatMediawiki
 Format strings for Mediawiki output (NOT FINISHED!)
static NMEEncodeCharDict const jspwikiCharDict []
 Table of character substitutions for JSPWiki.
static NMEOutputFormat const NMEOutputFormatJSPWiki
 Format strings for JSPWiki output.
static NMEPluginTocData tocData
 User data of NMEPluginTOCEntry.
static NMEPlugin const pluginsHTML []
 Table of plugins for conversion to HTML.
static NMEPlugin const plugins []
 Table of plugins for conversion to all formats but HTML/XML.
static NMEPlugin const pluginsMetadata []
 Table of plugins for metadata extraction.
static NMEAutoconvert autoconverts [16]
 Table of autoconvert functions.
static NMEInterwiki const interwikis []
 Table of interwiki definitions.

Detailed Description

Test program for Nyctergatis Markup Engine.

Author:
Yves Piguet.

Usage

This program filters standard input and writes the result to sandard output. It can be called as follows to convert file readme.nme to HTML file readme.html:

    ./nme <readme.nme >readme.html

Here is the list of options it supports:

  • --1eol single eol as paragraph breaks
  • --2eol double eol as paragraph breaks (default)
  • --autocclink automatic conversion of camelCase words to links
  • --autourl automatic conversion of URLs to links
  • --body naked body without header and footer
  • --checkhooks check hooks
  • --debug XML debug output, sublists outside list items
  • --debug2 XML debug output, sublists inside list items
  • --easylink format links are converted as follows: letters, digits, hyphens, commas, dots, apostrophes, parentheses, colons and underscores are preserved, spaces are converted to underscores, non-ascii characters are URL-encoded, other characters are ignored, and the output link is obtained by replacing the dollar character in format with the processed link (e.g. format could be '/wiki/$.html'). URL are used verbatim.
  • --editfrag index length beg end edit a fragment of the source code; in output, replace what corresponds to input fragment starting at index of length length with this unmodified input fragment surrounded by beg and end
  • --epub EPUB output
  • --headernum1 numbering of level-1 headers
  • --headernum2 numbering of level-2 headers
  • --fontsize s font size (0=default)
  • --help this help message
  • --html HTML output (default)
  • --jspwiki JSPWiki output
  • --latex LaTeX output
  • --man man page output
  • --mediawiki Mediawiki output
  • --nme NME output
  • --null no output (still process input)
  • --strictcreole dble tt, u, sub/sup, DL, ind par and esc and eble tt nowiki

--structdiv display division structure

  • --structpar display paragraph structure
  • --structspan display span structure
    • --rtf RTF output
    • --test test (validation of style string nesting)
    • --testoutput test output
    • --testoutput2 test output, sublists inside list items
    • --text plain text output
    • --textc compact plain text output
    • --xref headings have hyperlink target labels

Definition in file NMEMain.c.


Define Documentation

#define isAlphaNum (   c)
Value:
((c) >= 'a' && (c) <= 'z' || (c) >= 'A' && (c) <= 'Z' \
            || (c) >= '0' && (c) <= '9')

Variable Documentation

NMEInterwiki const interwikis[] [static]
Initial value:
{
    {"Dictionary:",
        "http://www.dict.org/bin/Dict?Database=*&Form=Dict1&Strategy=*&Query="},
    {"Foldoc:", "http://www.foldoc.org/foldoc/foldoc.cgi?"},
    {"Google:", "http://www.google.com/search?q="},
    {"WhoIs:", "http://www.whois.sc/"},
    {"WikiPedia:", "http://en.wikipedia.org/wiki/"},
    {NULL, NULL}
}

Table of interwiki definitions.

Definition at line 326 of file NMEMain.c.

Initial value:
{
    {'*', "~*"},
    {'#', "~#"},
    {'\\', "~\\"},
    {'_', "~_"},
    {'!', "~!"},
    {'{', "~{"},
    {'}', "~}"},
    {'~', "~~"},
    {0, NULL}
}

Table of character substitutions for JSPWiki.

Definition at line 221 of file NMEMain.c.

NMEPlugin const plugins[] [static]
Initial value:

Table of plugins for conversion to all formats but HTML/XML.

Definition at line 302 of file NMEMain.c.

NMEPlugin const pluginsHTML[] [static]
Initial value:

Table of plugins for conversion to HTML.

Definition at line 288 of file NMEMain.c.

NMEPlugin const pluginsMetadata[] [static]
Initial value:
{
    NMEPluginKeywordsEntry,
    NMEPluginDateEntry(NMEMonthNameEn NMEMonthNameFr NMEMonthNameSp NMEMonthNameIt NMEMonthNameDe),
    NMEPluginExecuteEntry,
    
    NMEPluginTableEnd
}

Table of plugins for metadata extraction.

Definition at line 313 of file NMEMain.c.

Generated by Doxygen.
Copyright 2007-2013, Yves Piguet.
All rights reserved.