mparser

package
v1.9.982 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2018 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CitationToBibliography

func CitationToBibliography(doc ast.Node) (normative ast.Node, informative ast.Node)

CitationToBibliography walks the AST and gets all the citations on HTML blocks and groups them into normative and informative references.

func Hook

func Hook(data []byte) (ast.Node, []byte, int)

Hook will call both TitleHook and ReferenceHook.

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 NodeBackMatter added in v1.9.95

func NodeBackMatter(doc ast.Node) ast.Node

NodeBackMatter is the place where we should inject the bibliography

func ReferenceHook

func ReferenceHook(data []byte) (ast.Node, []byte, int)

ReferenceHook is the hook used to parse reference nodes.

func TitleHook

func TitleHook(data []byte) (ast.Node, []byte, int)

TitleHook will parse a title and returns it.

Types

type Initial

type Initial string

Initial is the initial file we are working on, empty for stdin and adjusted is we we have an absolute or relative file.

func NewInitial

func NewInitial(s string) Initial

NewInitial returns an initialized Initial.

func (Initial) ReadInclude

func (i Initial) ReadInclude(from, file string, address []byte) []byte

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL