vimwiki-markdown: vimwiki markdown file to html with syntax highlighting.
Project description
vimwiki-markdown
vimwiki markdown file to html with syntax highlighting.
Install
pip install vimwiki-markdown
Usage
Add the following to your ~/.vimrc
:
let g:vimwiki_list = [{
\ 'path': '~/vimwiki',
\ 'template_path': '~/vimwiki/templates/',
\ 'template_default': 'default',
\ 'syntax': 'markdown',
\ 'ext': '.md',
\ 'path_html': '~/vimwiki/site_html/',
\ 'custom_wiki2html': 'vimwiki_markdown',
\ 'template_ext': '.tpl'}]
Markdown extensions
The following markdown extensions are activated by default:
But you can add more extensions using VIMWIKI_MARKDOWN_EXTENSIONS
environment variable:
- Json dictionary syntax of extension with configuration
{"toc": {"baselevel": 2 }, "nl2br": {}}
. Note:{}
configuration implies no configuration. - [DEPRECATED] Json list syntax of extension.
["toc", "nl2br"]
. - [DEPRECATED] comma separated list of extensions
toc,nl2br
.
Warning Deprecated formats will be remove in next major release
Syntax highlighting
Syntax highlighting is provided by Pygments, which will try to guess language by default.
You can use regular markdown indented code blocks:
:::python
for value range(42):
print(value)
Or Fenced Code Blocks
```python
for value range(42):
print(value)
```
You can also highlight line using hl_lines
argument:
```python hl_lines="1 3"
for value range(42):
print(value)
```
Pygments can generate CSS rules for you. Just run the following command from the command line:
pygmentize -S default -f html -a .codehilite > styles.css
If you would like to use a different theme, swap out default
for the desired
theme. For a list of themes installed on your system, run the following
command:
pygmentize -L style
If you are lazy you can just use the one in this repository inside css
directory which provide the monokai
theme.
Environment variables
The following environment variables are available, but not mandatory:
VIMWIKI_TEMPLATE_PATH
: path to vimwiki HTML templateVIMWIKI_TEMPLATE_DEFAULT
: default HTML template nameVIMWIKI_TEMPLATE_EXT
: default HTML template extensionVIMWIKI_ROOT_PATH
: vimwiki root path
If not set vimwiki_markdown
will use
the default template defined in the source code.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file vimwiki-markdown-0.4.1.tar.gz
.
File metadata
- Download URL: vimwiki-markdown-0.4.1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84997439313a907b9c5463b180e6411b49e86117f199adf2652ad4584b2c2cde |
|
MD5 | 2e5d8fffb579bd4d6f764d9c9b8404c7 |
|
BLAKE2b-256 | c7f55a112edf0b3efca5d95bf791d0aefc1c0c3d825c20948bd0d0c30476716b |
File details
Details for the file vimwiki_markdown-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: vimwiki_markdown-0.4.1-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d951cb28a4e329ef03cd43a5604aada6215cc1438465d3e3bc6fba47e48d172f |
|
MD5 | a53ed3d722bc8e1068aa9389e9a23ce5 |
|
BLAKE2b-256 | 160b46ce2fd31edf0ad8de46a1db84fe643b89829b97055f93ffbb48601f3576 |