upupming / docsify-katex Goto Github PK
View Code? Open in Web Editor NEW:symbols: KaTeX support for docsify
Home Page: https://upupming.site/docsify-katex/docs
License: MIT License
:symbols: KaTeX support for docsify
Home Page: https://upupming.site/docsify-katex/docs
License: MIT License
我在尝试引入 marked 4.0.0 以上版本的组件时,页面出现了错误。
在 marked 项目的版本更新日志中:
4.0.0 (2021-11-02)
BREAKING CHANGES
Default export removed. Useimport { marked } from 'marked'
orconst { marked } = require('marked')
instead.
/lib/marked.js
removed. Use/marked.min.js
in script tag instead.
When using marked in a script tag usemarked.parse(...)
instead ofmarked(...)
我试着修改了源代码第 3 行,let newMarked = marked;
-> let newMarked = marked.parse;
经过简单测试,仅改动此处,可以适配最新版本的 marked.js,在使用 marked@2、marked@3 时也暂未发现 bug,供您参考。
https://wo315.github.io/meimei/#/
this my website.
can you give me some information, about the problem?
Hi, all docsify-katex
users:
Thanks for using docsify-katex
and I really hope people can benefit from this small project. If you would like to share your works and configuration of docsify-katex
, You can leave your site here, and I will add it to demo projects, welcome! 👋
Describe the bug
The default font style of KaTeX math block should be italic, not normal.
To Reproduce
For an example, type following texts in the Markdown:
$$\begin{aligned}
f:&A\to B\\
&a\mapsto b
\end{aligned}$$
Expected behavior
Rendered as italic font, like this way:
(Rendered by VS Code extension Markdown-All-in-One with KaTeX engine)
But with docsify-katex, I got:
which seems ugly.
Screenshots
Shown above.
Desktop (please complete the following information):
Additional context
None.
Describe the bug
For math symbol "not equal" sign which used "$\neq$" always render as "equal",
I tried "\nequl, \neq,\ne" all render as equal
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
I am finding when I add the required scripts to my index.html
, katex renders properly, but I am unable to scroll on any of the pages of my site. I am hosting on GitHub's pages. Here is my index.html
:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Firebook</title>
<link rel="icon" href="_media/orange_slime.ico">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Description">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="./theme.css">
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
name: 'Firebook',
repo: 'yngtodd/firebook',
coverpage: true,
loadSidebar: true,
loadNavbar: false,
maxDepth: 2,
subMaxLevel: 2,
basePath: 'https://raw.githubusercontent.com/yngtodd/firebook/master/docs',
search : [
'/',
'/overview',
'/getting_started/',
]
}
</script>
<script src="//cdn.jsdelivr.net/npm/docsify-katex@latest/dist/docsify-katex.js"></script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css">
<script src="//cdn.jsdelivr.net/npm/docsify@latest/lib/docsify.min.js"></script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css">
<script src="//cdn.jsdelivr.net/npm/docsify@latest/lib/docsify.min.js"></script>
</body>
</html>
Describe the bug
Uncaught ReferenceError: marked is not defined
at docsify-katex.js:1:44
at docsify-katex.js:1:951
If I put the line <script src="//cdn.jsdelivr.net/npm/docsify-katex@latest/dist/docsify-katex.js"></script>
before <script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
like the demo project, it throws the exception. If I do the opposite, the error ceases but equations won't get rendered.
Not sure if I use it wrong, or it's a bug.
To Reproduce
Here's my index.html
:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Description">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/dark.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css" />
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
name: '',
repo: '',
coverpage: true,
onlyCover: true,
}
</script>
<!-- Docsify v4 -->
<script src="//cdn.jsdelivr.net/npm/docsify-katex@latest/dist/docsify-katex.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
</body>
</html>
Describe the bug
The katex maybe not work
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It is just a example.
Desktop (please complete the following information):
Describe the bug
Some LaTex can not render correctly. See https://xhqing.github.io/blog/#/post/%E6%A8%A1%E5%BC%8F%E8%AF%86%E5%88%AB%E4%B8%8E%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E4%B8%BB%E6%88%90%E5%88%86%E5%88%86%E6%9E%90%E5%8E%9F%E7%90%86%E8%AF%A6%E8%A7%A3
These can render correctly in Typora, Feichu Wiki and Yuque docs.
To Reproduce
Steps to reproduce the behavior:
cd blog
and then docsify serve docs
Expected behavior
A clear and concise description of what you expected to happen.
Render correctly
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
docs says put <script>
and <link>
tags in HTML....
Then what?
Please upgrade katex version to 0.16.0, which supports more functions.
请问使用docsify-katex会影响原来的网页的样式和布局吗?
The string 'c194a9ef' won't be rendered correctly.
Hello,
Thanks for the plugin, it's been really great! However, after the latest update, it's not working anymore. I have to get rid of the corresponding code in the index
file to have my blog back to work. I tried your new usage of the plugin (seems like four lines code), it's still not working. Is it possible to offer a solution so that I can use the plugin like the way before?
Thanks a lot!
您好,非常感谢您的插件,非常好用!但是在您最新一次更新后,它不能工作了,我的整个博客都打不开(仅能显示loading),不得不把之前的两行代码去掉。我尝试了您更新后的新用法(四行代码),依然不管用。如果可能的话,有没有办法同时提供一下能够使用之前版本的方法?非常感谢!
docsify-katex.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'renderer')
at window.$docsify.markdown (docsify-katex.js:1:889)
at new xt ([email protected]:1:66821)
at Lt ([email protected]:1:75127)
at Ut._init ([email protected]:1:83415)
at new Dt ([email protected]:1:82689)
at HTMLDocument. ([email protected]:1:89610)
最新版本报错,1.4.5 没问题。
Content after comments cannot be rendered now.
Markdown-it results:
<p>blabla</p>
<!--
bla
bla
bla
-->
will be rendered as:
<p>blabla</p>
<!--
bla
bla
bla
-->
Need a way to fix.
this is my index.html
:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Description">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-defaults.css">
<!-- CDN files for docsify-katex -->
<script src="//cdn.jsdelivr.net/npm/docsify-katex@latest/dist/docsify-katex.js"></script>
<!-- or <script src="//cdn.jsdelivr.net/gh/upupming/docsify-katex@latest/dist/docsify-katex.js"></script> -->
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css"/>
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
name: '<Name>',
repo: 'https://github.com/docsifyjs/docsify/',
loadSidebar: false,
loadNavbar: true,
coverpage: true,
maxLevel: 2,
subMaxLevel: 1,
//logo: '/_media/logo.png',
themeColor: '#3F51B5',
loadSidebar: true,
autoHeader: false,
search: 'auto'
}
</script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
</body>
</html>
am I missing anything?
When I add docsify-katex to the index.html page, the sidebar no longer expands to show the headers. It also does no longer converts the headers to links. Also, when added, mermaid code blocks no longer render, but are displayed in a code block instead.
Hello! This looks like a really neat project, however I for the life of me cannot figure it out how to use it and there are no usage instructions at all.
I've tried enclosing my LaTeX code in $$
, <code>
without any success. Any advise, please?
Thank you for your great plugin, but when I use it following the instrction on the project main page, I found that the latex equations are not rendered in italic font. For example , the markdown file is :
$$x=f(x)$$
but I want it to be rendered as:
just as other websites or origin latex format.
I doubt that I don't use correct font, but I don't know how to make it right. Do you have any idea about it?
Hi, do you have any plan to support {subarray} and \substack?
Describe the bug
Docsify latex in different positions of the same file are invalid
To Reproduce
Steps to reproduce the behavior:
add code
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css"/>
<script src="//cdn.jsdelivr.net/gh/upupming/docsify-katex@latest/dist/docsify-katex.js"></script>
white markdown article, use latex like this PythonTutorial.md
add latex to beginning of article, add below latex to middle of the article.
Latex as:
$$x=\frac {-b±\sqrt{b^2-4ac}}{2a}$$
Expected behavior
Latex in all positions are valid
Screenshots
beginning of article latex normal analysis:
Latex doesn't seem to parse at the middle of the article:
markdown file:
Desktop (please complete the following information):
Additional context
I try latex below code, or latex above code both show nomal.
But also it’s not work in this position:
Please help me check why it doesn't work.
While writing documentation I have a need to use *
to display stars as code and to use them as references when detailing how to search with stars. Docsify katex seems to be removing all stars from the code. I tried to backslash escape them and it will display the backslash and still remove the *.
Here are a few examples:
`'*'` Resolves to <code>''</code>
`*` Resolves to <code></code>
`example* ` Resolves to <code>example </code>
`example*` Resolves to <code>example\</code>
Removing the import of docsify-katex resolves the issue.
Describe the bug
Previously I was using the following CDN:
<!-- CDN files for docsify-katex -->
<script src="//cdn.jsdelivr.net/npm/docsify-katex@latest/dist/docsify-katex.js"></script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css"/>
But just recently, I found that the formula rendering was invalid. After replacing the current CDN file, I found that the support for the mhchem package was lost.
current CDN:
<script src="https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.js"></script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css" />
<script src="https://cdn.jsdelivr.net/npm/marked@3"></script>
<!-- CDN files for docsify-katex -->
<script src="//cdn.jsdelivr.net/npm/docsify-katex@latest/dist/docsify-katex.js"></script>
To Reproduce
Steps to reproduce the behavior:
$$\ce{葡萄糖-6-磷酸 ->[\color{#F65353}{葡萄糖-6-磷酸脱氢酶}、\color{#58B1FF}{Mg^{2+}}][\color{#7EC636}{NADP+\ \nearrow \quad \searrow\ NADPH + H+}] 葡萄糖-6-膦酸内酯}$$
Expected behavior
My demo should be like:
Screenshots
The current version renders as:
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.