gpt4 book ai didi

python - Markdown 预览基于 Python 的 gedit 插件

转载 作者:太空宇宙 更新时间:2023-11-04 06:12:16 24 4
gpt4 key购买 nike

我已经安装了 markdown preview plugin适用于在 Lubuntu 13.04 上运行的 gedit。它按预期工作。

markdown preview in gedit

但是,为了便于查看,我通过在每个 Markdown 文件的顶部包含指向本地样式表的链接来更改生成的 html 面板(左侧面板)的外观。但这种方法显然意味着我必须更改所有现有的 Markdown 文件。

为了避免这种情况,我查看了 ~/.local/share/gedit/plugins/markdown-preview/__init__.py 其中有 code for the plugin ,我看到第 39 行和第 40 行(转载如下):

# Can be used to add default HTML code (e.g. default header section with CSS).
htmlTemplate = "%s"

这给我的印象是我可以以某种方式告诉插件查看样式表并相应地设置 html 的样式。但我不知道该怎么办(如果确实 htmlTemplate = "%s" 必须更改)。

最佳答案

htmlTemplate 设置为如下内容

# Can be used to add default HTML code (e.g. default header section with CSS).
htmlTemplate = """
<html>
<head>
<link rel="stylesheet" type="text/css" charset="utf-8" media="screen" href="http://paste.ubuntu.com/static/pastebin.css">
</head>
<body>
%s
</body>
</html>
"""

关于python - Markdown 预览基于 Python 的 gedit 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18024482/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com