Skip to content

Commit

Permalink
fix: mermaid avoid using fence
Browse files Browse the repository at this point in the history
  • Loading branch information
evan361425 committed Sep 5, 2024
1 parent 0d21ce5 commit 27eaf24
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 53 deletions.
10 changes: 2 additions & 8 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,6 @@ markdown_extensions:
# 展開用:??? info "title"
- pymdownx.details
- pymdownx.highlight
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:mermaid2.fence_mermaid_custom
# MathJax
- pymdownx.arithmatex:
generic: true
Expand Down Expand Up @@ -206,9 +201,8 @@ plugins:
- essay/index.md
- mermaid2:
arguments:
securityLevel: loose
theme: |
^(JSON.parse(__md_get("__palette").index == 1)) ? 'dark' : 'light'
securityLevel: antiscript
theme: neutral
# 用來注入最新的修改
- blogging:
# https://github.com/liang2kl/mkdocs-blogging-plugin
Expand Down
81 changes: 41 additions & 40 deletions overrides/main.html
Original file line number Diff line number Diff line change
@@ -1,60 +1,61 @@
{% extends "base.html" %}

{% block site_meta %}
{{ super() }}
<meta name="google-site-verification" content="COb7MqeOYLfRXXUOsXWaQvnr1_Xb33a0aP_Y8UC3U5Y" />
{% if page.meta and page.meta.image %}
<meta property="og:image" content="{{ page.meta.image }}" />
{% endif %}
{% if page.meta and page.meta.description %}
<meta property="og:description" content="{{ page.meta.description }}" />
{% endif %}
{% if page.meta and page.meta.title %}
<meta property="og:title" content="{{ page.meta.title }}" />
{% elif page.title and not page.is_homepage %}
<meta property="og:title" content="{{ page.title }}" />
{% else %}
<meta property="og:title" content="{{ config.site_name }}" />
{% endif %}
{{ super() }}
<meta name="google-site-verification" content="COb7MqeOYLfRXXUOsXWaQvnr1_Xb33a0aP_Y8UC3U5Y" />
{% if page.meta and page.meta.image %}
<meta property="og:image" content="{{ page.meta.image }}" />
{% endif %}
{% if page.meta and page.meta.description %}
<meta property="og:description" content="{{ page.meta.description }}" />
{% endif %}
{% if page.meta and page.meta.title %}
<meta property="og:title" content="{{ page.meta.title }}" />
{% elif page.title and not page.is_homepage %}
<meta property="og:title" content="{{ page.title }}" />
{% else %}
<meta property="og:title" content="{{ config.site_name }}" />
{% endif %}
{% endblock %}

{% block styles %}
{{ super() }}
<style>
/**
{{ super() }}
<style>
/**
* Center the table
*/
.md-typeset__table {
margin-left: auto;
margin-right: auto;
display: table;
}
.md-typeset__table {
margin-left: auto;
margin-right: auto;
display: table;
}

/**
/**
* Center the image
*/
figure img {
margin-left: auto;
margin-right: auto;
}
figure img {
margin-left: auto;
margin-right: auto;
}

.md-typeset :is(.admonition, details) {
font-size: .8rem;
}
.md-typeset :is(.admonition, details) {
font-size: .8rem;
}

/**
/**
* It will wider than mjx-math and cause screen broken.
* This element is for screen-reader, see detailed in
* https://docs.mathjax.org/en/latest/basic/accessibility.html#screen-reader-support
*/
.MathJax mjx-assistive-mml {
display: none !important;
}
/**
.MathJax mjx-assistive-mml {
display: none !important;
}

/**
* Keep zoomed-in image on the top of palette
*/
.medium-zoom-image--opened {
z-index: 10;
}
</style>
.medium-zoom-image--opened {
z-index: 10;
}
</style>
{% endblock %}
5 changes: 0 additions & 5 deletions src/stylesheets/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,3 @@
--md-typeset-color: #fafafa;
}
}

/* mermaid styling */
.mermaid .flowchartTitleText {
fill: var(--md-typeset-color) !important;
}

0 comments on commit 27eaf24

Please sign in to comment.