#WORK
#WORK

_library/index-include.md.cms

_library/sitemap-include.md.cms

Introduction

If you need to render a format not already handled by pandoc, or you want to change how pandoc renders a format, you can create a custom writer using the Lua language. Pandoc has a built-in Lua interpreter, so you needn’t install any additional software to do this.

A custom writer is a Lua file that defines how to render the document. Two styles of custom writers are supported: classic custom writers must define rendering functions for each AST element. New style writers, available since pandoc 2.17.2, must define just a single function Writer, which gets passed the document and writer options, and then does all rendering.

Classic style

A writer using the classic style defines rendering functions for each element of the pandoc AST.

For example,

function Para(s)
  return "<paragraph>" .. s .. "</paragraph>"
end

The best way to go about creating a classic custom writer is to modify the example that comes with pandoc. To get the example, you can do

pandoc --print-default-data-file sample.lua > sample.lua

[…] (link to full page)

Introduction

If you need to parse a format not already handled by pandoc, you can create a custom reader using the Lua language. Pandoc has a built-in Lua interpreter, so you needn’t install any additional software to do this.

A custom reader is a Lua file that defines a function called Reader, which takes two arguments:

  • the raw input to be parsed, as a list of sources
  • optionally, a table of reader options, e.g. { columns = 62, standalone = true }.

The Reader function should return a Pandoc AST. This can be created using functions in the pandoc module, which is automatically in scope. (Indeed, all of the utility functions that are available for Lua filters are available in custom readers, too.)

Each source item corresponds to a file or stream passed to pandoc containing its text and name. E.g., if a single file input.txt is passed to pandoc, then the list of sources will contain just a single element s, where s.name == 'input.txt' and s.text contains the file contents as a string.

[…] (link to full page)

Introduction

Pandoc has long supported filters, which allow the pandoc abstract syntax tree (AST) to be manipulated between the parsing and the writing phase. Traditional pandoc filters accept a JSON representation of the pandoc AST and produce an altered JSON representation of the AST. They may be written in any programming language, and invoked from pandoc using the --filter option.

Although traditional filters are very flexible, they have a couple of disadvantages. First, there is some overhead in writing JSON to stdout and reading it from stdin (twice, once on each side of the filter). Second, whether a filter will work will depend on details of the user’s environment. A filter may require an interpreter for a certain programming language to be available, as well as a library for manipulating the pandoc AST in JSON form. One cannot simply provide a filter that can be used by anyone who has a certain version of the pandoc executable.

Starting with version 2.0, pandoc makes it possible to write filters in Lua without any external dependencies at all. A Lua interpreter (version 5.3) and a Lua library for creating pandoc filters is built into the pandoc executable. Pandoc data types are marshaled to Lua directly, avoiding the overhead of writing JSON to stdout and reading it from stdin.

[…] (link to full page)

Synopsis

pandoc [options] [input-file]…

Description

Pandoc is a Haskell library for converting from one markup format to another, and a command-line tool that uses this library.

Pandoc can convert between numerous markup and word processing formats, including, but not limited to, various flavors of Markdown, HTML, LaTeX and Word docx. For the full lists of input and output formats, see the --from and --to options below. Pandoc can also produce PDF output: see creating a PDF, below.

Pandoc’s enhanced version of Markdown includes syntax for tables, definition lists, metadata blocks, footnotes, citations, math, and much more. See below under Pandoc’s Markdown.

[…] (link to full page)

#WORK metainfo page description text

[…] (link to full page)

Page Layout

Top Bar brand (homepage) nav-top info-top / search.*
Main Page nav-left c_list nav-right
Bottom Bar copyright nav-bottom info-bottom / (composer)

Elements

Folds

<!-- composer >> fold-begin 3 . 0 Open Fold -->

Open Fold

<!-- composer >> fold-begin 3 0 0 Closed Fold -->

Closed Fold

<!-- composer >> fold-end -->

<!-- composer >> fold-end -->

