Created
May 16, 2012 15:25
-
-
Save takahashim/2711254 to your computer and use it in GitHub Desktop.
minimal document structure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start = html | |
html = element html { head, body } | |
head = element head { title | link+ } | |
link = element link { empty } | |
title = element title { text } | |
## 本文(body)はBlockのみではなくInlineも許す | |
body = element body { ( Block | Inline)+ } | |
## Blockは見出しのみ (hrはportability高いだけど必要性低いので基本セットからは削除、画像もまずはInlineで) | |
Block = ( h1 | h2 | h3 | h4 | h5 | h6 ) | |
h1 = element h1 { Inline+ } | |
h2 = element h2 { Inline+ } | |
h3 = element h3 { Inline+ } | |
h4 = element h4 { Inline+ } | |
h5 = element h5 { Inline+ } | |
h6 = element h6 { Inline+ } | |
Embedded = ( img ) | |
img = element img { empty } | |
## Inlineは改行・強調・リンク・ルビ・オブジェクト埋め込み(画像)とテキスト | |
Inline = ( br | em | a | ruby | ExtText | Embedded ) | |
br = element br { empty } | |
em = element em { ExtText+ } | |
a = element a { (Embedded | Inline)+ } | |
ruby = element ruby { (rb|rt|rp)+ } | |
rb = element rb { ExtText+ } | |
rt = element rt { ExtText+ } | |
rp = element rp { ExtText+ } | |
## ExtTextは外字も含めたテキスト | |
ExtText = ( text | external_char ) | |
external_char = element external_char { empty } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment