Skip to content

Commit 57a4c02

Browse files
naddeoaAnthony Naddeo
authored andcommitted
Updated documentation to contain :NoteToMediawiki
Also updated the documentation to contain the `:NoteToHtml split` addition.
1 parent 59c77f9 commit 57a4c02

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,14 @@ If for any reason you want to recreate the list of tags you can execute the `:In
232232

233233
This command converts the current note to HTML. It works by first converting the current note to [Markdown] [markdown] and then using the `markdown` program to convert that to HTML. It requires an external program to convert Markdown to HTML. By default the program `markdown` is used, but you can change the name of the program using the `g:notes_markdown_program` option.
234234

235+
To convert your note to html and open it in a browser, you can run:
236+
237+
:NoteToHtml
238+
239+
Alternatively, to convert your note to html and display it in a new split in vim, you can run:
240+
241+
:NoteToHtml split
242+
235243
Note that this command can be a bit slow, because the parser for the note taking syntax is written in Vim script (for portability) and has not been optimized for speed (yet).
236244

237245
### The `:NoteToMarkdown` command
@@ -246,6 +254,16 @@ Convert the current note to a [Markdown document] [markdown]. The vim-notes synt
246254

247255
Note that this command can be a bit slow, because the parser for the note taking syntax is written in Vim script (for portability) and has not been optimized for speed (yet).
248256

257+
### The `:NoteToMediawiki` command
258+
259+
Convert the current note to a [Mediawiki document] [mediawiki]. This is similar to the `:NoteToMarkdown` command, but it produces wiki text that can be displayed on a Mediawiki site. That being said, the subset of wiki markup that vim-notes actually produces will probably work on other wiki sites. These are the notable transforations:
260+
261+
* The first line of the note is a title, but it isn't used in the Mediawiki syntax. It could have been put into a `= Title =` tag, but it doesn't really make sense in the context of a wiki. It would make the table of contents nest under the title for every document you create.
262+
263+
* Preformatted blocks are output into `<syntaxhighlight lang="..">` tags. This functionality is enabled on Mediawiki through the [SyntaxHighlight GeSHi extention] [geshi]. It is also supported on Wikipedia.
264+
265+
* Currently, the `***` divider isn't translated into anything.
266+
249267
## Mappings
250268

251269
The following key mappings are defined inside notes.
@@ -360,6 +378,8 @@ This software is licensed under the [MIT license] [mit].
360378
[levenshtein]: http://en.wikipedia.org/wiki/Levenshtein_distance
361379
[mapleader]: http://vimdoc.sourceforge.net/htmldoc/map.html#mapleader
362380
[markdown]: http://en.wikipedia.org/wiki/Markdown
381+
[mediawiki]: https://www.mediawiki.org/wiki/MediaWiki
382+
[geshi]: http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi
363383
[mit]: http://en.wikipedia.org/wiki/MIT_License
364384
[modeline]: http://vimdoc.sourceforge.net/htmldoc/options.html#modeline
365385
[monaco]: http://en.wikipedia.org/wiki/Monaco_(typeface)

autoload/xolox/notes/mediawiki.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function! xolox#notes#mediawiki#convert_block(block) " {{{1
4040
let text = s:make_urls_explicit(a:block.text)
4141
return printf("%s %s %s", marker, text, marker)
4242
elseif a:block.type == 'code'
43-
return printf('<source lang="%s">%s</source>', a:block.language, a:block.text)
43+
return printf('<syntaxhighlight lang="%s">%s</syntaxhighlight>', a:block.language, a:block.text)
4444
elseif a:block.type == 'divider'
4545
"TODO is there an equivelant here for mediawiki?
4646
return ''

0 commit comments

Comments
 (0)