The commondoc-markdown Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The commondoc-markdown Reference Manual

This is the commondoc-markdown Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Thu Sep 15 04:29:22 2022 GMT+0.

Table of Contents


1 Introduction

CommonDoc-Markdown

This is a wrapper around 3BMD markdown parser which produces documents in CommonDoc format. Also, it is able to render CommonDoc documents into the Markdown.

It is a proof of the concept, but I'm already using it in the documentation builder 40ANTS-DOC.

Note. This library is not compatible with CommonMark yet.

Installation

This library available only at Ultralisp.org now. To install it using Quicklisp client, do:

(ql-dist:install-dist "http://dist.ultralisp.org/"
                      :prompt nil)

(ql:quickload :commondoc-markdown)

Parsing Markdown to CommonDoc

CL-USER> (common-doc.format:parse-document
          (make-instance 'commondoc-markdown:markdown)
          "
# Hello World

* First item
* Second item
")
#<COMMON-DOC:SECTION title: Hello World, ref: NIL>

Writing CommonDoc to Markdown

Now we can render our document back to Markdown:

CL-USER> (common-doc.format:emit-to-string
          (make-instance 'commondoc-markdown:markdown)
          *document*)
"# Hello World

* First item

* Second item


"

API

variable commondoc-markdown/emitter:*generate-short-link-references* t

By default it is T, but you can bind it to NIL, to prevent short link references generation.

variable commondoc-markdown/emitter:*min-link-hash-length* 4

Minumum length of the hash for generated markdown links. This works only when *generate-short-link-references* variable is set to T.

variable commondoc-markdown/emitter:*emit-section-anchors* t

When this variable is T (default), emitter outputs a raw html <a name="some-id"></a> before each Markdown section.

Roadmap


[generated by 40ANTS-DOC]

2 Systems

The main system appears first, followed by any subsystem dependency.


Next: , Previous: , Up: Systems   [Contents][Index]

2.1 commondoc-markdown

Converter from Markdown to CommonDoc.

Author

Alexander Artemenko

Home Page

https://40ants.com/commondoc-markdown/

Source Control

(GIT https://github.com/40ants/commondoc-markdown)

Bug Tracker

https://github.com/40ants/commondoc-markdown/issues

License

Unlicense

Dependencies
Source

commondoc-markdown.asd.


2.2 commondoc-markdown/core

Author

Alexander Artemenko

Home Page

https://40ants.com/commondoc-markdown/

Source Control

(GIT https://github.com/40ants/commondoc-markdown)

Bug Tracker

https://github.com/40ants/commondoc-markdown/issues

License

Unlicense

Dependencies
Source

commondoc-markdown.asd.


2.3 commondoc-markdown/addons

Author

Alexander Artemenko

Home Page

https://40ants.com/commondoc-markdown/

Source Control

(GIT https://github.com/40ants/commondoc-markdown)

Bug Tracker

https://github.com/40ants/commondoc-markdown/issues

License

Unlicense

Dependencies
  • 3bmd (system).
  • esrap (system).
Source

commondoc-markdown.asd.


2.4 commondoc-markdown/format

Author

Alexander Artemenko

Home Page

https://40ants.com/commondoc-markdown/

Source Control

(GIT https://github.com/40ants/commondoc-markdown)

Bug Tracker

https://github.com/40ants/commondoc-markdown/issues

License

Unlicense

Source

commondoc-markdown.asd.


2.5 commondoc-markdown/raw-html

Author

Alexander Artemenko

Home Page

https://40ants.com/commondoc-markdown/

Source Control

(GIT https://github.com/40ants/commondoc-markdown)

Bug Tracker

https://github.com/40ants/commondoc-markdown/issues

License

Unlicense

Dependencies
Source

commondoc-markdown.asd.


2.6 commondoc-markdown/emitter

Author

Alexander Artemenko

Home Page

https://40ants.com/commondoc-markdown/

Source Control

(GIT https://github.com/40ants/commondoc-markdown)

Bug Tracker

https://github.com/40ants/commondoc-markdown/issues

License

Unlicense

Dependencies
  • commondoc-markdown/core (system).
  • alexandria (system).
  • common-html (system).
  • str (system).
  • ironclad (system).
  • babel (system).
  • quri (system).
Source

commondoc-markdown.asd.


3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


3.1.2 commondoc-markdown/core/file-type.lisp

Source

commondoc-markdown.asd.

Parent Component

commondoc-markdown/core (system).

Packages

commondoc-markdown.

Public Interface
Internals

3.1.3 commondoc-markdown/addons/file-type.lisp

Source

commondoc-markdown.asd.

Parent Component

commondoc-markdown/addons (system).

Packages

commondoc-markdown/addons.

Internals

*strikethrough* (special variable).


3.1.4 commondoc-markdown/format/file-type.lisp

Source

commondoc-markdown.asd.

Parent Component

commondoc-markdown/format (system).

Packages

commondoc-markdown/format.

Public Interface

markdown (class).


3.1.5 commondoc-markdown/raw-html/file-type.lisp

Source

commondoc-markdown.asd.

Parent Component

commondoc-markdown/raw-html (system).

Packages

commondoc-markdown/raw-html.

Public Interface
Internals

3.1.6 commondoc-markdown/emitter/file-type.lisp

Source

commondoc-markdown.asd.

Parent Component

commondoc-markdown/emitter (system).

Packages

commondoc-markdown/emitter.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 commondoc-markdown/emitter

Source

file-type.lisp.

Use List

common-lisp.

Public Interface
Internals

4.2 commondoc-markdown/raw-html

Source

file-type.lisp.

Use List

common-lisp.

Public Interface

4.3 commondoc-markdown/format

Source

file-type.lisp.

Use List

common-lisp.

Public Interface

markdown (class).


4.4 commondoc-markdown

Source

file-type.lisp.

Nickname

commondoc-markdown/core

Use List

common-lisp.

Public Interface
Internals

Previous: , Up: Packages   [Contents][Index]

4.5 commondoc-markdown/addons

Source

file-type.lisp.

Use List

common-lisp.

Internals

*strikethrough* (special variable).


5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


5.1.1 Special variables

Special Variable: *emit-section-anchors*

When this variable is ‘T‘ (default), emitter outputs a raw html ‘<a name="some-id"></a>‘ before each Markdown section.

Package

commondoc-markdown/emitter.

Source

file-type.lisp.

By default it is ‘T‘, but you can bind it to NIL, to prevent short link references generation.

Package

commondoc-markdown/emitter.

Source

file-type.lisp.

Minumum length of the hash for generated markdown links.
This works only when *GENERATE-SHORT-LINK-REFERENCES* variable is set to ‘T‘.

Package

commondoc-markdown/emitter.

Source

file-type.lisp.


5.1.2 Ordinary functions

Package

commondoc-markdown.

Source

file-type.lisp.

Function: make-raw-html-block (html-string)
Package

commondoc-markdown/raw-html.

Source

file-type.lisp.

Function: make-raw-inline-html (html-string)
Package

commondoc-markdown/raw-html.

Source

file-type.lisp.


5.1.3 Generic functions

Generic Reader: html (object)
Package

commondoc-markdown/raw-html.

Methods
Reader Method: html ((raw-html raw-html))

automatically generated reader method

Source

file-type.lisp.

Target Slot

html.

Package

commondoc-markdown.

Methods

A definition slug for the linked document.

Source

file-type.lisp.

Target Slot

definition.


5.1.4 Standalone methods

Method: emit-document ((format markdown) (node raw-inline-html) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node raw-html-block) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node block-quote) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node image) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node code) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node line-break) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node italic) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node bold) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node ordered-list) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node unordered-list) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node code-block) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node paragraph) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node content-node) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node document-link) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node web-link) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document :before ((format markdown) (node document-node) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document :around ((format markdown) node stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (text string) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node text-node) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node section) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node document-node) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: emit-document ((format markdown) (node document) stream)
Package

