bhl-modeのinfo の読書メモ

muse(emacs-wiki) に対する、もうひとつの html パブリッシングモードである bhl のインフォ リーディングメモ

bhl-mode manual を読みながら書いた。

3. The Syntax
3.1 Title and paragraphs
3.2 Sections
3.3 Fonts and environments
3.4 Escaping characters
3.5 Handling links
3.6 Handling lists
3.7 Handling tables
3.8 Handling images
4 Properties of conversion
4.1 Overview of properties
4.2 Specifications
5 Browsing your document
5.1 The table of contents
5.2 The list of links
6 Commands and key bindings
6.1 Conversion commands
6.2 Inserting
6.3 Browsing the BHL file
6.4 Changing font
6.5 Miscellaneous
7 Options
7.1 Global options
7.7 Wiki options

3. The Syntax

3.1 Title and paragraphs

#!subtitle!My subtile subtitle

3.2 Sections

`num'
     1.<SPC>A section
     1.1.<SPC>A subsection
     1.1.1.<SPC>A subsubsection
`alpha'
     A.<SPC>A section
     A.A.<SPC>A subsection
     A.A.A.<SPC>A subsubsection
`aster'
     *<SPC>A section
     **<SPC>A subsection
     ***<SPC>A subsubsection
`equal-sign'
     =<SPC>A section
     ==<SPC>A subsection
     ===<SPC>A subsubsection
変数BHL-AUTOGUESS-STYLE-FLAG
デフォは t
セクションスタイルを推論するかのフラグ
C-c M-s (bhl-guess-style)
マニュアルにセクションスタイルを推論
変数BHL-SECTIONING-DEFAULT-STYLE
デフォールトのセクションスタイル

ひとつのバッファに複数のセクションスタイルを混在させてはいけない

M-x(bhl-sectioning-switch-style)
セクションスタイルのスイッチ
変数 BHL-MY-SECTIONING-REGEXP-LIST
C-c M-t(bhl-update-toc)

3.3 Fonts and environments

3.3.1 Font beautifiers

*a word* ::
  ボールド
_a word_ ::
  強調
  HTMLと LaTex では下線
_*a word*_
  ボールドイタリック
__a word__
  アンダースコアが前後二個ずつで下線
==a word==
  トゥルータイプフォント

3.3.2 Comments

- # から行末まではコメント - コメントはどこにでも挿入できる。 - # をコメント開始以外に使いたいときはバックスラッシュでエスケープ
C-c ; (bhl-comment-region)
リージョンをコメントアウト
C-u C-c ; (bhl-comment-region)
リージョンからコメント記号を外す
M-x bhl-hide-comment
コメント非表示(トグル)

3.3.3 Environments

bhl は、以下の の3環境を取り扱うことができる。
quote
テキスト引用につかう
verbatim
プログラムを挿入するのに便利
minipage
ページ内のページ
3.3.3.1 Quote environment
タブを行頭に挿入する。
 	Put some words here.
	Put some words here.
	Put some words here.
	Put some words here.
3.3.3.2 Verbatim environment

二連続ダッシュだけの行でかこむ

※4連続ダッシュは水平線になることに注意

--
Put some words here.
--

3.3.3.3 Minipage environment

%%%
センタリングして置くミニページの開始記号
<%%
最初の文字を <,> に置換すれば、それぞれ左寄せ<%% または右寄せ >%%
<-%
二番目の文字がダッシュなら、枠をつける
[12cm]
%%%[12cm]
This minipage (12cm) will be centered without border.
%%%

<%%[10cm]
This minipage (10cm) will be put on the left without border.
%%%

>-%
This minipage will be put on the right with borders.
%%%

3.3.4 Horizontal rules

行頭の 4連続ダッシュ'----'
水平線
行頭の 4連続等号'===='
水平線(Large)
行頭の 4連続スラッシュ'////'
水平線(X-Large)

↓のようにミニページ同様の規則で、左右寄せやサイズを指定できる

----[12cm]
<---[12cm]
>---[12cm]
M-x bhl-insert-hr
水平線の挿入

3.4 Escaping characters

特殊文字 *_#\ はバックスラッシュでエスケープできる。

3.5 Handling links

3.5.1 What is a link?

URL または WikiWord 上で RET もしくは mouse-2 クリックすると URL なら関数bhl-browse-url-function、WikiName ならWikiName.bhl なファイルが呼ばれる。

:C-c C-/( bhl-show-lol):リンクのリスト :C-c C-c l (bhl-insert-lol):リンクのリストを挿入 :C-<TAB> (bhl-goto-next-url-or-wiki):リンク先をブラウズ

