Skip to content

Commit

Permalink
Make debug html tables readable also in dark mode (#152)
Browse files Browse the repository at this point in the history
  - color of the font is forced to black, in `make_html()` function
  - the `module` test case has been updated with dark mode
  • Loading branch information
Laurent Franceschetti committed Jul 16, 2023
1 parent 2794fb0 commit 13b93c3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions mkdocs_macros/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ def format_value(value):
return repr(value)


def make_html(rows, header=[], tb_class='pretty'):
def make_html(rows, header=[], tb_class='macros-tb'):
"Produce an HTML table"
font_color = "#000000" # black
back_color = "#F0FFFF" # light blue
grid_color = "#DCDCDC"
padding = "5px"
style = "border:1px solid %s; padding: %s" % (grid_color, padding)
style = f"color:{font_color}; border:1px solid {grid_color}; padding: {padding}"
templ = Template("""
<table class="{{ tb_class }}" style="background-color: {{ back_color}}; {{ style }}">
{% for item in header %}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Initialization
# --------------------

VERSION_NUMBER = '1.0.2'
VERSION_NUMBER = '1.0.3'

# required if you want to run document/test
# pip install 'mkdocs-macros-plugin[test]'
Expand Down
5 changes: 4 additions & 1 deletion test/module/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
site_name: Main test site
theme: material
theme:
name: material
palette:
scheme: slate
copyright: (C) Laurent Franceschetti 2020

nav:
Expand Down

0 comments on commit 13b93c3

Please sign in to comment.