common-doc.format.

Source

file-type.lisp.

Method: node-specific-equal ((link-a markdown-link) (link-b markdown-link))
Package

common-doc.ops.

Source

file-type.lisp.

Method: parse-document ((format markdown) (string string))
Package

common-doc.format.

Source

file-type.lisp.


5.1.5 Classes

Class: markdown

The Markdown format.

Package

commondoc-markdown/format.

Source

file-type.lisp.

Direct superclasses

document-format.

Direct methods

A named link like [Some text][the-id].

These links can be replaced with a web-link if id is defined somewhere in the markdown text.

Package

commondoc-markdown.

Source

file-type.lisp.

Direct superclasses

link.

Direct methods
Direct slots
Slot: definition

A definition slug for the linked document.

Type

(or null string)

Initargs

:definition

Readers

markdown-link-definition.

Writers

(setf markdown-link-definition).

Class: raw-html
Package

commondoc-markdown/raw-html.

Source

file-type.lisp.

Direct superclasses

document-node.

Direct subclasses
Direct methods

html.

Direct slots
Slot: html
Type

string

Initargs

:html

Readers

html.

Writers

This slot is read-only.

Class: raw-html-block
Package

commondoc-markdown/raw-html.

Source

file-type.lisp.

Direct superclasses

raw-html.