3.5.2 Converting Links

ベタ書きの http:// ftp://, file:/// なリンクを html なリンクに変換する関数

関数bhl-convert-url
URL を変換
関数bhl-convert-wiki-names
WikiName を変換

HTML への変換の例

'http://site.org'
     <a href="http://site.org">http://site.org</a>

`url:mypage.html'
     <a href="mypage.html">mypage.html</a>

`[[http://site.org][SITE]]'
     <a href="http://site.org">SITE</a>

`mailto:bb@site.fr'
     <a href="mailto:bb@site.org>bb@site.org</a>

`[[mailto:bb@site.fr][BB]]'
     <a href="mailto:bb@site.org>BB</a>

TXT フォーマットへの変換の例

`http://site.org'
     http://site.org

`url:mypage.html'
     mypage.html

`[[http://site.org][SITE]'
     http://site.org (SITE)

`mailto:bb@fardeau.fr'
     bb@fardeau.fr

`[[mailto:bb@fardeau.fr][BB]]'
     bb@fardeau.fr (BB)

3.6 Handling lists

bhl は、non-ordered lists, ordered lists ,descriptive (or definition) lists の三種のリストを使うことができる。

non-ordered lists
ordered lists

descriptive lists : :

以下 info の記述を引用

`<TAB(S)>[,-,o]<SPC>'
     item of a non-ordered list

`<TAB(S)>[0-9].<SPC>'
     item of an ordered list (enumerate)

`<TAB(S)>A term<SPC>--<SPC>'
     item of a definition list

http://www.nongnu.org/bhl に例がある。

3.7 Handling tables

表は、パイプ'|'でセルを区切る。

muse とちがって、両端にもパイプが必要であることに注意

行頭と左端のパイプの前にタブや空白文字を置いてはいけない

| @Name@  | @First name@  | @Age@  |
| Jean    | Luc-Henri     | 123    |
| Paul    | Matthieu      | 2      |

上の例のように、ヘッダ行のセル要素は @ で囲む。

変数 bhl-table-align
変数 bhl-table-cell-align

3.8 Handling images

bhl2html でのみ有効

[]image.jpg[]

C-c C-c i (bhl-insert-image)
イメージの挿入

4 Properties of conversion

htmlでは表を出すけれど、LaTeX では出さない、といった制御をするらしい。

4.1 Overview of properties

トバス

4.2 Specifications

Specification の例

#!html!prefix:check:caption:toc
#!latex!noprefix:nocheck:nocaption:notoc
#!date!It's %H:%M.

Specification 行はコメント行

Specification 行は感嘆符'!'で区切った接頭辞とその後に続く、コロンで区切られたラベルからなる。

上の例では、html が接頭辞で、その後に ラベル、prefix が指定され、と読む

ラベル先頭に 'no-' をつけるとそのラベルの否定として働く。

以下、ウエブパブリッシュに関係ありそうな奴を抜粋

`#!author!'
     The name of the author for the current document.

`#!title!'
     The title of the document. This specification overrides any other
     title (the first line of the buffer or any `#!xxx-title!'
     specification).

`#!xxx-title!'
     The title of the document for the `xxx' conversion. `xxx' may be
     `html', `sgml', `texi' or `latex'. This specification is overriden
     by the `#!title!' specification, and overrides the first line of
     the buffer.

`#!subtitle!'
     The subtitle of the document.  The subtitle conversion is supported
     only for the HTML, Texinfo and TXT output.

`#!lang!'
     The language of the document.  This override the value of
     BHL-I18N-CONVENTIONS.  In the Texinfo output, it sets the value of
     `@documentlanguage'.

`#!encoding!'
     The encoding of the document.  This information is relevant for the
     Texinfo and HTML conversion.  In the Texinfo output, it sets the
     value of `@documentencoding'.  In the HTML output, it overrides the
     value of BHL-HTML-CONTENT-TYPE.

`#!date!'
     The date of the current document.  Since the column has no special
     meaning here, you can use the Emacs time-formatting conventions.
     For example, `#!date!%H:%M' will set `date' to the current time
     (hours:minutes). *note (Elisp)Time Conversion::.

`#!html!'
     The prefix concerning `bhl2html' specifications.  Here is a
     complete list of available labels:

    `prefix'
          Insert the prefix of (sub)sections.

    `check'
          Check for dubious HTML tags/comments before converting.

    `caption'
          Ask for a caption when converting a table.

    `i18n'
          Use i18n conventions.

    `toc'
          Insert the table of content in the HTML output.

`#!html-style!'
     The CSS file to refer to as the style for the HTML output.

`#!sgml!'
     The prefix of `bhl2sgml' specifications.  Here is a complete list
     of available labels:

    `check'
          Check for dubious SGML tags/comments before converting.

    `caption'
          Ask for a caption when converting a table.

    `i18n'
          Use i18n conventions.

`#!txt!'
     The prefix of `bhl2txt' specifications.  Here is a complete list
     of available labels:

    `center'
          Center the title and (sub)sections' titles.

    `toc'
          Insert the table of content in the TXT output.

    `tas'
          tabs are spaces: convert tabs to whitespaces in the TXT
          output.

5 Browsing your document

C-c C-t(bhl-show-toc)
M-x bhl-show-lol

5.1 The table of contents

BHL-TOC-LOCATION:: 目次挿入の場所を制御
BHL-DEFAULT-TOC-DEPTH:: 目次の深さを制御
C-c C-c t (bhl-insert-toc)

5.1.1 Browse the table of contents

*toc*バッファのコマンド
?
Display a quick help for the `bhl-toc-mode'.
q
Quit the `toc' buffer.
n/p
Go to the Next/Pregious item.
</>
Go to the First/Last item.
i
Insert the table of contents in your bhl file.
1/2/3
Set the toc depth to 1/2/3.

5.1.2 Insert the table of contents

C-c C-c t (bhl-insert-toc)

5.2 The list of links

bhl-lol-modeのコマンド
?
quick help q :L Quit the `lol' buffer.
n/p
Go to the Next/Pregious item.
</>
Go to the First/Last item.
i
Insert the list of links in your document
リンク上で RTN/mouse-2
リンク先を visit

6 Commands and key bindings

6.1 Conversion commands

C-c C-w (bhl2html)
html に変換
C-c C-d (bhl2text)
TXT に変換

6.2 Inserting

C-c C-c h (bhl-insert-url)
URLの挿入
C-c C-c i (bhl-insert-image)
画像の挿入
C-c C-c m (bhl-insert-minipage)
ミニページの挿入
C-c C-c v (bhl-insert-verbatim)
verbatim environment の挿入
C-c C-c r (bhl-insert-hr)
水平線の挿入
C-c C-c t (bhl-insert-toc)
目次の挿入
数引数で深さ
C-c C-c l (bhl-insert-lol)
リンクリストの挿入

6.3 Browsing the BHL file

C-c C-t (bhl-show-toc)
*toc* バッファを生成して、目次を表示<br>数引数で深さ
C-c C-/ (bhl-show-lol)
*lol* バッファを生成してリンクリスト表示
C-c C-n (bhl-goto-next-section)
次セクション
数引数で次サブセクション
C-c C-p (bhl-goto-previous-section)
前セクション
数引数で前サブセクション
C-TAB (bhl-goto-next-url-or-wiki)
次リンク

6.4 Changing font

C-c C-f C-b (bhl-change-font-bold)
カレントリージョンを '*' で挟む(ボールド)
C-c C-f C-e (bhl-change-font-emphasis)
カレントリージョンを '_' で挟む(強調)
C-c C-f C-u (bhl-change-font-underline)
カレントリージョンを '__' で挟む(下線)
:C-c C-f C-t (bhl-change-font-truetype)
カレントリージョンを 'l==' で挟む(truetype)
C-c C-f C-_ (bhl-change-font-bolditalic)
カレントリージョンを '_*'と '*_' で挟む(ボールドイタリック)
C-c C-f C-n (bhl-change-font-normal)
カレントリージョンのフォント指定を抹消

6.5 Miscellaneous

M-x bhl-sectioning-switch-style
セクション接頭辞の変更
C-c ; (bhl-comment-region)
リージョンをコメントアウト
数引数で、アンコメント
M-x bhl-hide-comment
コメントを非表示(トグル)
C-c C-x m (bhl-compose-mail)
バッファをtxt フォーマットに変換しmailドラフトに
M-x bhl-view-log
変換ログの表示
C-c M-t (bhl-update-toc)
セクションのナンバリンクのアプデート
M-x bhl-submit-but-report
バグ報告を送る
C-c C-v (bhl-show-version)
バージョン表示
こんなもんキー割当てするな
M-x bhl-texi-toggle-accents
Toggle accents in a Texinfo buffer

7 Options

7.1 Global options

気になるものだけ抜粋

bhl-html-meta-alist

:bhl-html-doctype:

bhl-html-content-type
bhl-html-default-style
ヘッダタグに挿入するスタイルを書く

7.7 Wiki options

変数 bhl-non-wiki-names-list
キャメルワードだけれどWikiName にしない語のリスト