Documentation
¶
Index ¶
- Variables
- func AddBibliography(doc ast.Node) bool
- func AddIndex(doc ast.Node) bool
- func CitationToBibliography(doc ast.Node) (normative ast.Node, informative ast.Node)
- func Hook(data []byte) (ast.Node, []byte, int)
- func IndexToDocumentIndex(doc ast.Node) *mast.DocumentIndex
- func IsReference(data []byte) ([]byte, bool)
- func NodeBackMatter(doc ast.Node) ast.Node
- func ReferenceHook(data []byte) (ast.Node, []byte, int)
- func SkipUntilChar(data []byte, i int, c byte) int
- func TitleHook(data []byte) (ast.Node, []byte, int)
- type Initial
Constants ¶
This section is empty.
Variables ¶
var Extensions = parser.Tables | parser.FencedCode | parser.Autolink | parser.Strikethrough | parser.SpaceHeadings | parser.HeadingIDs | parser.BackslashLineBreak | parser.SuperSubscript | parser.DefinitionLists | parser.MathJax | parser.AutoHeadingIDs | parser.Footnotes | parser.Strikethrough | parser.OrderedListStart | parser.Attributes | parser.Mmark | parser.Includes
Extensions is the default set of extensions mmark requires.
var UnsafeInclude parser.Flags = 1 << 3
Functions ¶
func AddBibliography ¶
AddBibliography adds the bibliography to the document. It will be added just after the backmatter node. If that node can't be found this function returns false and does nothing.
func AddIndex ¶
AddIndex adds an index to the end of the current document. If not indices can be found this returns false and no index will be added.
func CitationToBibliography ¶
CitationToBibliography walks the AST and gets all the citations on HTML blocks and groups them into normative and informative references.
func IndexToDocumentIndex ¶
func IndexToDocumentIndex(doc ast.Node) *mast.DocumentIndex
IndexToDocumentIndex crawls the entire doc searching for indices, it will then return an mast.DocumentIndex that contains a tree:
IndexLetter - IndexItem
- IndexLink
- IndexSubItem
- IndexLink
- IndexLink
Which can then be rendered by the renderer.
func IsReference ¶
IfReference returns wether data contains a reference.
func NodeBackMatter ¶ added in v1.9.95
NodeBackMatter is the place where we should inject the bibliography
func ReferenceHook ¶
ReferenceHook is the hook used to parse reference nodes.
Types ¶
type Initial ¶
Initial is the initial file we are working on, empty for stdin and adjusted is we we have an absolute or relative file.
func (Initial) ReadInclude ¶
ReadInclude is the hook to read includes. Its supports the following options for address.
4,5 - line numbers separated by commas N, - line numbers, end not specified, read until the end. /start/,/end/ - regexp separated by commas optional a prefix="" string.