PMLC Commands Reference Manual

PML Version

PMLC 4.0.0 2023-02-23

License

CC BY-ND 4.0

Author and Copyright

Christian Neumanns

Website

https://www.pml-lang.dev/

Introduction

This document describes the commands supported by PMLC's command line interface (CLI).

Note

All command names and options are case-insensitive. For example, instead of writing PML_to_HTML, you can also write pml_to_html.

Commands

Convert PML to HTML

Name: PML_to_HTML

Alternative name: p2h

Description

Convert a PML document into an HTML document.

Examples
pmlc p2h article.pml
pmlc p2h --output ../website/docs/about/index.html about.pml
Input Parameters
  • PML Input File

    Name

    input

    Alternative name

    i

    Is positional parameter

    Yes (# 1)

    Description

    The path of the PML file to be converted to HTML.
    If this parameter is not specified, or if the value is explicitly set to 'stdin' then the PML input is read from the OS's standard input device.

    Type

    file_path or null

    Required

    no

    Default Value

    null

    Example(s)

    input/text/article.pml

  • CSS Files

    Name

    CSS_files

    Alternative name

    css

    Is positional parameter

    No

    Description

    This parameter is used to explicitly specify one or more CSS files to be used in the final HTML document.

    The value is a comma separated list of directories and/or files.
    If a directory is specified, then all files in the directory (including files in sub-directories) are used.
    All directory and file paths can be absolute or relative.
    Each file must be a valid CSS file.

    By default, file(s) in sub-directory 'config/PML_to_HTML/css' of PMLC's shared data directory are used.
    If these default files are to be used together with other CSS files specified by this parameter, then the default files location must also explicitly be specified in the parameter

    Type

    directory_or_file_paths or null

    Required

    no

    Default Value

    [C:\Users\Lisa\AppData\Roaming\PML_Companion\4_0\config\PML_to_HTML\css\pml-default.css, C:\Users\Lisa\AppData\Roaming\PML_Companion\4_0\config\PML_to_HTML\css\pml-print-default.css]

    Example(s)

    ../../shared/css, css

  • HTML Footer Template File

    Name

    HTML_page_footer

    Alternative name

    pf

    Is positional parameter

    No

    Description

    The path of the HTML footer template file.
    The path can be absolute or relative

    Type

    file_path or null

    Required

    no

    Default Value

    C:\Users\Lisa\AppData\Roaming\PML_Companion\4_0\config\PML_to_HTML\html\default_html_footer_template.txt

    Example(s)

    ../../shared/HTML_footer.txt

  • HTML Header Template File

    Name

    HTML_page_header

    Alternative name

    ph

    Is positional parameter

    No

    Description

    The path of the HTML header template file.
    The path can be absolute or relative

    Type

    file_path or null

    Required

    no

    Default Value

    C:\Users\Lisa\AppData\Roaming\PML_Companion\4_0\config\PML_to_HTML\html\default_html_header_template.txt

    Example(s)

    ../../shared/HTML_header.txt

  • Table of Contents Max Level

    Name

    TOC_max_level

    Alternative name

    tm

    Is positional parameter

    No

    Description

    The maximum chapter level that is included in the table of contents.

    Type

    integer32

    Required

    no

    Default Value

    100

    Example(s)

    4

  • Table of Contents Position

    Name

    TOC_position

    Alternative name

    tp

    Is positional parameter

    No

    Description

    The position of the table of contents.
    Valid values are:left, top, none (case-insensitive)

    Type

    tocposition

    Required

    no

    Default Value

    LEFT

    Allowed Values

    left, top, none (case-insensitive)

    Example(s)

    left

  • Table of Contents Title

    Name

    TOC_title

    Alternative name

    tt

    Is positional parameter

    No

    Description

    The title of the table of contents.

    Type

    string or null

    Required

    no

    Default Value

    Table of Contents

    Example(s)

    Contents

  • Source Code Highlighter

    Name

    highlighter

    Alternative name

    hi

    Is positional parameter

    No

    Description

    The name of the highlighter used to highlight source code.
    Valid values are:highlightjs, prism, none (case-insensitive)

    Type

    sourcecodehighlighter

    Required

    no

    Default Value

    NONE

    Allowed Values

    highlightjs, prism, none (case-insensitive)

    Example(s)

    none

  • Omit CSS

    Name

    omit_CSS

    Alternative name

    oc

    Is positional parameter

    No

    Description

    If set to yes (true), CSS classes are omitted in the resulting HTML.

    Type

    boolean

    Required

    no

    Default Value

    false

    Allowed Values

    yes, no, true, false (case-insensitive)

    Example(s)

    yes

  • Open File OS Command

    Name

    open_file_cmd

    Alternative name

    ofc

    Is positional parameter

    No

    Description

    This parameter specifies an OS command template to open an editor for the first file in which an error was detected.
    The following placeholders can be used:
    [[file]]
    the full path of the file in which the error was detected
    [[line]]
    the line number of the error (first line = 1)
    [[column]]
    the column number of the error (first column = 1)

    Note:
    Be careful to correctly quote file paths that include spaces.
    Different OS environments have different rules. Please consult your OS documentation for further information.

    Type

    string or null

    Required

    no

    Default Value

    null

    Example(s)

    // open VSCode in Windows:
    --open_file_cmd "cmd.exe /c code --goto \"[[file]]:[[line]]:[[column]]\""
    // alternative (replace {username} with the name on your machine):
    --open_file_cmd "\"C:\Users\{username}\AppData\Local\Programs\Microsoft VS Code\Code.exe\" --goto \"[[file]]:[[line]]:[[column]]\""

    // open Sublime Text in Windows (subl must be on the OS path)
    --open_file_cmd "cmd.exe /c subl \"[[file]]:[[line]]:[[column]]\""

  • HTML Output File

    Name

    output

    Alternative name

    o

    Is positional parameter

    No

    Description

    The path of the HTML file to be created.

    The default value is defined as follows:
    - If the input is a file, then the output will be 'output/{input_file_name}.html' (where {input_file_name} is replaced by the input file's name, without its extension).
    - If the input is read from STDIN, then the output is written to STDOUT.

    If the value of this parameter is explicitly set to 'stdout', then the output is written to STDOUT

    Type

    file_path or null

    Required

    no

    Default Value

    null

    Example(s)

    ../website/blog/top10-brain-boosters/index.html

  • Resources

    Name

    resources

    Alternative name

    r

    Is positional parameter

    No

    Description

    A comma separated list of resources that will be copied into the output directory.

    Each resource can be a directory or file path. Each path can be absolute or relative.
    If a directory is specified then all files in the directory are used, including files in subdirectories.
    By default directory 'resources' in the current working directory is used.

    Type

    directory_or_file_paths or null

    Required

    no

    Default Value

    null

    Example(s)

    ../../shared/images, resources

  • Verbosity

    Name

    verbosity

    Alternative name

    vb

    Is positional parameter

    No

    Description

    The level of verbosity.
    Defines which kinds of messages are displayed when the command is executed.
    Valid values are:quiet, error, warning, info, all (case-insensitive)

    Type

    loglevel

    Required

    no

    Default Value

    INFO

    Allowed Values

    quiet, error, warning, info, all (case-insensitive)

    Example(s)

    all

Display PMLC Info

Name: info

Description

Write info about PMLC to the standard output device.

Examples
pmlc info
Input Parameters

This command has no input parameters

Display PMLC's Version Number

Name: version

Description

Write the PMLC version number to the standard output device.

Examples
pmlc version
Input Parameters

This command has no input parameters

Convert PDML to XML

Name: PDML_to_XML

Alternative name: pdml2xml

Description

Convert a PDML document into a standalone XML document.
Note: This command is not suitable to convert PML documents into XML.

Examples
pdml pdml2xml input/doc.pdml output/doc.xml
Input Parameters
  • PDML Input File

    Name

    input

    Alternative name

    i

    Is positional parameter

    Yes (# 1)

    Description

    The path of the PDML file to be converted to XML. The path can be absolute or relative.

    Type

    file_path or null

    Required

    no

    Default Value

    null

    Example(s)

    text/input/index.pml

  • XML Output File

    Name

    output

    Alternative name

    o

    Is positional parameter

    Yes (# 2)

    Description

    The path of the XML file to be created. The path can be absolute or relative.

    Type

    file_path or null

    Required

    no

    Default Value

    null

    Example(s)

    output/index.xml

Create Standalone PDML

Name: PDML_to_standalone

Alternative name: pdml2sa

Description

Convert a PDML document into a standalone PDML document.
Note: This command is not suitable to convert PML documents into a standalone PDML document.

Examples
pdml pdml2sa input/book.pml output/standalone_book.pml
Input Parameters
  • PDML Input File

    Name

    input

    Alternative name

    i

    Is positional parameter

    Yes (# 1)

    Description

    The path of the PDML file to be converted to a standalone file. The path can be absolute or relative.

    Type

    file_path or null

    Required

    no

    Default Value

    null

    Example(s)

    input/book.pml

  • PDML Output File

    Name

    output

    Alternative name

    o

    Is positional parameter

    Yes (# 2)

    Description

    The path of the standalone PDML file to be created. The path can be absolute or relative.

    Type

    file_path or null

    Required

    no

    Default Value

    null

    Example(s)

    output/standalone_book.pml

Export PML Meta Data to a JSON File

Name: export_meta_data

Alternative name: md

Description

This command creates a JSON file containing PML meta data (nodes, attributes, etc).
The JSON file can be used by editor plugins and tools to query structured data about PML.

Examples
pmlc export_meta_data
Input Parameters
  • Output File Path

    Name

    output_file

    Alternative name

    of

    Is positional parameter

    No

    Description

    The absolute or relative path of the file to be created.
    If the path is relative, it is relative to the current working directory.
    The default value is file 'PML_meta_data.json' created in the current working directory.
    If the file exists already it will be overwritten.

    Type

    file_path

    Required

    no

    Default Value

    PML_meta_data.json

    Example(s)

    --output_file pml/nodes.json

Create Nodes Reference Manual

Name: create_nodes_reference_manual

Alternative name: cnrm

Description

This command creates the 'PML Nodes Reference Manual'.
The auto-generated PML file is stored in sub-directory 'input' of the current working directory.
The HTML output is stored in sub-directory 'output' of the current working directory.

Examples
pmlc create_reference_manual
Input Parameters

This command has no input parameters

Create Commands Reference Manual

Name: create_commands_reference_manual

Alternative name: ccrm

Description

This command creates the 'PML Commands Reference Manual'.
The auto-generated PML file is stored in sub-directory 'input' of the current working directory.
The output is stored in sub-directory 'output' of the current working directory.

Examples
pmlc create_commands_manual
Input Parameters

This command has no input parameters