Skip to content

Commit

Permalink
feat: Add material-block style to show source
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed May 9, 2022
1 parent 074aed7 commit ff10ee1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/markdown_exec/rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ def add_source(*, source: str, location: str, output: str, language: str, tabs:
return source_block + "\n\n" + output
if location == "below":
return output + "\n\n" + source_block
if location == "material-block":
# TODO: remove style once margins are fixed in Material for MkDocs
style = 'style="margin-top: 0;"'
return source_block + f'\n\n<div class="result" {style} markdown="1" >\n\n{output}\n\n</div>'

source_tab_title, result_tab_title = tabs
if location == "tabbed-left":
Expand Down

0 comments on commit ff10ee1

Please sign in to comment.