我想编写一个文档,以通过' Limes&#x27查看。命令。在哪里可以找到格式标准规格?

发布于 2025-02-10 16:25:39 字数 361 浏览 2 评论 0原文

我想转换MARKDOWN文件,以便可以通过 ...

但是,我希望保留并相应地保留格式(粗体,斜体等)...不幸的是我找不到规格。


我首选的方法是使用 pandoc 将md-files转换为该文件类型可以正确显示...

I would like to convert Markdown files so these can be viewed via less...

However, I want the formatting (bold, italic, etc.) to be preserved and displayed accordingly... Unfortunately I cannot find the specifications.


My preferred approach would have been to use Pandoc to convert the md-files into a file type that less can properly display...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

香草可樂 2025-02-17 16:25:39

pandoc支持的任何格式的文件都可以像Unix Man页面一样读取:

pandoc --standalone --to=man INPUT_FILE | man -l -

默认情况下使用,除非您将pager变量设置为其他值。

使用它的一种好方法是创建一个外壳功能:

mandoc () { pandoc --standalone --to=man "$@" | man -l - }

现在您可以使用Markdown,Docx,Latex等读取文件,就好像它们是手页一样。

mandoc README.md
mandoc term-project.tex
mandoc thesis.docx
# and so on

如您所见,该命令使Pandoc将其输入转换为称为Man的格式,这确实是Groff Man(请参阅 https://man.cx/groff_man(7))。

Files of any format supported by pandoc can be read like Unix man pages:

pandoc --standalone --to=man INPUT_FILE | man -l -

This uses less by default, unless you have the PAGER variable set to some other value.

A good way to use it is to create a shell function:

mandoc () { pandoc --standalone --to=man "$@" | man -l - }

Now you can read files using Markdown, docx, LaTeX, etc. as if they were manpages.

mandoc README.md
mandoc term-project.tex
mandoc thesis.docx
# and so on

As you can see, the command causes pandoc to convert its input to a format called man, which is really groff man (see https://man.cx/groff_man(7)).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文