Direct methods
Class: raw-inline-html
Package

commondoc-markdown/raw-html.

Source

file-type.lisp.

Direct superclasses

raw-html.

Direct methods

5.2 Internals


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.1 Special variables

Special Variable: *create-node-recursive-call*
Package

commondoc-markdown.

Source

file-type.lisp.

Package

commondoc-markdown/emitter.

Source

file-type.lisp.

Special Variable: *header-level*
Package

commondoc-markdown/emitter.

Source

file-type.lisp.

Package

commondoc-markdown/emitter.

Source

file-type.lisp.

Package

commondoc-markdown.

Source

file-type.lisp.

Special Variable: *sections-stack*
Package

commondoc-markdown.

Source

file-type.lisp.

Special Variable: *strikethrough*
Package

commondoc-markdown/addons.

Source

file-type.lisp.


5.2.2 Macros

Macro: go-deeper (&body body)
Package

commondoc-markdown.

Source

file-type.lisp.

Macro: with-collected-references ((nodes) &body body)
Package

commondoc-markdown.

Source

file-type.lisp.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.3 Ordinary functions

Function: call-with-collected-references (nodes func)
Package

commondoc-markdown.

Source

file-type.lisp.

Function: create-node (3bmd-node)
Package

commondoc-markdown.

Source

file-type.lisp.

Function: find-url (definition)
Package

commondoc-markdown.

Source

file-type.lisp.

Function: get-line-backticks-count (line)
Package

commondoc-markdown/emitter.

Source

file-type.lisp.

Function: get-num-required-backticks (code-text)

If code includes examples of markdown code blocks, then we should select higher number of backticks.

This function returns a number of backticks, required to wrap given CODE-TEXT into a Markdown code-block.

Package

commondoc-markdown/emitter.

Source

file-type.lisp.

Package

commondoc-markdown/emitter.

Source

file-type.lisp.

Function: make-fence (num-backticks)
Package

commondoc-markdown/emitter.

Source

file-type.lisp.

Function: make-inline-nodes (pieces)

PIECES argument may contain a strings
or lists like (:CODE "foo").

Consecutive strings are concatenated into a text nodes, for lists a CREATE-NODE function is applied

Package

commondoc-markdown.

Source

file-type.lisp.

Function: parse-markdown (string)

This is just a helper to reuse in tests

Package

commondoc-markdown.

Source

file-type.lisp.

Function: write-header (format title stream)
Package

commondoc-markdown/emitter.

Source

file-type.lisp.

Function: write-header-prefix (stream)
Package

commondoc-markdown/emitter.

Source

file-type.lisp.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.4 Standalone methods

Method: emit ((obj raw-inline-html))
Package

common-html.emitter.

Source

file-type.lisp.

Method: emit ((obj raw-html-block))
Package

common-html.emitter.

Source

file-type.lisp.

Method: emit ((line-break line-break))
Package

common-html.emitter.

Source

file-type.lisp.


5.2.5 Classes

Class: line-break

Explicit line break. In Markdown you have to add two or more spaces at the end of the line.

When rendered to HTML, this node will be replaced with <br/>.
When rendered back to markdown - with two spaces and a new-line.

Package

commondoc-markdown.

Source

file-type.lisp.

Direct superclasses

markup.

Direct methods

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts


Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
C   E   F   G   H   M   N   P   W  
Index Entry  Section

