struct Pandocr::PandocInfo

Overview

Use PandocInfo to collect information about the pandoc installation and executable.

Typically, this information, such as pandoc's version, doesn't change. PandocInfo collects this information by running pandoc once, caches the collected information, then returns the cached information.

Defined in:

pandocr/pandoc_info.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pandoc : String = Pandocr::WrappedPandoc.command) #

Instance Method Detail

def data_dir : Path #

Gets pandoc's default user data directory.

See pandoc's command-line option --data-dir for more information about data directories and pandoc's default data directory.

When collecting the default data directory fails, but pandoc itself is run successfully, the current working directory is returned instead.

Note. Using PandocInfo with very old versions of pandoc might fail because PandocInfo relies on pandoc's output.

Raises a PandocError when calling pandoc fails.


def version : SemanticVersion #

Gets pandoc's version.

When collecting the pandoc version fails, but pandoc itself is run successfully, version "-1.-1.-1" is returned.

Raises a PandocError when calling pandoc fails.