museのinfo の読書メモ
これは muse Manual を読みながら書いたメモである。
5 Getting Started
.emacs 上の設定
debian 的には、 load-path の設定は済んでいるので、必要なモジュールを ↓のように require すればいい
(require 'muse-mode) ; load authoring mode
(require 'muse-html) ; load publis hing styles I use
(require 'muse-blosxom)
bhl-mode 相当の使い方
muse-mode から C-c C-t で、カレントバッファをパブリッシュできる
- C-c C-t (muse-publish-this-file)
-
カレントバッファをパブリッシュ
これは (muse-modeであれば)任意のバッファをパブリッシュできる
つまり bhl-mode 相当の使い方が出来る
6 Creating and Managing Muse Projects
muse-project モジュールをロードすればプロジェクト単位のパブリッシュができる。
(require 'muse-project)
(add-to-list 'muse-project-alist
'("OpenNote" ; test use
("~/Pages/OpenNote" :default "index")
(:base "html" :path "~/public_html/muse/OpenNote")))
- C-c C-p (muse-project-publish)
-
カレントプロジェクトのパブリッシュ
7 Keys Used in Muse Mode
- C-c C-a (muse-index)
-
すべての Muse page を表示
- C-c C-b (muse-find-backlinks)
-
バックリンク(このページへのリンクのあるページ)のリストを表示
- C-c <TAB> or C-c i t (muse-insert-tag)
-
- ミニバッファで、muse の入力タグを問合せて挿入
- 閉じタグはちゃんと閉じてくれる
- C-c C-l (font-lock-mode)
-
- フォントロックの解除(トグル動作)
- リンクとか、イメージインライン展開とかも止めてくれるのでリンクの編集などにすごく便利
- C-c C-p (muse-project-publish)
-
更新された muse ページをパブリッシュ
- C-c C-s (muse-search)
-
- カレントプロジェクト内のサーチ
- 日本語もちゃんと通る
- C-c C-v (muse-browse-result)
-
- C-c i l (muse-insert-relative-link-to-file)
-
- リンクのインサート
- リンク先とそのラベルを聞いてきて
[[リンク先][ラベル]]を挿入
- C-c = (muse-what-changed)
-
Diff this page against the last backup version.
- TAB
-
Move to the next Wiki reference.
- S-TAB
-
Move to the previous Wiki reference.
- M-TAB(pcomplete)
-
- 現在プロジェクトのページ名のコンプリーション
僕の環境では index しかコンプリートしてくれない
- S-RET (muse-insert-list-item)
-
- C-<
-
Decrease the indentation of the list item at point.
- C->
-
Increase the indentation of the list item at point.
8 Rules for Using Markup
8.1 Paragraphs: centering and quoting
パラグラフは、空行で区切られる
Centered paragraphs and quotations
6桁以上の連続する空白文字(SPCだけでなくTABも可)ではじまるパラグラフはセンタリングされる。
<center>タグで囲んでもいい
6桁未満の空白文字ではじまるパラグラフは引用文とみなされる。
引用文は <quote>タグで囲んでもいい。
Literal paragraphs
<example> タグは例であり
- 例中の空白文字はそのまま整形されずに残される。
- 例中のテキストはモノスペース
- 例中の特殊文字はエスケープされる
- 日本語を使うと iSilo 出力で化けてしまう
- 簡単なものは blockquote + verse で代替できる
<literal>タグ
- タグ内は、完全にそのままhtml に渡される
- html コードを埋め込む時に使う
8.2 Levels of headings
- 見出しは、行頭 *{1,4} に続けて空白とタイトル
- 5つ以上アスタリスクを続けてもレベル4と同じ
<h5> なヘッダが挿入されるだけである
*emphasis*
**strong emphasis**
***very strong emphasis***
_underlined_
=verbatim and monospace=
8.3 Directives at the beginning of a document
- ディレクティブは、ドキュメントの先頭、パラグラフやセクションの前に置く
- ディレクティブは、^#directive content of directive の形式
#author-
The author of this document.
これを指定しないと、user-full-name の値を使う
#date-
The date that the document was last modified.
#desc-
A short description of this document.
This is used by the `journal' publishing style to embed information
inside of an RSS/RDF feed.
#title-
The title of this document.
If this is not specified, the name of the file is used.
8.4 Bold, italicized, and underlined text
*emphasis*
**strong emphasis**
***very strong emphasis***
_underlined_
=verbatim and monospace=
8.5 Making notes to be shown at the end
- 脚注は 角括弧に数字をいれて
[1] のようにする。
- 脚注自体は、バッファ
- C-c ! a (footnote-add-footnote)
-
脚注挿入個所でこの操作をすると、カーソル位置に
[#] が挿入され
パラグラフ末尾に移動て脚注をすぐ書ける状態になる。
- C-x C-x
-
脚注編集から、挿入個所に戻る
8.6 Indicating poetic stanzas
詩みたいに、空白文字は整形せずに、カーニングはする場合は行頭に < を置く
> A line of Emacs verse;
> forgive its being so terse.
↓のように verse タグをつかっても同様
<verse>
A line of Emacs verse;
forgive its being so terse.
</verse>
8.7 Lists of items
- level odd(this does not work, put SPC on first column)
- level1
- level2
- level 3
- level 4
- level 5
- level 6
- yet another level3
1. Chapter 1
1. level 2
1. level 2 second section
1. Chapger 2
1. section 1
1. subsection 1
1. subsection 2
Top level definition list :: its definition
this need not SPC on column 1 .
Second level definitnion list :: its definition
8.8 Generation of data tables
Double bars || Separate header fields
Single bars | Separate body fields
Here are more | body fields
Triple bars ||| Separate footer fields
8.9 Hyperlinks and email addresses with descriptions
- プロジェクト内のほかのページか URL にリンクを張ることができる
- リンクにラベルをつけることも出来る。
[[link target][link description]]
[[link target without description]]
8.10 Bare URLs, WikiNames, and InterWiki links
- URL をそのまま書いてもリンクになる
- muse-wiki がロードされていたらキャメルワード もリンクなる
- muse-wiki をロードするとインターウィキリンクも張れる
- 最初のふたつのケースは、プロジェクト名とウィキ名がそれぞれ
:: と #で区切られている
- 最後の例は、プロジェクト名だけで、デフォールトページが呼ばれる
Blog::DocumentingMuse
Projects#EmacsMuse
Website
8.11 Publishing and displaying images
- URL やファイルがイメージの場合は、url をベタ書きするだけでクリッカブルなイメージリンクが作られる。
- イメージが、ローカルにあって、直接参照される場合は muse 側でも展開される。
- 画像リンクは画像パス・URLが後ろになっていることに注意
- ベタ書きリンク
-
http://www.mwolson.org/
- 画像リンク
-
[[http://www.mwolson.org/][http://www.mwolson.org/static/logos/site-logo.png]]
- ALT つきの画像
-
[[TestPage][../pics/TestLogo.png]]
- ラベルなしの画像
-
[[../myimage.png]]
8.12 Inserting a horizontal line or anchor
Horizontal Rules
- 4連続以上のダッシュは水平線
- 前後に空白を入れないと、前後のパラグラフの一部とみなされる
Anchors
- 行先頭に #anchor でアンカになる
- page#anchor でリンクを張ることができる
8.13 Evaluating Emacs Lisp code in documents for extensibility
<lisp>タグ中に、elisp のコードを埋め込むことができる。
- パブリッシュ時に、返り値に置換される
- コードから insert 関数でバッファに書き込む必要はない、挿入文字列を返すだけでよい
<lisp>(concat "This form gets " "inserted")</lisp>
- 同様に
<perl> タグや <python> タグも使える。
8.14 Lines to omit from published output
; Comment text goes here.
8.15 Tags that Muse recognizes
Syntax
Tag listing
muse が理解する完全なタグのリスト
-
- html にパブリッシュ される時は SPANタグで囲む
- このとき Option は、class 属性の値となる。
- つまりTXT は、TXT と出力される。(実際に試すこと)
-
-
= で囲むのと同じで、モノスペース。改行は保存されない
-
- 囲んだテキストに対してコマンドを実行
- 実行コマンドは、interp属性の値として指定
- interp 属性の値が設定されていない時は、テキストがシェルに渡される。
-
- リージョン?をコメントとして扱う
- muse-publish-comments-p が nil なら、パブリッシュ先に出力しない
- 同 non nil なら、コメントとしてパブリッシュする
-
- 目次の出力
- デフォールトは レベル2の目次
- 目次深さは MUSE-PUBLISH-CONTENTS-DEPTH で設定
- 現在タグでローカルに変更する時は depth 属性で設定
-
- モノスペースかつ改行を変更せず出力
- プログラムの挿入に適する
- iSilo 出力時に日本語が化けてしまう
-
- ファイル内容を挿入
- markup属性 で markup の仕方を制御
- markup="nil" なら、囲まれたテキストをマークアップ
- markup="example" なら、テキストを example タグで囲んだものがマークアップ
- markup="verse" なら、テキストを verse タグで囲んだものがマークアップ
-
リージョンを elisp として評価し、返り値を挿入する
insert で明にバッファに書き込む必要がないことに注意
-
リージョンが、完全にそのまま、出力される
裸の html が リテラルタグで囲まれていたら、それは html 側では html として解釈されてしまう。
muse や html のコードを挿入するのによい
-
- 囲んだテキストをマークアップとして評価する。
- 通常の部分では意味がない
- header や footer 中では、マークアップがマークアップとして評価されないが
そーいう処でもこのタグで囲んでやると、マークアップとして機能する
<markup><lisp>(muse-index-as-string t t)</lisp></markup>
-
- リージョンを引用文ブロックとして出力する。
- 閉じタグはない
- ※リージョンって、この場合パラグラフのことなんだろうか?
-
- 閉じタグまでの間のマークアップを解釈しない
- 改行は保存されないので、複数行の引用なんかには不適
-
- 閉じタグまでの改行を保存する。
- ※ 僕の運用で日本語を含む文書の引用に使える唯一の手段
- タグでは、iSilo 出力が文字化けしてしまうのだ
9 Publishing Various Types of Documents
9.1 Integrating Muse and pyblosxom.cgi
トバス
9.4 Publishing in HTML or XHTML form
Options provided
- muse-html-extension
-
Default file extension for publishing HTML files.
- muse-xhtml-extension
-
Default file extension for publishing XHTML files.
- muse-html-style-sheet
-
- スタイルシート定義をここに書く
- 生の CSS を書いてよし、link タグで、外部ファイルを指定してよし
- lisp マークアップタグを含んでもよい
- muse-html-header
-
- HTMLヘッダに書く要素を書く
- テキストでもファイルでもいい
- muse-html-footer
-
- HTMLフッタに書く要素を書く
- テキストでもファイルでもいい
- muse-html-anchor-on-word
-
- When true, anchors surround the closest word.
- This allows you to select them in a browser (i.e. for pasting),
but has the side-effect of marking up headers in multiple colors
if your header style is different from your link style.
- muse-html-table-attributes
-
HTML tableタグの属性設定
- muse-html-markup-regexps
-
List of markup rules for publishing a Muse page to HTML.
- muse-html-markup-functions
-
An alist of style types to custom functions for that kind of text.
- muse-html-meta-content-type
-
The content type used for the HTML
<meta> tag.
10 Making your own publishing styles
10.1 Common functionality shared by styles
10.1.1 Specifying functions to mark up text
トバス
10.1.2 Markup rules for publishing
トバス
10.1.3 Strings specific to a publishing style
トバス
10.1.4 Tag specifications for special markup
タグは、muse-publish-markup-tags に設定されている。この各要素の意味は
-
+ タグラベル文字列
+ t ならクローズタグ
+ t なら属性を持つ
- これが t のとき、属性とその値を格納する alist が関数の第三引数として渡される
+ タグ位置であパブリッシュ時に実行される関数(後述)
TagLavelString ClosingTagP OptionalP Function
(("contents" nil t muse-publish-contents-tag)
("verse" t nil muse-publish-verse-tag)
("example" t nil muse-publish-example-tag)
("code" t nil muse-publish-code-tag)
("quote" t nil muse-publish-quote-tag)
("literal" t nil muse-publish-mark-read-only)
("verbatim" t nil muse-publish-verbatim-tag)
("lisp" t nil muse-publish-lisp-tag)
("class" t t muse-publish-class-tag)
("command" t t muse-publish-command-tag)
("comment" t nil muse-publish-comment-tag)
("include" nil t muse-publish-include-tag)
("markup" t t muse-publish-mark-up-tag))
- タグ自体は、パブリッシュ時に、関数が呼ばれれる前に除去される
- 関数は、2 3引数を取る
- 最初の二つは、タグ内テキストの開始/終了位置
- 第三要素が t のとき 三番目の引数に、属性とその値の alist が格納される
- 関数が呼ばれるときはポイントは、開きタグ直後である
連絡先:webadmin.itsumi@gmail.com
