1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
Title: クラスリファレンス - BlueFeather マニュアル
CSS: black.css
<div class="back"><a href="index.html">BlueFeather マニュアル</a></div>
クラスリファレンス
====
このリファレンス内では、BlueFeather が拡張した Markdown 記法のことを指して「BFMarkdown 記法」と書く。
{toc}
`BlueFeather` モジュール
----
### `BlueFeather.parse(str)` {#parse_text}
### `BlueFeather.parse_text(str)`
BFMarkdown 記法で書かれた文字列をパースして、結果のHTML片(String)を返す。
### `BlueFeather.parse_file(path)` {#parse_text_file}
### `BlueFeather.parse_text_file(path)`
ファイル `path` の内容を読み取ってパースし、結果のHTML片(String)を返す。以下の記述と同じ。
BlueFeather.parse_text(File.read(path))
### `BlueFeather.parse_document(str, default_enc = EncodingType::UTF8)` {#parse_document}
BFMarkdown 記法で書かれた文字列をパースして、結果のHTML文書を返す。
default_enc は [EncodingType 定数](#EncodingType)で指定することができる。
詳細については[エンコーディングの取り扱い](encoding-rule.html)を参照。
### `BlueFeather.parse_document_file(path, default_enc = EncodingType::UTF8)` {#parse_document_file}
ファイル `path` の内容を読み取ってパースし、結果のHTML文書を返す。以下の記述と同じ。
BlueFeather.parse_document(File.read(path), default_enc)
### `BlueFeather::VERSION`
### `BlueFeather::VERSION_NUMBER`
BlueFeather のバージョンを表す定数。VERSION は文字列、VERSION_NUMBER は小数(Float)である。
`BlueFeather::Document` クラス
----
文書のメタデータと Markdown テキストの組を保持するクラス。
### `Document.parse(str, default_enc = EncodingType::UTF8)` {#Document-parse}
BFMarkdown記法で書かれた文字列をパースして、Document オブジェクトを返す。この時点ではテキストの変換は行わない。
default_enc は [EncodingType 定数](#EncodingType)で指定することができる。
詳細については[エンコーディングの取り扱い](encoding-rule.html)を参照。
### `Document.parse_io(io, default_enc = EncodingType::UTF8)` {#Document-parse_io}
引数として IO オブジェクトを受け取ること以外は [`Document.parse`](#Document-parse) と同じ。
### `Document.new(headers = {}, body = '')`
メタデータ(Hash)とテキスト(String)から、Document オブジェクトを生成して返す。この時点ではテキストの変換は行わない。
### `headers`
### `body`
その文書が持つメタデータ(Hash)と元テキスト(String)へのアクセサ。
### `self[key]`
### `self[key] = value`
メタデータの値を取得/設定する。`key` は Symbol か String で、小文字と大文字は区別されない。
### `title`
### `css`
それぞれ `doc['title']`, `doc['css']` と同じ。
### `encoding_type`
その文書のエンコーディングを取得する。返り値は EncodingType モジュール内の定数か、もしくは nil。
### `to_html`
その文書をHTML文書に変換する。返り値は String。
`BlueFeather::Parser` クラス
----
BFMarkdown 記法で書かれたテキストをパースするためのクラス。
`BlueFeather.parse` などのメソッドでは、内部的に Parser を生成して使用している。
### `Parser.new(*restrictions)`
Parser オブジェクトを生成する。`*restrictions` には以下の Symbol を与えることができる。
\:filter_html
: 変換前にすべてのHTMLタグをエスケープする(=HTMLタグの記述を無効化する)。
### `parse(str)`
### `parse_text(str)`
### `parse_document(str)`
### `parse_file(path)`
### `parse_text_file(path)`
### `parse_document_file(path)`
それぞれ BlueFeather モジュールに定義された同名のメソッドと同じ。
### `use_header_id`
### `use_header_id = bool`
見出しにIDを付ける機能を有効にするかどうかのスイッチ(標準では true)。この機能をオフにすると、BFMarkdown の目次は利用できない。
### `display_warnings`
### `display_warnings = bool`
BlueFeather では不正なIDなどを見つけたときに、出力されるHTMLの中に警告を含める機能がある。これを有効にするかどうかのスイッチ(標準では true)。
`BlueFeather::EncodingType` モジュール {#EncodingType}
----
### `UTF8`, `UTF_8`
### `EUC`, `EUCJP`, `EUC_JP`
### `SJIS`, `SHIFT_JIS`
### `ASCII`, `US_ASCII`
BlueFeather におけるエンコーディングの種類を表す定数(String)。
|