すみずみまで記述できるtable
WikiForme中。
tableのprocessメソッドを実装。これは良い。親要素補完とextendがスバラシく使える。
普通に↓こうも書けるし、
,aa,ab,ac
,ba,bb,bc
↓キャプション、ヘッダ、フッタのフル装備も可。
?caption | ||
,*aa,*ab,*ac
: |
,ba,bb,bc
,ca,cb,cc
,da,db,dc
_ |
,ea,eb,ec
↓縦に並べるタイプ
= | |
aa | |
ab | |
ac | |
: | |
= | |
ba | |
bb | |
bc | |
= | |
ca | |
cb | |
cc |
↓syntax.yaml
table_frame: "|||?"
table_head: "||*"
table_body: "||:"
table_foot: "||_"
table_colgroup: "||[["
table_col: "||["
table_row: "|="
table_split: ","
table_split splitter: ","
table_split head: "*"
table_cell: "|"
table_cell head: "*"
↓structure.yaml
table_frame:
group: [contents]
contain: [table_body, table_head, table_foot]
# ↓親要素補完連発
table_body:
parent: table_frame
contain: [table_row]
# ↓table_bodyをextend!
table_head:
extend: table_body
parent: table_frame
contain: [table_row, table_colgroup]
table_colgroup:
parent: table_head
contain: [table_col]
table_col:
parent: table_colgroup
table_foot:
extend: table_body
parent: table_frame
contain: [table_row]
table_row:
parent: table_body
contain: [table_cell]
# ↓,区切りタイプはtable_rowをextendして実装
table_split:
extend: table_row
contain: [contents, no table_frame]
table_cell:
parent: table_row
contain: [contents, no table_frame]