|
EPub creation based on NME.
More...
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "zip.h"
#include "NME.h"
#include "NMEAutolink.h"
#include "NMEEPub.h"
#include "NE.h"
Go to the source code of this file.
Defines |
#define | SIZE (8 * 1024 * 1024L) |
| Fixed size allocated for source :-(.
|
#define | kNMENEEndnoteError kNMEErr1stUser |
Functions |
static void | DisplayUsageAndExit (char const *progName, int status) |
static NMEErr | parHookTOC (NMEInt level, NMEInt item, NMEBoolean enter, NMEConstText markup, NMEInt srcIndex, NMEInt srcLineNumber, NMEContext *context, void *data) |
| Paragraph hook to extract titles.
|
static NMEErr | spanHookImg (NMEInt level, NMEInt item, NMEBoolean enter, NMEConstText markup, NMEInt srcIndex, NMEInt srcLineNumber, NMEContext *context, void *data) |
| Span hook to extract image URLs (set a flag when inside image markup, so that the encodeURL callback knows when it's given an image URL).
|
static NMEErr | encodeURL (NMEConstText link, NMEInt linkLen, NMEContext *context, void *data) |
| Encode URL callback used to get an image list.
|
NMEErr | PluginEndnote (NMEConstText name, NMEInt nameLen, NMEConstText data, NMEInt dataLen, NMEContext *context, void *userData) |
| Plugin for NE endnotes.
|
NMEErr | PluginMeta (NMEConstText name, NMEInt nameLen, NMEConstText data, NMEInt dataLen, NMEContext *context, void *userData) |
| Plugin for NE metadata.
|
NMEErr | PluginGuide (NMEConstText name, NMEInt nameLen, NMEConstText data, NMEInt dataLen, NMEContext *context, void *userData) |
| Plugin for NE guide to structural components.
|
int | main (int argc, char **argv) |
| Application entry point.
|
Variables |
static NMEBoolean | debug = FALSE |
static NMEAutoconvert | autoconverts [16] |
| Table of autoconvert functions.
|
static NMEInterwiki const | interwikis [] |
| Table of interwiki definitions.
|
Detailed Description
EPub creation based on NME.
- Author:
- Yves Piguet.
- Copyright:
- 2010-2013, Yves Piguet.
Definition in file NMEEPubMain.c.
Function Documentation
Encode URL callback used to get an image list.
- Parameters:
-
[in] | link | input characters |
[in] | linkLen | length of link |
[in] | dest | address of encoded text |
[in] | destSize | size of dest |
[in,out] | destIx | index in dest (should be updated by encoded character length) |
[in,out] | data | value specific to the callback |
- Returns:
- error code (kNMEErrOk for success)
Definition at line 169 of file NMEEPubMain.c.
Paragraph hook to extract titles.
- Parameters:
-
[in] | level | heading or list level (1 = topmost, par=kNMEHookLevelPar, span=kNMEHookLevelSpan) |
[in] | item | list item or heading counter |
[in] | enter | TRUE when entering construct, FALSE when exiting |
[in] | markup | null-terminated string for initial markup ("p" for par, "*" for unnumbered list of any level, "//" for italic, "{{{" for preformatted) |
[in] | srcIndex | current index in source code |
[in] | srcLineNumber | current line number in source code |
[in,out] | context | current context |
[in,out] | data | value specific to the callback |
- Returns:
- error code (kNMEErrOk for success)
Definition at line 86 of file NMEEPubMain.c.
Plugin for NE endnotes.
Contents is NME code.
- Parameters:
-
[in] | name | plugin name, such as "endnote" |
[in] | nameLen | length of name |
[in] | data | data text (NME code) |
[in] | dataLen | length of data |
[in,out] | context | current context |
[in] | userData | NE (userdata specified when the plugin is installed) |
- Returns:
- error code (kNMEErrOk for success)
- Test:
Some text<< endnote This is an endnote with **bold** and
Definition at line 192 of file NMEEPubMain.c.
Plugin for NE guide to structural components.
- Parameters:
-
[in] | name | plugin name ("guide") |
[in] | nameLen | length of name (5) |
[in] | data | component name as defined in OPF 2.0 ("cover", "title-page", "toc", "index", "glossary", "acknowldgements", "bibliography", "colophon", "copyright-page", "dedication", "epigraph", "foreword", "loi", "lot", "notes", "preface", "text") |
[in] | dataLen | length of data |
[in,out] | context | current context |
[in] | userData | NE (userdata specified when the plugin is installed) |
- Returns:
- error code (kNMEErrOk for success)
- Test:
<< guide cover >>
{cover.jpg}
<< guide preface >>
= Preface
...
<< guide text >>
= Chapter 1
...
Definition at line 299 of file NMEEPubMain.c.
Plugin for NE metadata.
- Parameters:
-
[in] | name | plugin name ("title", "author", "identifier", "language", "subject", "description", "publisher", "date", "source", or "rights") |
[in] | nameLen | length of name |
[in] | data | metadata value |
[in] | dataLen | length of data |
[in,out] | context | current context |
[in] | userData | NE (userdata specified when the plugin is installed) |
- Returns:
- error code (kNMEErrOk for success)
- Test:
<< title My Book >>
<< author Author Name >>
<< date 2010-08 >>
<< identifier com.example.book12345 >>
Definition at line 241 of file NMEEPubMain.c.
Span hook to extract image URLs (set a flag when inside image markup, so that the encodeURL callback knows when it's given an image URL).
- Parameters:
-
[in] | level | heading or list level (1 = topmost, par=kNMEHookLevelPar, span=kNMEHookLevelSpan) |
[in] | item | list item or heading counter |
[in] | enter | TRUE when entering construct, FALSE when exiting |
[in] | markup | null-terminated string for initial markup ("p" for par, "*" for unnumbered list of any level, "//" for italic, "{{{" for preformatted) |
[in] | srcIndex | current index in source code |
[in] | srcLineNumber | current line number in source code |
[in,out] | context | current context |
[in,out] | data | value specific to the callback |
- Returns:
- error code (kNMEErrOk for success)
Definition at line 143 of file NMEEPubMain.c.
Variable Documentation
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 30 of file NMEEPubMain.c.
|
Generated by Doxygen.
Copyright 2007-2013, Yves Piguet.
All rights reserved.
|
|