当前位置: 首页 > 工具软件 > Vim Bootstrap > 使用案例 >

vim html php 混排,如何修改vim插件vimwiki中Vimwiki2HTML的一些细节

孔欣可
2023-12-01

vimwiki默认的Vimwiki2HTML命令,会把%toc转换为当前wiki条目的目录,但是会把二级目录id转换为toc_1.1(id中含有点号),而为了使用bootstrap-scrollspy实现滚动侦测(参考:如何实现网页滚动侦测以及顶端固定导航栏),id中不能用点号。

请问:

怎么能让vimwiki生成的html文件中目录id不含点号,比如用toc_1_1代替toc_1.1。

怎么能让生成的目录中

  • 标签有属性class="nav",这个也是为了使用bootstrap-scrollspy。

vimwiki的帮助手册里这样写道:

vimwiki-option-custom_wiki2html

------------------------------------------------------------------------------

Key Default value~

custom_wiki2html ''

Description~

The full path to an user-provided script that converts a wiki page to HTML.

Vimwiki calls the provided |vimwiki-option-custom_wiki2html| script from the

command-line, using '!' invocation.

The following arguments, in this order, are passed to the

|vimwiki-option-custom_wiki2html| script:

1. force : [0/1] overwrite an existing file

2. syntax : the syntax chosen for this wiki

3. extension : the file extension for this wiki

4. output_dir : the full path of the output directory, i.e. 'path_html'

5. input_file : the full path of the wiki page

6. css_file : the full path of the css file for this wiki

For an example and further instructions, refer to the following script:

$VIMHOME/autoload/vimwiki/customwiki2html.sh

To use the internal wiki2html converter, use an empty string (the default).

我水平有限,不能直接写一个外部的脚本,想参考下vimwiki默认的脚本是什么样子,但是不知道internal wiki2html converter的脚本在哪里。

 类似资料: