Package: hmd
HMDSimple WYSIWYG markdown language for write and render man pages, from command line or from Python.WHYThe goal of theHMDlanguage is to provide a simple language that permit to render
an .hmd man page directly from a Python application.This allow you to write your own man page and render it in a cross platform manner
(since does not depends on the externalmancommand).INSTALLATIONpip install hmdorgit clone https://github.com/Docheinstein/hmdUSAGERun withhmdorpython -m hmdusage: __main__.py [-h] [-t] [-n] [-c COLUMNS] [input]

Render documents written in hmd (Help MarkDown) with the default pager. Reads from 'input' or from stdin if it is not given.

positional arguments:
  input                 Help MarkDown file to process and render

optional arguments:
  -h, --help            show this help message and exit
  -t, --text            Output text, without ANSI style
  -n, --no-pager        Just print, without using the pager
  -c COLUMNS, --columns COLUMNS
                        Override columns number (by default it depends on the terminal size)EXAMPLESUsage from command lineRendersls.hmdwith the default pagerhmd ls.hmdPrintsls.hmd, without the pagerhmd -n ls.hmdPrintsls.hmd, without the pager and without style using 60 columnshmd -n -t -c 60 ls.hmdUsage from PythonSee_main__.pyordemos.For exampledemo1.pyfromhmdimportHMDHMD_EXAMPLE=\"""\. This is a comment, keep calm**NAME**ls - list local directory content**SYNOPSIS****ls** [*OPTION*]... [*DIR*]**DESCRIPTION**List content of the local *DIR* or the current local directory if \no *DIR* is specified.**OPTIONS****-a**, **--all**Show hidden files too**-l**Show more details"""if__name__=="__main__":# Renders with less the processed .hmdHMD().render(HMD_EXAMPLE)HMD LANGUAGEThe HMD language is really simple and is thought for contain the minimal stuff for
render a well formatted man page (ANSI formatting, automatic break respecting indent, align overriding, ...).In the spirit of a WYSIWYG language, you will get almost what your write, and
differently from canonical markdown, a new line in the source will be translated
to a new line in the output (no ugly double space at end of line!)See theexamplesfolder for examples of.hmdfiles.Here an example of a.hmdfile from theexamplesfolder**COMMAND**
    ls - list local directory content

**SYNOPSIS**
    **ls** [*OPTION*]... [*DIR*]

**DESCRIPTION**
    List content of the local *DIR* or the current local directory if \
    no *DIR* is specified.

**OPTIONS**
    **-a**, **--all**
        Show hidden files too

    **-g**, **--group**
        Group by file type

    **-l**
        Show more details

    **-r**, **--reverse**
        Reverse sort order

    **-S**
        Show files size

    **-s**, **--sort-size**
        Sort by sizeIndentThe indentation of each paragraph is equal to the number of left spaces in the source file.If a line is longer the the number of available columns, the line will be broken and the
remaining part will be indented automatically by the same amount.FormatBoldSame as markdown: **NAME** =>NAMEItalic (underline)Same as markdown: *DIR* =>DIREscapingBackslash (\) can be use for escape the next character.You can use it for render characters that would be interpreted otherwise.For example:\* => *\\ => \DirectivesEach line starting with a.is a directive.CommentAn unknown directive is an inline comment, so you can use:. My long comment...AlignmentThe are cases in which you want the text to break to an alignment different from
the indentation of the paragraph (e.g. lists). The alignment directive graphically
helps you to do so.To override the alignment for a part of the document, wrap it between.Aand./A.For example:.A     .
    1. I want this text to wrap below the 'I', not below the 1, if the length
    of the line is greater than the number of lines
./AAs you see, the trailing.in the.Adirective specify graphically where to wrap.MiscLong linesIf you have long lines in your source file, you could add a trailing\at
the end of the line for join it with the consecutive line (in the output).
Use the same indent of the first line even for consecutive lines.For example:**DESCRIPTION**
    This is my really really long hmd line that would exceed my strict rule of \
    maximum 80 columns, but fortunalety hmd supports the trailing backslash, \
    this make me really happy.