Markdown 如何在另一个标记文件中读取标记文件?

Markdown 如何在另一个标记文件中读取标记文件?,markdown,Markdown,我的目的是为一篇集成的文章收集许多以标记方式写入单个标记文件的描述 例如,在./f1/a.md中 This is the description for f1 project. 和在./b.md The introduction of f1 project is shown below, <!-- Contain of the a.md goes here --> 那么,如何实现此功能呢?标记本身不支持文件包含,但根据您使用的标记处理器,您有两个选项: 一些降价处理器支持多

我的目的是为一篇集成的文章收集许多以标记方式写入单个标记文件的描述

例如,在./f1/a.md中

This is the description for f1 project. 
和在./b.md

The introduction of f1 project is shown below, 
<!-- Contain of the a.md goes here -->

那么,如何实现此功能呢?

标记本身不支持文件包含,但根据您使用的标记处理器,您有两个选项:

  • 一些降价处理器支持多个输入文件。例如,可以获取多个输入文件并生成单个输出文件:

    pandoc -o output.html one.md two.md three.md
    
  • 您可以简单地按正确的顺序将各个源文件连接在一起,然后将该连接的文件作为单一输入用于灵活性较差的解析器:

    cat one.md two.md three.md > source.md
    markdown source.md
    
    如果您使用的是Windows,则可能需要将
    cat
    替换为
    type

    根据输入的复杂性,您可能希望自动化此过程。像这样的工具可以帮助解决这个问题

cat one.md two.md three.md > source.md
markdown source.md