2014-11-21 3 views
1

지역 파일을 정적 웹 사이트에 코드 스 니펫으로 포함하고 싶습니다. 구문 분석 하이라이트에 대해 jade, marked 및 codemirror로 만들고 있습니다. 나는 이것을하기 위해 비취 필터를 쓸 것이다.codemirror 모드, 파일 확장자 및 github 맛이있는 markdown 코드 언어의 일치?

다음과 같은 점은 코드 확장 모드에서 codemirror 모드와 github 맞춤형 마크 다운 언어 (당신이``language ''를 쓸 때 쓰는 것)가 필요하다는 것입니다.

적어도 일부 codemirror 모드는 gfm 언어에 해당합니다. 모두 일치합니까? 어딘가에 목록이 있는가, 이름에 대한 근거가 있습니까?

덕분에 브래킷에서

답변

2

합니다 (CodeMirror.findModeByName 기능을 통해) 모드를 CodeMirror의 유통 동료 이름의 mode/meta.js 파일, 그리고, gfm 모드는이를 사용합니다 :이로를 설정했습니다 목록을 사용하여 언어를 선언하는 분리 된 코드 블록에 올바른 모드를 사용하십시오.

2

This list는 cm 모드 파일 확장자를 일치합니다. 당신이 (어제 발표) CodeMirror 버전 4.8을 얻을 경우

 
{"groovy": "groovy", 
"ini": "properties", 
"properties": "properties", 
"css": "css", 
"scss": "css", 
"html": "htmlmixed", 
"htm": "htmlmixed", 
"shtm": "htmlmixed", 
"shtml": "htmlmixed", 
"xhtml": "htmlmixed", 
"cfm": "htmlmixed", 
"cfml": "htmlmixed", 
"cfc": "htmlmixed", 
"dhtml": "htmlmixed", 
"xht": "htmlmixed", 
"tpl": "htmlmixed", 
"twig": "htmlmixed", 
"hbs": "htmlmixed", 
"handlebars": "htmlmixed", 
"kit": "htmlmixed", 
"jsp": "htmlmixed", 
"aspx": "htmlmixed", 
"ascx": "htmlmixed", 
"asp": "htmlmixed", 
"master": "htmlmixed", 
"cshtml": "htmlmixed", 
"vbhtml": "htmlmixed", 
"ejs": "htmlembedded", 
"dust": "htmlembedded", 
"erb": "htmlembedded", 
"js": "javascript", 
"jsx": "javascript", 
"jsm": "javascript", 
"_js": "javascript", 
"vbs": "vbscript", 
"vb": "vb", 
"json": "javascript", 
"xml": "xml", 
"svg": "xml", 
"wxs": "xml", 
"wxl": "xml", 
"wsdl": "xml", 
"rss": "xml", 
"atom": "xml", 
"rdf": "xml", 
"xslt": "xml", 
"xsl": "xml", 
"xul": "xml", 
"xbl": "xml", 
"mathml": "xml", 
"config": "xml", 
"plist": "xml", 
"xaml": "xml", 
"php": "php", 
"php3": "php", 
"php4": "php", 
"php5": "php", 
"phtm": "php", 
"phtml": "php", 
"ctp": "php", 
"c": "clike", 
"h": "clike", 
"i": "clike", 
"cc": "clike", 
"cp": "clike", 
"cpp": "clike", 
"c++": "clike", 
"cxx": "clike", 
"hh": "clike", 
"hpp": "clike", 
"hxx": "clike", 
"h++": "clike", 
"ii": "clike", 
"ino": "clike", 
"cs": "clike", 
"asax": "clike", 
"ashx": "clike", 
"java": "clike", 
"scala": "clike", 
"sbt": "clike", 
"coffee": "coffeescript", 
"cf": "coffeescript", 
"cson": "coffeescript", 
"_coffee": "coffeescript", 
"clj": "clojure", 
"cljs": "clojure", 
"cljx": "clojure", 
"pl": "perl", 
"pm": "perl", 
"rb": "ruby", 
"ru": "ruby", 
"gemspec": "ruby", 
"rake": "ruby", 
"py": "python", 
"pyw": "python", 
"wsgi": "python", 
"sass": "sass", 
"lua": "lua", 
"sql": "sql", 
"diff": "diff", 
"patch": "diff", 
"md": "markdown", 
"markdown": "markdown", 
"mdown": "markdown", 
"mkdn": "markdown", 
"yaml": "yaml", 
"yml": "yaml", 
"hx": "haxe", 
"sh": "shell", 
"command": "shell", 
"bash": "shell"} 
+0

옥 조각이 없습니다. – spelufo

관련 문제