diff options
author | 2025-01-07 12:36:05 +0800 | |
---|---|---|
committer | 2025-01-07 12:36:05 +0800 | |
commit | 4d88ef666eee1b6f191f6e85b00acf8d5a2d1899 (patch) | |
tree | 68391846bae84f9546b0d089c012afc336a6e6bd /code/linux/vim.md | |
parent | 11e64c5804b696f170b9d5d881befbabc4a4e85c (diff) | |
download | myweb-4d88ef666eee1b6f191f6e85b00acf8d5a2d1899.tar.gz myweb-4d88ef666eee1b6f191f6e85b00acf8d5a2d1899.zip |
highlight don't use auto-detect but given languagenew_highlightjs
In this commit, lot's of things is changed. Hope they all runs
currectly.
Now highlight.js is supporting more and more proguam languages, but
the auto detection always go wrong, even for common languages like c,
bash, python, makefile.
Use Given Language
------------------
As you know, I always write markdown and convert to html by pandoc. In
the old, "```cpp" in markdown will be deleted first to keep the embeded
code clean and not highlighted, then I can use highlight.js. But this
causes that html document doesn't know the language.
This time, md2html.sh is changed: pandoc use "--no-highlight"
argument to keep code clean, and it will output like this:
```html
<pre class="cpp"><code>...</code></pre>
```
Although there may be other tags between `<code></code>`, it's clear
that `<pre class="xxx"><code>` is nested tightly, except some space
characters or \n.
Then, sed deal with the whole doc(not line by line), replace `<pre
class="xxx"><code>` with `<pre><code class="language-xxx">`. That's it!
Math Formula
------------
Math formular is also a problem during convertion by pandoc. In the old
it's dealed menually. Now pandoc use "--mathjax=none", then formula is
no longer showed by pandoc, but only `<span class="math xxx">\( formula \)</span>`.
And the math tool I used will deal with it.
Mermaid picture
----------------
pandoc doesn't support convert mermaid in markdown to html picture.
Let's have a warning!
Diffstat (limited to 'code/linux/vim.md')
-rw-r--r-- | code/linux/vim.md | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/code/linux/vim.md b/code/linux/vim.md index 4d21b25..616d5c5 100644 --- a/code/linux/vim.md +++ b/code/linux/vim.md | |||
@@ -169,7 +169,7 @@ sudo make install | |||
169 | 169 | ||
170 | 除此之外,出于同样的目的(保证当前用户与 root 用户观感一致),建议将插件也指定一个专门的绝对路径。我放在了`/home/player/useful/bundle`。 | 170 | 除此之外,出于同样的目的(保证当前用户与 root 用户观感一致),建议将插件也指定一个专门的绝对路径。我放在了`/home/player/useful/bundle`。 |
171 | 171 | ||
172 | ``` | 172 | ```bash |
173 | # 创建软链接 | 173 | # 创建软链接 |
174 | # 我习惯把有用的文件放在~/useful下 | 174 | # 我习惯把有用的文件放在~/useful下 |
175 | mkdir useful | 175 | mkdir useful |
@@ -191,17 +191,14 @@ mkdir bundle | |||
191 | ```plaintext | 191 | ```plaintext |
192 | /etc/vim | 192 | /etc/vim |
193 | ├── vimrc # vim配置文件,负责引入不同的配置模块 | 193 | ├── vimrc # vim配置文件,负责引入不同的配置模块 |
194 | ├── vimrc_origin # 原有配置脚本备份 | 194 | └── vimrcs # 我的配置文件夹,里边是不同的配置模块 |
195 | ├── vimrcs # 我的配置文件夹,里边是不同的配置模块 | 195 | ├── autocmd.vim |
196 | │ ├── autocmd.vim | 196 | ├── codecmd.vim |
197 | │ ├── codecmd.vim | 197 | ├── keybind.vim |
198 | │ ├── keybind.vim | 198 | ├── match.vim |
199 | │ ├── match.vim | 199 | ├── myset.vim |
200 | │ ├── myset.vim | 200 | ├── plugs.vim |
201 | │ ├── plugs.vim | 201 | └── statusline.vim |
202 | │ └── statusline.vim | ||
203 | ├── vimrc.tiny # 原有脚本,无用 | ||
204 | └── vimscript.vim # 原有脚本,无用 | ||
205 | ``` | 202 | ``` |
206 | 203 | ||
207 | 我直接把我服务器上的配置文件[放在这里](https://file.qin-juan-ge-zhu.top/useful/vim/),以供查看。 | 204 | 我直接把我服务器上的配置文件[放在这里](https://git.qin-juan-ge-zhu.top/vimrc),以供查看。 |