Coder Social home page Coder Social logo

vimwiki_markdown's Introduction

vimwiki-markdown

PyPI version PyPI downloads

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, which is a coma separated list of extensions.

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 template
  • VIMWIKI_TEMPLATE_DEFAULT: default HTML template name
  • VIMWIKI_TEMPLATE_EXT: default HTML template extension
  • VIMWIKI_ROOT_PATH: vimwiki root path

If not set vimwiki_markdown will use the default template defined in the source code.

vimwiki_markdown's People

Contributors

wnp avatar levirs565 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.