diff --git a/fgs/pandoc.py b/fgs/pandoc.py index 37b24ef436d0e3396eb5049b2fd66d0af9366f09..4f84f65d41bab1cc35420c98307da6705f8522e9 100644 --- a/fgs/pandoc.py +++ b/fgs/pandoc.py @@ -463,6 +463,29 @@ class BlockTable(Block): # Attr Caption [ColSpec] TableHead [TableBody] TableFoo res["rows"] = self.parse_rows(raw_foot[1]) return res +class BlockLineBlock(Block): # [[Inline]] + etype = "lineblock" + """ + [ + [ + {'t': 'Str', 'c': 'Fachgruppe'}, {'t': 'Space'}, {'t': 'Str', 'c': 'Informatik'}, {'t': 'Space'}, {'t': 'Str', 'c': 'Georg-August-Universität'}, {'t': 'Space'}, {'t': 'Str', 'c': 'Göttingen'} + ], [ + {'t': 'Str', 'c': 'Goldschmidtstr.'}, {'t': 'Space'}, {'t': 'Str', 'c': '7'} + ], [ + {'t': 'Str', 'c': 'Institut'}, {'t': 'Space'}, {'t': 'Str', 'c': 'für'}, {'t': 'Space'}, {'t': 'Str', 'c': 'Informatik'} + ], [ + {'t': 'Str', 'c': '37077'}, {'t': 'Space'}, {'t': 'Str', 'c': 'Göttingen'} + ] + ] + }) + """ + def parse_internal(self, pandocraw): + self.lines = [] + for line in pandocraw: + self.lines.append(self.parse_inlines(line)) + self.linecount = len(self.lines) + + ############################## INLINE ######################################### @@ -696,7 +719,7 @@ block_parsing_register = { "HorizontalRule": BlockHorizontalRule, "Table" : BlockTable, "DefinitionList": BlockDefinitionList, - #"LineBlock" :{"type":"lineblock", "TODO": True, "c" : [] }, # [[Inline]] # TODO find file that triggers LineBlock + "LineBlock" : BlockLineBlock, #"Null" :{"type":"nothing" }, # TODO find file that triggers Null } diff --git a/theme/templates/macros/content_renderer.html b/theme/templates/macros/content_renderer.html index 164c42dad355126e400d99ef2373d6a3b9d252a2..d3997cb0c789313be0740196e544153f4eb6a8d9 100644 --- a/theme/templates/macros/content_renderer.html +++ b/theme/templates/macros/content_renderer.html @@ -91,6 +91,8 @@ {{ render_block_table(block, lang, meta) }} {%- elif etype == "definitionlist" -%} {{ render_block_definitionlist(block, lang, meta) }} + {%- elif etype == "lineblock" -%} + {{ render_block_lineblock(block, lang, meta) }} {%- else -%} <br><strong>ERROR: Unhandled block type: '{{ etype|e }}'</strong><br> {%- endif -%} @@ -279,6 +281,16 @@ </dl> {%- endmacro -%} +{%- macro render_block_lineblock(block, lang, meta) -%} + {%- set lines = block['lines'] -%} + <div class="lineblock"> + {%- for line in lines -%} + {{ render_inlines(line, lang) }} + {%- if not loop.last -%}<br />{%- endif -%} + {%- endfor -%} + </div> +{%- endmacro -%} + {#- ############################ INLINES ################################## -#}