1.9.3 优化

This commit is contained in:
跨越晨昏 2024-10-15 19:21:26 +08:00
parent 002d79a3b6
commit ca2d97daf6
3 changed files with 17 additions and 28 deletions

View File

@ -6,7 +6,6 @@ __all__ = [
'main', # 主函数 'main', # 主函数
'indent', # 添加空格 'indent', # 添加空格
'HEAD', # 'HEAD', #
'BODY', #
] ]
__version__ = '0.11.2' __version__ = '0.11.2'
__author__ = 'CrossDark' __author__ = 'CrossDark'
@ -15,28 +14,22 @@ __source__ = 'https://crossdark.net/'
__license__ = """MIT""" __license__ = """MIT"""
HEAD = ( HEAD = {
'<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML"></script>', # 渲染latex ('latex', 'js'): '<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML"></script>',
# mermaid # mermaid
'<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>', ('mermaid', 'js'): '<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>',
'<script>', ('mermaid', 'init'): '<script>mermaid.initialize({startOnLoad:true})</script>',
' mermaid.initialize({startOnLoad:true});',
'</script>',
'<link rel="stylesheet" href="../Static/styles.css">', # 代码高亮css ('code-highlight', 'css'): '<link rel="stylesheet" href="../Static/styles.css">', # 代码高亮css
'<style>', # 强调css ('block', 'css'): """<style>
' .block {', .block {
' background-color: grey; /* 灰色背景 */', background-color: grey; /* 灰色背景 */
' color: white; /* 白色文字 */', color: white; /* 白色文字 */
'}', }
'</style>' </style>"""
) }
BODY = (
'',
)
def indent(input_: Union[str, List, Tuple], indent_spaces: int = 4) -> str: def indent(input_: Union[str, List, Tuple], indent_spaces: int = 4) -> str:

View File

@ -6,9 +6,7 @@
<title>UTF-8编码示例</title> <title>UTF-8编码示例</title>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML"></script> <script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script> <script>mermaid.initialize({startOnLoad:true})</script>
mermaid.initialize({startOnLoad:true});
</script>
<link rel="stylesheet" href="../Static/styles.css"> <link rel="stylesheet" href="../Static/styles.css">
<style> <style>
.block { .block {
@ -19,7 +17,6 @@
<!-- 可以在这里添加其他元数据和CSS链接 --> <!-- 可以在这里添加其他元数据和CSS链接 -->
</head> </head>
<body> <body>
<div class="toc"> <div class="toc">
<ul> <ul>
<li><a href="#crossdown">CrossDown</a></li> <li><a href="#crossdown">CrossDown</a></li>

3
run.py
View File

@ -20,11 +20,10 @@ if __name__ == '__main__':
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>UTF-8编码示例</title> <title>UTF-8编码示例</title>
{indent(HEAD)} {indent(list(HEAD.values()))}
<!-- 可以在这里添加其他元数据和CSS链接 --> <!-- 可以在这里添加其他元数据和CSS链接 -->
</head> </head>
<body> <body>
{indent(BODY)}
{indent(cd, 4)} {indent(cd, 4)}
</body> </body>
</html> </html>