最成熟、维护最完善的 Markdown 处理器是什么?

发布于 2024-09-16 03:09:47 字数 133 浏览 9 评论 0原文

我需要在命令行处理 Markdown,所以没有真正的语言限制。

额外的功能,例如漂亮的引号和破折号,是值得欢迎的补充。代码块是必须的,但我认为它们是核心的一部分。

我只想输出为 HTML,并且我使用的是 Unix 环境。

I need to Process Markdown at the command line, so there is no real language restriction.

Extra features such as pretty quotes and dashes are a welcome addition. Code blocks are a must, but they are part of the core I think.

I want to output to HTML only, and I'm on a Unix environment.

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

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

发布评论

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

评论(6

最冷一天 2024-09-23 03:09:47

Pandoc 允许您将 Markdown 转换为 HTML(以及返回!)和 还有更多

Pandoc allows you convert Markdown to HTML (and back!) and much more.

久伴你 2024-09-23 03:09:47
$ pandoc --help
pandoc [OPTIONS] [FILES]
Input formats:  
       native, json, markdown, markdown+lhs, rst, rst+lhs, 
       textile, html, latex, latex+lhs
Output formats:  
      native, json, html, html+lhs, s5, slidy, docbook, 
      opendocument, latex, latex+lhs, context, texinfo, 
      man, markdown, markdown+lhs, plain, rst, rst+lhs, 
      mediawiki, textile, rtf, org, odt, epub
Options:
  -f FORMAT, -r FORMAT  --from=FORMAT, --read=FORMAT                    
  -t FORMAT, -w FORMAT  --to=FORMAT, --write=FORMAT                     
  -s                    --standalone                                    
  -o FILENAME           --output=FILENAME                               
  -p                    --preserve-tabs                                 
                        --tab-stop=NUMBER                               
                        --strict                                        
                        --normalize                                     
                        --reference-links                               
  -R                    --parse-raw                                     
  -S                    --smart                                         
  -5                    --html5                                         
  -m[URL]               --latexmathml[=URL], --asciimathml[=URL]        
                        --mathml[=URL]                                  
                        --mimetex[=URL]                                 
                        --webtex[=URL]                                  
                        --jsmath[=URL]                                  
                        --mathjax[=URL]                                 
                        --gladtex                                       
  -i                    --incremental                                   
                        --offline                                       
                        --xetex                                         
                        --chapters                                      
  -N                    --number-sections                               
                        --listings                                      
                        --section-divs                                  
                        --no-wrap                                       
                        --columns=NUMBER                                
                        --ascii                                         
                        --email-obfuscation=none|javascript|references  
                        --id-prefix=STRING                              
                        --indented-code-classes=STRING                  
                        --toc, --table-of-contents                      
                        --base-header-level=NUMBER                      
                        --template=FILENAME                             
  -V KEY:VALUE          --variable=KEY:VALUE                            
  -c URL                --css=URL                                       
  -H FILENAME           --include-in-header=FILENAME                    
  -B FILENAME           --include-before-body=FILENAME                  
  -A FILENAME           --include-after-body=FILENAME                   
  -T STRING             --title-prefix=STRING                           
                        --reference-odt=FILENAME                        
                        --epub-stylesheet=FILENAME                      
                        --epub-cover-image=FILENAME                     
                        --epub-metadata=FILENAME                        
  -D FORMAT             --print-default-template=FORMAT                 
                        --bibliography=FILENAME                         
                        --csl=FILENAME                                  
                        --natbib                                        
                        --biblatex                                      
                        --data-dir=DIRECTORY                            
                        --dump-args                                     
                        --ignore-args                                   
  -v                    --version                                       
  -h                    --help

$ pandoc --version
pandoc 1.8.2

Compiled with citeproc support.

Compiled with syntax highlighting support for:

Actionscript, Ada, Alert, Alert_indent, Ansys, Apache, 
Asn1, Asp, Awk, Bash, Bibtex, Boo, C, Changelog, Cisco, 
Cmake, Coffeescript, Coldfusion, Commonlisp, Cpp, Cs, 
Css, Cue, D, Desktop, Diff, Djangotemplate, Doxygen, 
Doxygenlua, Dtd, Eiffel, Email, Erlang, Fortran, Fsharp, 
Fstab, Gap, Gdb, Gettext, Gnuassembler, Go, Haskell, 
Haxe, Html, Idl, Ilerpg, Ini, Java, Javadoc, Javascript, 
Json, Jsp, Latex, Lex, LiterateHaskell, Lua, M3u,  
Makefile, Mandoc, Matlab, Maxima, Mediawiki, Metafont, 
Mips, Modula2, Modula3, Monobasic, Nasm, Noweb, 
Objectivec, Objectivecpp, Ocaml, Octave, Pango, Pascal, 
Perl, Php, Pike, Postscript, Prolog, Python, R, 
Relaxngcompact, Rhtml, Ruby, Scala, Scheme, Sci, Sed, 
Sgml, Sql, SqlMysql, SqlPostgresql, Tcl, Texinfo, 
Verilog, Vhdl, Winehq, Wml, Xharbour, Xml, Xorg, Xslt, 
Xul, Yacc, Yaml
Copyright (C) 2006-2011
$ pandoc --help
pandoc [OPTIONS] [FILES]
Input formats:  
       native, json, markdown, markdown+lhs, rst, rst+lhs, 
       textile, html, latex, latex+lhs
Output formats:  
      native, json, html, html+lhs, s5, slidy, docbook, 
      opendocument, latex, latex+lhs, context, texinfo, 
      man, markdown, markdown+lhs, plain, rst, rst+lhs, 
      mediawiki, textile, rtf, org, odt, epub
Options:
  -f FORMAT, -r FORMAT  --from=FORMAT, --read=FORMAT                    
  -t FORMAT, -w FORMAT  --to=FORMAT, --write=FORMAT                     
  -s                    --standalone                                    
  -o FILENAME           --output=FILENAME                               
  -p                    --preserve-tabs                                 
                        --tab-stop=NUMBER                               
                        --strict                                        
                        --normalize                                     
                        --reference-links                               
  -R                    --parse-raw                                     
  -S                    --smart                                         
  -5                    --html5                                         
  -m[URL]               --latexmathml[=URL], --asciimathml[=URL]        
                        --mathml[=URL]                                  
                        --mimetex[=URL]                                 
                        --webtex[=URL]                                  
                        --jsmath[=URL]                                  
                        --mathjax[=URL]                                 
                        --gladtex                                       
  -i                    --incremental                                   
                        --offline                                       
                        --xetex                                         
                        --chapters                                      
  -N                    --number-sections                               
                        --listings                                      
                        --section-divs                                  
                        --no-wrap                                       
                        --columns=NUMBER                                
                        --ascii                                         
                        --email-obfuscation=none|javascript|references  
                        --id-prefix=STRING                              
                        --indented-code-classes=STRING                  
                        --toc, --table-of-contents                      
                        --base-header-level=NUMBER                      
                        --template=FILENAME                             
  -V KEY:VALUE          --variable=KEY:VALUE                            
  -c URL                --css=URL                                       
  -H FILENAME           --include-in-header=FILENAME                    
  -B FILENAME           --include-before-body=FILENAME                  
  -A FILENAME           --include-after-body=FILENAME                   
  -T STRING             --title-prefix=STRING                           
                        --reference-odt=FILENAME                        
                        --epub-stylesheet=FILENAME                      
                        --epub-cover-image=FILENAME                     
                        --epub-metadata=FILENAME                        
  -D FORMAT             --print-default-template=FORMAT                 
                        --bibliography=FILENAME                         
                        --csl=FILENAME                                  
                        --natbib                                        
                        --biblatex                                      
                        --data-dir=DIRECTORY                            
                        --dump-args                                     
                        --ignore-args                                   
  -v                    --version                                       
  -h                    --help

$ pandoc --version
pandoc 1.8.2

Compiled with citeproc support.

Compiled with syntax highlighting support for:

Actionscript, Ada, Alert, Alert_indent, Ansys, Apache, 
Asn1, Asp, Awk, Bash, Bibtex, Boo, C, Changelog, Cisco, 
Cmake, Coffeescript, Coldfusion, Commonlisp, Cpp, Cs, 
Css, Cue, D, Desktop, Diff, Djangotemplate, Doxygen, 
Doxygenlua, Dtd, Eiffel, Email, Erlang, Fortran, Fsharp, 
Fstab, Gap, Gdb, Gettext, Gnuassembler, Go, Haskell, 
Haxe, Html, Idl, Ilerpg, Ini, Java, Javadoc, Javascript, 
Json, Jsp, Latex, Lex, LiterateHaskell, Lua, M3u,  
Makefile, Mandoc, Matlab, Maxima, Mediawiki, Metafont, 
Mips, Modula2, Modula3, Monobasic, Nasm, Noweb, 
Objectivec, Objectivecpp, Ocaml, Octave, Pango, Pascal, 
Perl, Php, Pike, Postscript, Prolog, Python, R, 
Relaxngcompact, Rhtml, Ruby, Scala, Scheme, Sci, Sed, 
Sgml, Sql, SqlMysql, SqlPostgresql, Tcl, Texinfo, 
Verilog, Vhdl, Winehq, Wml, Xharbour, Xml, Xorg, Xslt, 
Xul, Yacc, Yaml
Copyright (C) 2006-2011
琉璃梦幻 2024-09-23 03:09:47

我一直在使用 python http://www.freewisdom.org/projects/python-markdown / 到目前为止没有任何问题,并且它有一个简单的扩展机制。

I've been using python with http://www.freewisdom.org/projects/python-markdown/ without any problem so far, and it has a simple extension mechanism.

半﹌身腐败 2024-09-23 03:09:47

还有 Discount,David Parsons 用 C 实现了 John Gruber 的 Markdown 文本到 html 语言。 Discount 由多个命令行工具组成,包括 markdownmkd2htmlmakepagemktagstheme< /代码>。

http://www.pell.portland.or.us/~orc/代码/折扣/

There's also Discount, David Parsons' C implementation of John Gruber's Markdown text to html language. Discount consists of several command-line tools including markdown, mkd2html, makepage, mktags and theme.

http://www.pell.portland.or.us/~orc/Code/discount/

还推荐 Pandoc,它有以下好处:

  1. pandoc markdown 中的代码语法突出显示对于 html 来说非常有用,而且还在不断增长!
  2. pandoc markdown 支持类似于 github 风格的 markdown
  3. 除了 html 之外还有更多的输出格式,这可能是你以后需要的,比如电子书

它很强大!

Also recommend Pandoc with below benefit:

  1. code syntax highlighting in pandoc markdown is great for html, and it is growing !
  2. pandoc markdown support is similar to github flavored markdown
  3. more output format besides html, which probably you need in later like ebook

It is powerful!

遗心遗梦遗幸福 2024-09-23 03:09:47

我不确定维护的是什么,而且我当然偏向于在这里使用它最多,但是SO使用的那个也可以在github上找到,它是markdownsharp 项目,用 C# 编写,维护得很好。

它修复了原始 Markdown 实现中的许多错误,这些错误是 SO 用户在提出问题时发现的,就像大多数事情一样,只是一个出于必要而出现的项目。话虽这么说,Markdown 的某些工作方式是按照规范设计的,但不一定是直观的,维护者有特权决定要采取什么操作,直观与规范......所以您可能需要稍微调整任何实现,才能在某些边缘情况下准确获得您想要的结果。

I'm not sure what the most maintained is, and I'm certainly biased by using it here most, but the one SO uses is also available on github, it's the markdownsharp project, written in C# and pretty well maintained.

It fixes many of the bugs in the original markdown implementation, found by SO users as questions were asked, like most things, just a project that came out of a necessity. That being said, some of how markdown works is as designed per the spec, but isn't necessarily intuitive, it's the maintainers prerogative there as to what action to take there, intuitive vs spec...so you may have to adjust any implementation a bit to get exactly what you want in some edge cases.

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