Package: mdt-viewer
mdtMarkDown in Terminal - Renders a markdown page in the terminalWelcome to MarkDown in the Terminal!Hi! I am your first Markdown file that you can open withmdt.
If you want to learn aboutmdt, you can clone this repository and open me from the terminal withmdt show README.mdIf you want to play with Markdown, you can edit me. Once you have finished with me, you can run me in your terminal.ProjectThis project is a Markdown file reader for your terminal.mdtis built with Python, and uses the following libraries:Mistletoeto parse Markdown files.Python Prompt Toolkitfor the interactive mode.Clickto handle commmand line parameters.ansiwrapto perform the word wrapping.Featuresmdthas the following features:Interactive mode with dynamic adaptation to the terminal width.You can choose your favourite among some available themes.You can edit a them of add your own custom theme. Themes are defined with a simple JSON "CSS-like" format.Intelligent word wrapping.In interactive mode you can:Open web links in the defaultbrowser(requires a graphic sessions to work).Follow links to local files forward and backward, allowing a convenient exploration of "wiki-style" files.InstallationClone the repository.If you have administration permissions, run:pip install mdt-viewerCommandsThe following options are available:$ mdt --help
Usage: mdt [OPTIONS] COMMAND [ARGS]...

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  gallery  Shows a gallery with the available themes.
  show     Display the specified Markdown file.
  themes   Lists of available themes.CommandgalleryShows a sample markdown file with the application of all the available themes for demonstration purposes.CommandshowDisplays the specified markdown file with the default theme.The theme can be selected by specifying the number among the ones available, or by using the--theme-fileoption to specify a custom theme.$ mdt show --help
Usage: mdt show [OPTIONS] MDFILE

  Display the specified Markdown file.

Options:
  -i                 Interactive mode.
  --col INTEGER      Set the text width in number of columns.
  --rmargin INTEGER  Set the right margin.
  --theme INTEGER    Use a default theme by ID.
  --theme-file TEXT  Use the specified theme file.
  --help             Show this message and exit.Interactive modeWith the-ioption,mdtis started in "interactive mode".
It then uses an internal pager which allows the scrolling of the text, and an intelligent word-wrapping.Moreover, by pressing theTabkey, the pager moves to the next link in the markdown file.
PressingENTERon a link opens that link.
A link to a web page opens the browser.
A link to a file on the filesystem opens that file inmdt.
The history of opened files can be navigated using left and right arrows.Commandthemesmdtcomes with some sample themes.
This command lists the available themes.More themes will be added.
Pull requests are welcome to provide new themes.ThemimgThe themes are specified in a file with JSON format.
Examples are available in themdt/themesdirectory.The format is inspired by the one in theGlamour Go library, with some additional fields to provide more options.An example of theme file is:{
  "document": {
    "prefix": "",
    "suffix": "",
    "margin": 2
  },
  "block_quote": {
    "prefix": "",
    "suffix": "",
    "color": "",
    "background_color": "",
    "bold": false,
    "underline": false,
    "blink": false
  },
  ...where the styling items should be pretty straightforward to understand.The available items that can be themed are:documentblock_quote,paragraph,heading,h1,h2,h3,h4,h5,h6,strikethrough,emph,strong,item,list,link,selected_link,inline_code,block_code.