Documentation
¶
Overview ¶
Package asciidoc converts AsciiDoc to HTML by sending the AsciiDoc to a Node.js process that uses the Asciidoctor.js Processor API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
Convert AsciiDoc files with the '.asciidoc' extension to HTML if they are found in the filesystem rooted at the given directory.
Skip conversion of AsciiDoc files with an existing output file modified later than itself. Generally, conversion overwrites existing output files.
An HTML output file will take the same filename as the AsciiDoc input file but with a .html extension and will be a sibling of the input file.
func IsShutdownError ¶
IsShutdownError reports whether the given conversion error is due to a shut down converter.
Types ¶
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
Converter is an AsciiDoc to HTML converter.
func NewConverter ¶
NewConverter constructs a new Converter.
A nil error return value indicates a successful start. A converter that encounters an internal error after a successful start writes internal errors to the given log. Conversion errors are not written to the log.
The working directory is temporarily changed during execution and may be left in an undefined state for the failed start case.
func (*Converter) Convert ¶
Convert the AsciiDoc to HTML.
If the returned error is neither nil nor a shutdown error, as indicated by IsShutdownError, then it is an AsciiDoc conversion error.
If the returned error is a shutdown error, as indicated by IsShutdownError, then the Converter log contains the underlying error if the Converter creation was successful and the shutdown was not graceful.