(
(setf markdown-link-definition): Public generic functions
(setf markdown-link-definition): Public generic functions

C
call-with-collected-references: Private ordinary functions
create-node: Private ordinary functions

E
emit: Private standalone methods
emit: Private standalone methods
emit: Private standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods
emit-document: Public standalone methods

F
find-url: Private ordinary functions
Function, call-with-collected-references: Private ordinary functions
Function, create-node: Private ordinary functions
Function, find-url: Private ordinary functions
Function, get-line-backticks-count: Private ordinary functions
Function, get-num-required-backticks: Private ordinary functions
Function, hash-link: Private ordinary functions
Function, make-fence: Private ordinary functions
Function, make-inline-nodes: Private ordinary functions
Function, make-markdown-link: Public ordinary functions
Function, make-raw-html-block: Public ordinary functions
Function, make-raw-inline-html: Public ordinary functions
Function, parse-markdown: Private ordinary functions
Function, write-header: Private ordinary functions
Function, write-header-prefix: Private ordinary functions

G
Generic Function, (setf markdown-link-definition): Public generic functions
Generic Function, html: Public generic functions
Generic Function, markdown-link-definition: Public generic functions
get-line-backticks-count: Private ordinary functions
get-num-required-backticks: Private ordinary functions
go-deeper: Private macros

H
hash-link: Private ordinary functions
html: Public generic functions
html: Public generic functions

M
Macro, go-deeper: Private macros
Macro, with-collected-references: Private macros
make-fence: Private ordinary functions
make-inline-nodes: Private ordinary functions
make-markdown-link: Public ordinary functions
make-raw-html-block: Public ordinary functions
make-raw-inline-html: Public ordinary functions
markdown-link-definition: Public generic functions
markdown-link-definition: Public generic functions
Method, (setf markdown-link-definition): Public generic functions
Method, emit: Private standalone methods
Method, emit: Private standalone methods
Method, emit: Private standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, emit-document: Public standalone methods
Method, html: Public generic functions
Method, markdown-link-definition: Public generic functions
Method, node-specific-equal: Public standalone methods
Method, parse-document: Public standalone methods

N
node-specific-equal: Public standalone methods

P
parse-document: Public standalone methods
parse-markdown: Private ordinary functions

W
with-collected-references: Private macros
write-header: Private ordinary functions
write-header-prefix: Private ordinary functions

Jump to:   (  
C   E   F   G   H   M   N   P   W  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   F   L   M   P   R   S  
Index Entry  Section

C
Class, line-break: Private classes
Class, markdown: Public classes
Class, markdown-link: Public classes
Class, raw-html: Public classes
Class, raw-html-block: Public classes
Class, raw-inline-html: Public classes
commondoc-markdown: The commondoc-markdown system
commondoc-markdown: The commondoc-markdown package
commondoc-markdown.asd: The commondoc-markdown/commondoc-markdown․asd file
commondoc-markdown/addons: The commondoc-markdown/addons system
commondoc-markdown/addons: The commondoc-markdown/addons package
commondoc-markdown/core: The commondoc-markdown/core system
commondoc-markdown/emitter: The commondoc-markdown/emitter system
commondoc-markdown/emitter: The commondoc-markdown/emitter package
commondoc-markdown/format: The commondoc-markdown/format system
commondoc-markdown/format: The commondoc-markdown/format package
commondoc-markdown/raw-html: The commondoc-markdown/raw-html system
commondoc-markdown/raw-html: The commondoc-markdown/raw-html package

F
File, commondoc-markdown.asd: The commondoc-markdown/commondoc-markdown․asd file
File, file-type.lisp: The commondoc-markdown/core/file-type․lisp file
File, file-type.lisp: The commondoc-markdown/addons/file-type․lisp file
File, file-type.lisp: The commondoc-markdown/format/file-type․lisp file
File, file-type.lisp: The commondoc-markdown/raw-html/file-type․lisp file
File, file-type.lisp: The commondoc-markdown/emitter/file-type․lisp file
file-type.lisp: The commondoc-markdown/core/file-type․lisp file
file-type.lisp: The commondoc-markdown/addons/file-type․lisp file
file-type.lisp: The commondoc-markdown/format/file-type․lisp file
file-type.lisp: The commondoc-markdown/raw-html/file-type․lisp file
file-type.lisp: The commondoc-markdown/emitter/file-type․lisp file

L
line-break: Private classes

M
markdown: Public classes
markdown-link: Public classes

P
Package, commondoc-markdown: The commondoc-markdown package
Package, commondoc-markdown/addons: The commondoc-markdown/addons package
Package, commondoc-markdown/emitter: The commondoc-markdown/emitter package
Package, commondoc-markdown/format: The commondoc-markdown/format package
Package, commondoc-markdown/raw-html: The commondoc-markdown/raw-html package

R
raw-html: Public classes
raw-html-block: Public classes
raw-inline-html: Public classes

S
System, commondoc-markdown: The commondoc-markdown system
System, commondoc-markdown/addons: The commondoc-markdown/addons system
System, commondoc-markdown/core: The commondoc-markdown/core system
System, commondoc-markdown/emitter: The commondoc-markdown/emitter system
System, commondoc-markdown/format: The commondoc-markdown/format system
System, commondoc-markdown/raw-html: The commondoc-markdown/raw-html system

Jump to:   C   F   L   M   P   R   S