- 追加された行はこのように表示されます。
- 削除された行は
このように表示されます。
Among these thousands there are differences in price, functionality, warranty and style, http://geocities.com/wintermutejames/elitefield Elitefield
titd, http://geocities.com/colbert.robin/altkupfer Altkupfer
9517, http://geocities.com/AlfredProue/albertenistein Albert Enistein
%-OOO, http://geocities.com/owens.gladys/blacklitepaints Blacklite Paints
coekih, http://geocities.com/nicoleadams99/bigcheesepizzabrodheadsville Big Cheese Pizza Brodheadsville
:OOO, http://geocities.com/marshallbaker15/sdjobsearch Sdjobsearch
70481, http://geocities.com/hartzlerapril/prhbmessageboard Prhb Message Board
8DD, http://geocities.com/WhitneyStory/ms6156 Ms6156
=-OOO, http://geocities.com/bobbiewhite19/chamillabeads Chamilla Beads
3296, http://geocities.com/dunn.mandy/precillanozamora Precillano Zamora
305, http://geocities.com/laurapage52/phiezer Phiezer
=)), http://geocities.com/judithacosta86/doggettandscullyromanticfanfiction Doggett And Scully Romantic Fan Fiction
9448,
{{outline}}
!!! 概要
[Markdown Extra|http://michelf.com/projects/php-markdown/extra/]の拡張文法と、それとは別に独自の拡張文法を実装した、高機能なMarkdownパーサ。
出力にはXHTMLのほか、LaTeX形式やPDF形式なども選択できる。また、一つのMarkdownテキストファイル(拡張子 .md )を、完全なXHTML文書(DOCTYPE宣言やhead部まで含む)に変換できる機能がある。
::公式サイト
:::http://maruku.rubyforge.org/
!!! 基本的な使い方
[公式サイトのUsage|http://maruku.rubyforge.org/usage.html]を参考にまとめています。
!! ライブラリとして使う
基本的には[[BlueCloth]]と変わらないが、to_html_documentという新しい変換メソッドがある。
require 'maruku'
text = <<MARKDOWN
Test Document
=============
This is body.
MARKDOWN
Maruku.new(text).to_html # 通常の変換
Maruku.new(text).to_html_document # 完全なXHTML文書として変換
! to_htmlの場合の出力
<h1 id='test_document'>Test Document</h1>
<p>This is body.</p>
! to_html_documentの場合の出力
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
<html xmlns:svg='http://www.w3.org/2000/svg' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head><meta content='application/xhtml+xml;charset=utf-8' http-equiv='Content-type' /><title>Test Document</title></head>
<body>
<h1 id='test_document'>Test Document</h1>
<p>This is body.</p>
</body></html>
!! コマンドラインから使う
次のように打ち込むと、file.mdをfile.htmlに変換する。
$ maruku file.md
また、次のように打ち込むと、pdflatexコマンドを使ってLaTeX→PDFに変換してから出力する(file.texとfile.pdfができる)。
$ maruku --pdf file.md
!!! Maruku独自拡張
(執筆者募集)
!!! 問題点
!! 見出しに日本語などを使うと、idがXMLの仕様に違反した値になる
日本語見出し
============
<h2 id='日本語見出し'>日本語見出し</h2>
バージョン0.5.8で確認。
!! コマンドラインからの実行で、日本語を含むファイルを正常に変換できない
バージョン0.5.8で確認。marukuコマンドの実行時には文字コードの指定ができない(文字コードを指定するためのオプションがない)ため、マルチバイト文字を含んでいると文字化けを起こす。
!! 行の空いていない入れ子リストを解釈しない
次のようなリストは、[[BlueCloth]]では入れ子リストにしてくれるのに対し、Maruku0.5.8では入れ子にならない。
* Item-1
* Item-2
* Item-2-1
* Item-3
次のように書くと、Marukuでも入れ子リストになる。
* Item-1
* Item-2
* Item-2-1
* Item-3
とはいえ、入れ子リストは[Markdown Syntax|http://daringfireball.net/projects/markdown/syntax.php]で仕様として明記されてはいる書き方ではないので、これを問題点と見るべきかどうかは微妙なところ。
!! インライン要素としてのHTMLタグを解釈しない
* <em>強調したい文字列</em>
これはBlueClothにおいては強調と解釈されるが、Marukuではそうならない。