Määritä metadatataulukon sarakemäärä oikein listoille
This commit is contained in:
parent
d355a1658d
commit
0ec7996bd7
|
@ -14,21 +14,23 @@ renderMeta :: MetaValue -> [Block]
|
||||||
renderMeta (MetaMap metaMap) = singleton $ plainTable
|
renderMeta (MetaMap metaMap) = singleton $ plainTable
|
||||||
(map (singleton . Plain . singleton . Str . fst))
|
(map (singleton . Plain . singleton . Str . fst))
|
||||||
(singleton . plainRow . map (renderMeta . snd))
|
(singleton . plainRow . map (renderMeta . snd))
|
||||||
|
length
|
||||||
(toList metaMap)
|
(toList metaMap)
|
||||||
renderMeta (MetaList metaValues) = singleton $ plainTable
|
renderMeta (MetaList metaValues) = singleton $ plainTable
|
||||||
(const [])
|
(const [])
|
||||||
(map (plainRow . singleton . renderMeta))
|
(map (plainRow . singleton . renderMeta))
|
||||||
|
(const 1)
|
||||||
metaValues
|
metaValues
|
||||||
renderMeta (MetaBool bool) = [Plain [Str $ if bool then "true" else "false"]]
|
renderMeta (MetaBool bool) = [Plain [Str $ if bool then "true" else "false"]]
|
||||||
renderMeta (MetaString text) = [Plain [Str text]]
|
renderMeta (MetaString text) = [Plain [Str text]]
|
||||||
renderMeta (MetaInlines inlines) = [Plain inlines]
|
renderMeta (MetaInlines inlines) = [Plain inlines]
|
||||||
renderMeta (MetaBlocks blocks) = blocks
|
renderMeta (MetaBlocks blocks) = blocks
|
||||||
|
|
||||||
plainTable :: ([a] -> [[Block]]) -> ([a] -> [Row]) -> [a] -> Block
|
plainTable :: ([a] -> [[Block]]) -> ([a] -> [Row]) -> ([a] -> Int) -> [a] -> Block
|
||||||
plainTable mkHead mkBody xs = Table
|
plainTable mkHead mkBody columns xs = Table
|
||||||
nullAttr
|
nullAttr
|
||||||
(Caption Nothing [])
|
(Caption Nothing [])
|
||||||
(map (const $ (AlignDefault, ColWidthDefault)) xs)
|
(replicate (columns xs) (AlignDefault, ColWidthDefault))
|
||||||
(plainHead $ mkHead xs)
|
(plainHead $ mkHead xs)
|
||||||
[plainBody $ mkBody xs]
|
[plainBody $ mkBody xs]
|
||||||
(TableFoot nullAttr [])
|
(TableFoot nullAttr [])
|
||||||
|
|
Loading…
Reference in New Issue