gpt4 book ai didi

html - 在 mkdocs 中使用静态 html

转载 作者:行者123 更新时间:2023-12-04 12:50:09 26 4
gpt4 key购买 nike

是否有在 Markdown 文件中使用 HTML 的解决方案 - 或显示一个纯 HTML 的整个额外页面的选项?

问题:我想在我的 mkdocs 生成的 wiki 中包含一个使用一些内联 Javascript 的 html 片段。

尝试过:我已经搜索了几个小时,但在此处或官方文档中找不到答案。

最佳答案

只需在 Markdown 文档中包含 HTML。 MkDocs 没有记录这一点,因为这是标准的 Markdown 行为。事实上,Markdown rules状态:

For any markup that is not covered by Markdown’s syntax, you simply use HTML itself. There’s no need to preface it or delimit it to indicate that you’re switching from Markdown to HTML; you just use the tags.

The only restrictions are that block-level HTML elements — e.g. <div>, <table>, <pre>, <p>, etc. — must be separated from surrounding content by blank lines, and the start and end tags of the block should not be indented with tabs or spaces. Markdown is smart enough not to add extra (unwanted) <p> tags around HTML block-level tags.

...

Note that Markdown formatting syntax is not processed within block-level HTML tags. E.g., you can’t use Markdown-style *emphasis* inside an HTML block.

关于html - 在 mkdocs 中使用静态 html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47165449/

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