IDE와 같은 코드 (Ruby, PHP, JavaScript ...)를 강조 표시 할 수있는 도구를 찾고 코드를 HTML 형식으로 내 보내어 html 페이지 코드는 IDE와 비슷합니다.코드 강조 표시를 추가하고 HTML로 내보내기 도구
답변
편집자의 독립, 당신은 단순히 루비 syntax 보석을 사용할 수 있습니다. 여기에 당신이 찾고있는 기능을 보여주는 사용자 가이드,의 발췌입니다
require 'syntax/convertors/html'
convertor = Syntax::Convertors::HTML.for_syntax "ruby"
html = convertor.convert(File.read("program.rb"))
puts html
이맥스는 또한 컬러 소스 코드에 code2html (project page)를 사용할 수 있습니다 http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el.cgi
사용하여 HTML로 코드를 수출 지원합니다.
code2html file.c > code.html
주를 복제 : "공식적인"버전은'와 HTML을 생성하는' 이제는 더 이상 사용되지 않는 태그들. 대신 CSS를 생성하는 자체 버전을 사용합니다. 이 패치 된 CSS 지원 버전은 내 웹 사이트 (http://www.field-theory.org/software/index.html#code2html – user8472
)에 래퍼로 다운로드 할 수 있습니다. http://ysgitdiary.blogspot.fi/2012 /07/code2html-sh-wrapper-for-create-folder.html –
Textmate도 할 수 있습니다. TextMate 번들의 "문서에서 HTML 만들기"를 참조하십시오.
highlight_file PHP 전용 솔루션이지만 빠르다.
<?php highlight_file("somefile.php"); // basic usage
highlight_file(__FILE__);
$out = highlight_file("file.php") // string variable, can be written to file etc.
?>
기타 - 시도해 보셨습니까? GeSHi?
가능한 것은 code2html에 http://stackoverflow.com/search?q=highlight+code –