在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):jreese/markdown-pp开源软件地址(OpenSource Url):https://github.com/jreese/markdown-pp开源编程语言(OpenSource Language):Python 99.0%开源软件介绍(OpenSource Introduction):Markdown Preprocessor (MarkdownPP)NOTICE: This project is no longer actively maintained. It will not receive any future releases. The Markdown Preprocessor is a Python module designed to add extended features on top of the excellent Markdown syntax defined by John Gruber. These additions are mainly focused on creating larger technical documents without needing to use something as heavy and syntactically complex as Docbook. MarkdownPP uses a set of selectable modules to apply a series of transforms to the original document, with the end goal of generating a new Markdown document that contains sections or features that would be laborious to generate or maintain by hand. Documents designed to be preprocessed by MarkdownPP should try to follow the convention of naming files with a .mdpp extension, so that MarkdownPP can generate a document with the same name, but with the standard .md extension. As an example, this document in raw format is named "readme.mdpp", and the generated document from MarkdownPP is named "readme.md" so that GitHub can find and process that document when viewing the repository. 1. Installation and Usage 1. Installation and UsageCurrently, you'll need to download the source code from GitHub or clone the repository, and the run the installation script manually.
There are two components to the project: a Python module, Assuming you have a file named
If you do not specify an output file name, the results will be printed to stdout, enabling them to be piped to another command. By default, all available modules are enabled. You can specify a list of modules to exclude:
To see usage instructions, including a list of enabled modules, supply the -h or --help arguments:
2. Modules2.1. IncludesIn order to facilitate large documentation projects, MarkdownPP has an Include
module that will replace a line of the form File
File
File
Compiling
Furthermore, the Include module supports the shifting of headers in the file to be included. For example, File
File
Compiling
2.2. IncludeURLsFacilitates the inclusion of remote files, such as files kept in a subversion
or GitHub repository. Like Include, the IncludeURL module can replace a line of
the form IncludeURL runs immediately after the Include module finishes executing. This means that is it possible to include local files that then require remote files, but impossible parse !INCLUDE statements found in remote files. This is prevent ambiguity as to where the file would be located. Remote file
Remote file
Local file
Compiling
2.3. IncludeCodeFacilitates the inclusion of local code files. GFM fences will be added around the included code. Local code file
Local file
Compiling
Furthermore the IncludeCode module supports line extraction and language specification. The line extraction is like python list slicing (e.g. 3:6; lines three to six). Please note that line counting starts at one, not at zero. Local file
Compiling
2.4. Table of ContentsThe biggest feature provided by MarkdownPP is the generation of a table of
contents for a document, with each item linked to the appropriate section of the
markup. The table is inserted into the document wherever the preprocessor finds
2.5. ReferenceSimilarly, MarkdownPP can generate a list of references that follow Markdown's
alternate link syntax, eg 2.6. LaTeX RenderingLines and blocks of lines beginning and ending with $ are rendered as LaTeX, using QuickLaTeX. For example,
becomes 2.7. YouTube EmbedsAs GitHub-flavored Markdown does not allow embed tags, each line of the form
For example,
becomes 3. ExamplesExample file.mdpp:
The preprocessor would generate the following Markdown-ready document file.md:
4. SupportWhile the project should work on most recent versions of Python, this project is no longer supported. 5. References |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论