<!-- composer >> fold-begin 0 . 0 Generic Fold -->

Generic Fold

<!-- composer >> fold-end -->

Boxes

<!-- composer >> box-begin 3 Box -->

Box

<!-- composer >> box-begin 3 Nested Box -->

Nested Box

<!-- composer >> box-end -->

<!-- composer >> box-end -->

<!-- composer >> box-begin 0 Generic Box -->

Generic Box

<!-- composer >> box-end -->

Grids

<!-- composer >> row-begin -->

<!-- composer >> column-begin col-6 -->

#WORK # some clever content goes here

<!-- composer >> column-end -->

[…] (link to full page)

Introduction

#WORK # introduction

Top Bar brand (homepage) nav-top info-top / search.*
Main Page nav-left c_list nav-right
Bottom Bar copyright nav-bottom info-bottom / (composer)

Example Pages

The entire list of pages in this test site can be found in the main sitemap. To understand how the site is configured, and to see demonstrations of all the features, visit the following pages. This list can be found in the PAGES menu on the top bar throughout the site.

Composer README
Created with c_site, and configured to produce a navigable reference document.

Introduction
Main page, with information about this test site and how to use it.
Default Site
An empty configuration, to demonstrate a simple page with no layout or elements.
Configured Site
All settings changed, showcasing the full flexibility of layout and behavior.
Pandoc Markdown
A Pandoc markdown file, without any Composer embedded elements.
Bootstrap Default
A markdown file with default Bootstrap colors instead of themes and overlays.

[…] (link to full page)

This is a default page, where all menus and settings are empty. All aspects of c_site pages are configurable using .composer.yml files.

Top Bar brand (homepage) nav-top info-top / search.*
Main Page nav-left c_list nav-right
Bottom Bar copyright nav-bottom info-bottom / (composer)

In the layout, this page column is c_list, and the default cols.size for the center column is 7 and cols.resize for the mobile view is 12. Since nav-left and nav-right are both empty, this column is positioned at the left edge.

In the absence of the PAGES menu, use the list below to navigate to the other example pages.

Composer README
Created with c_site, and configured to produce a navigable reference document.

Introduction
Main page, with information about this test site and how to use it.
Default Site
An empty configuration, to demonstrate a simple page with no layout or elements.
Configured Site
All settings changed, showcasing the full flexibility of layout and behavior.
Pandoc Markdown
A Pandoc markdown file, without any Composer embedded elements.
Bootstrap Default
A markdown file with default Bootstrap colors instead of themes and overlays.

[…] (link to full page)

#WORK

#WORK

<!-- composer >> metainfo -->

Configuration Settings

site-config defaults values
brand null null
homepage null null
search.name null null
search.site null null
search.call null null
search.form null null
copyright null null
composer 1 1
header null `../config/_h eader.md.cms`
footer null `../config/_f ooter.md.cms`
css_overlay dark null
copy_protect null 1
cols.break lg md
cols.scroll 1 null
cols.order [ 1, 2, 3 ] [ 1, 3, 2 ]
cols.reorder [ 1, 3, 2 ] [ 2, 3, 1 ]
cols.size [ 3, 7, 2 ] `[ 12, 9, 3 ] `
cols.resize `[ 6, 12, 6 ] [ 12, 12, 0 ]`
metainfo.display ` :: <t itle><|> – <author|; > ()<|>
– <author| – >
. <tags| . >`
metainfo.null *(none)* null
metalist.author.title Author Creator
metalist.author.display `*Authors: <| >, <|>* /li>
metalist.tags.title Tag Mark
metalist.tags.display `*Tags: <|>, <|>* /li>
readtime.display `*Reading tim e: words, d> / Minutes:
readtime.wpm 220 200
redirect.title Moved To Redirecting
redirect.display `**This link has been permanently moved to: Redirectin g: **`
redirect.match * *
redirect.time 5 0

[…] (link to full page)

  • ITEM 1
  • ITEM 2
  • ITEM 3

RIGHT BOX

RIGHT TEXT