MkDocs材料包装了许多图标,并使他们很容易使用在降价。您可以将放置在您的Markdown中的任何位置,并且它们呈现得非常完美。
<!-- some markdown file -->
:smile:
:material-account-circle:
然而,我似乎不知道如何在HTML模板中使用这些图标。如何在MkDocs模板中使用带有MkDocs材料的图标?
<!-- an HTML template used to render markdown -->
<span class="octicon octicon-clippy"><
我正在尝试为mkdocs编写markdown文件,并想要一个带有前标记的id属性,generated be fenced_code。如果我同时使用这两个扩展,则没有前标记,而是一个p(aragraph标记):
import markdown
text = """# Welcome
This is *true* markdown text.
````python
a=5
打印"Hello World“
"""
html = markdown.markdown(text, extensions= ['markdown.exte
我想为mkdocs编写一个插件,它允许添加自定义python代码的文件。这是一个。
我想将模块放在网站的主dir中,与mkdocs.yml文件一起,并在其中声明该模块,例如:
python_module=mycode.py
然后我将在插件的代码中使用,类似于:
from mkdocs.plugins import BasePlugin
from jinja2 import Template
import importlib
class MarkdownExtraDataPlugin(BasePlugin):
"Execute piece of code"
我的md文件的结构是: ---
title: Mango
subtitle: King of Fruits
tags: [fruit, sweet, tasty]
---
Mango is a very tasty fruit.
## Juice
Juice can be made from mango 当我在生成的文档中搜索时,当我搜索Mango时没有得到任何结果。当我搜索Juice时,我确实得到了结果。我对搜索的理解是:它在所有H1标签、H2标签等中进行搜索。我希望搜索在元标题、副标题和标签中查找结果,然后考虑H1、H2……和其他内容。在Mkdocs中是否有一些配置设置可以用来完成
我正在为我的PlantUML安装配置MkDocs插件,而且我被卡住了。我无法正确配置mkdocs.yml。每次启用这个插件时,我都会得到配置错误或解析错误。
这些错误是:
ERROR - Config value: 'plugins'. Error: Invalid config options for the > 'build_plantuml' plugin.
Error: MkDocs encountered an error parsing the configuration file:
while parsing a block map
我使用的是带有可数化标记扩展的MkDocs
我只想为特定的代码段启用代码段行号。
如果我设置
markdown_extensions:
- codehilite:
linenums: true
在我的mkdocs.yml中,这将为所有代码段启用行号。
我发现,通过使用shebang语言说明符和双缩进可以激活特定片段的行号:
#!python
""" Bubble sort """
def bubble_sort(items):
for i in range(len(items)):
for j in ran
我有一个Rmarkdown文件(info.rmd),如下所示:
---
title: "Information"
theme: yeti
date: "4/1/2017"
output: html_document
---
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown
在使用mkdocs build在本地构建mkdocs时,我遇到了一个特别是font-awesome和search_index.json的问题。我理解这个问题以及为什么它不起作用,但我正试图在本地分发我的文档,而不是使用why服务器,这就是为什么我必须依靠file://而不是http。有旁路吗?
我在最新的Chrome和Firefox上也得到了同样的结果。
实际的问题是Failed to load file:///Users/securisec/guide/site/search/search_index.json: Cross origin requests are only supporte
可视化是在本地AJAX服务器驱动的mkdocs中获取。
这个例子很难举例,但我会的。在我这么做之前,问题是我想使用各种ajax端点来驱动MkDocs中的Vega可视化。但我遇到了CORS许可。
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://machine1:8080/dataflare. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200