MarkdownPages.CLI
0.1.0
dotnet tool install --global MarkdownPages.CLI --version 0.1.0
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local MarkdownPages.CLI --version 0.1.0
#tool dotnet:?package=MarkdownPages.CLI&version=0.1.0
nuke :add-package MarkdownPages.CLI --version 0.1.0
Markdown Pages
- Author: Stardust D.L.
- Version: 0.1
A CLI tool to render markdown (use Markdig inside).
Introduction
How mdp come: I like to take notes in markdown, but it's not really convient to build pages for many files. So I make this tool to do that.
You can use mdp to:
- Render your markdown documents to static pages in the directory
- Run a server to host the static pages
Install
When .NET Core 2.1 is released, I will add this as a global tool.
Use .NET Core 2.1
$ dotnet tool install -g MarkdownPages.CLI
Usage
You can use
mdp help
to get helps andmdp version
to show the version.
Initialize
Initialize the mdp repository or reinitialize it.
When you update mdp, please use this command to update associated files. For next version, I may add a new command
migrate
to do this.
$ mdp init
Create a new document
Create a new document.
$ mdp new <file name>
The new document will be create in the root directory, the file name will be the title of the document. If you use a path for file name, then mdp will create sub-directories, and use the path for the category of the document.
Build
Build all markdown documents.
The builed files will at .mdp/build/
$ mdp build
Serve
Run a server to host the static pages.
The host uri is http://localhost:16000
$ mdp serve
Files
Document
For every document, the head lines will be like this:
---
author: author
category: category1/category2
tags: tag1,tag2
title: title
---
Config
The config file is at .mdp/config.yaml
.
# default author
author: null
Template
The template file for document render is at .mdp/render/page.html
.
The built-in yield list:
Yield | Text in Template |
---|---|
Title | {title} |
Author | {copyright.author} |
Rendered document content | {content} |
Markdown Support
Basic grammar of Markdown (CommonMark)
2 kind of tables:
- Pipe tables (inspired from Github tables and PanDoc - Pipe Tables)
- Grid tables (inspired from Pandoc - Grid Tables)
Extra emphasis (inspired from Pandoc - Emphasis and Markdown-it)
- strike through
~~
, - Subscript
~
- Superscript
^
- Inserted
++
- Marked
==
- strike through
Special attributes or attached HTML attributes (inspired from PHP Markdown Extra - Special Attributes)
Definition lists (inspired from PHP Markdown Extra - Definitions Lists)
Footnotes (inspired from PHP Markdown Extra - Footnotes)
Auto-links generates links if a text starts with
http://
orhttps://
orftp://
ormailto:
orwww.xxx.yyy
Task Lists inspired from Github Task lists.
Extra bullet lists, supporting alpha bullet
a.
b.
and roman bullet (i
,ii
...etc.)Media support for media url (youtube, vimeo, mp4...etc.) (inspired from this CommonMark discussion)
Abbreviations (inspired from PHP Markdown Extra - Abbreviations)
Citation text by enclosing
""...""
(inspired by this CommonMark discussion )Custom containers similar to fenced code block
:::
for generating a proper<div>...</div>
instead (inspired by this CommonMark discussion )Figures (inspired from this CommonMark discussion)
Footers (inspired from this CommonMark discussion)
Mathematics/Latex extension by enclosing
$$
for block and$
for inline math (inspired from this CommonMark discussion)Emoji support (inspired from Markdown-it)
Diagrams extension whenever a fenced code block contains a special keyword, it will be converted to a div block with the content as-is (currently, supports
mermaid
andnomnoml
diagrams)
Dependencies
License
LGPLv3
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 2.1
- No dependencies.
Version | Downloads | Last updated |
---|