Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Fachgruppenwebseite Metadaten
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fginfo
Fachgruppenwebseite Metadaten
Commits
1d4300b8
Verified
Commit
1d4300b8
authored
2 years ago
by
Jake
Browse files
Options
Downloads
Patches
Plain Diff
added support for lineblocks
parent
990cb144
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fgs/pandoc.py
+24
-1
24 additions, 1 deletion
fgs/pandoc.py
theme/templates/macros/content_renderer.html
+12
-0
12 additions, 0 deletions
theme/templates/macros/content_renderer.html
with
36 additions
and
1 deletion
fgs/pandoc.py
+
24
−
1
View file @
1d4300b8
...
@@ -463,6 +463,29 @@ class BlockTable(Block): # Attr Caption [ColSpec] TableHead [TableBody] TableFoo
...
@@ -463,6 +463,29 @@ class BlockTable(Block): # Attr Caption [ColSpec] TableHead [TableBody] TableFoo
res
[
"
rows
"
]
=
self
.
parse_rows
(
raw_foot
[
1
])
res
[
"
rows
"
]
=
self
.
parse_rows
(
raw_foot
[
1
])
return
res
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 #########################################
############################## INLINE #########################################
...
@@ -696,7 +719,7 @@ block_parsing_register = {
...
@@ -696,7 +719,7 @@ block_parsing_register = {
"
HorizontalRule
"
:
BlockHorizontalRule
,
"
HorizontalRule
"
:
BlockHorizontalRule
,
"
Table
"
:
BlockTable
,
"
Table
"
:
BlockTable
,
"
DefinitionList
"
:
BlockDefinitionList
,
"
DefinitionList
"
:
BlockDefinitionList
,
#
"LineBlock" :
{"type":"lineblock", "TODO": True, "c" : [] }, # [[Inline]] # TODO find file that triggers
LineBlock
"
LineBlock
"
:
Block
LineBlock
,
#"Null" :{"type":"nothing" }, # TODO find file that triggers Null
#"Null" :{"type":"nothing" }, # TODO find file that triggers Null
}
}
...
...
This diff is collapsed.
Click to expand it.
theme/templates/macros/content_renderer.html
+
12
−
0
View file @
1d4300b8
...
@@ -91,6 +91,8 @@
...
@@ -91,6 +91,8 @@
{{ render_block_table(block, lang, meta) }}
{{ render_block_table(block, lang, meta) }}
{%- elif etype == "definitionlist" -%}
{%- elif etype == "definitionlist" -%}
{{ render_block_definitionlist(block, lang, meta) }}
{{ render_block_definitionlist(block, lang, meta) }}
{%- elif etype == "lineblock" -%}
{{ render_block_lineblock(block, lang, meta) }}
{%- else -%}
{%- else -%}
<br><strong>
ERROR: Unhandled block type: '{{ etype|e }}'
</strong><br>
<br><strong>
ERROR: Unhandled block type: '{{ etype|e }}'
</strong><br>
{%- endif -%}
{%- endif -%}
...
@@ -279,6 +281,16 @@
...
@@ -279,6 +281,16 @@
</dl>
</dl>
{%- endmacro -%}
{%- 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 ################################## -#}
{#- ############################ INLINES ################################## -#}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment