You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #103: Open HTML in split & Mediawiki converter
In this merge commit I'm making a couple of minor changes:
- The `---` sequence is now used as a horizontal divider in the
Mediawiki syntax converter.
- The changes to xolox#notes#html#view() created a temporary file even
when the HTML was shown in a Vim split window, now the temporary file
is only created when it needs to be passed to a web browser.
- I changed some wrong indentation, removed some unused code (the
counter variable) and renamed some private variables
(s/hilight/highlight/g) and added word boundaries to the
TODO/DONE/XXX matching in the file mediawiki.vim.
- No trailing empty lines are added when a note is converted to
Mediawiki syntax (there were in the pull request, but without context
or explanation so I'd rather keep the Markdown, HTML and Mediawiki
converters consistent).
Copy file name to clipboardExpand all lines: README.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -230,7 +230,13 @@ If for any reason you want to recreate the list of tags you can execute the `:In
230
230
231
231
### The `:NoteToHtml` command
232
232
233
-
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.
233
+
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. To convert your note to HTML and open the generated web page in a browser, you can run:
234
+
235
+
:NoteToHtml
236
+
237
+
Alternatively, to convert your note to HTML and display it in a new split window in Vim, you can run:
238
+
239
+
:NoteToHtml split
234
240
235
241
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).
236
242
@@ -246,6 +252,14 @@ Convert the current note to a [Markdown document] [markdown]. The vim-notes synt
246
252
247
253
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).
248
254
255
+
### The `:NoteToMediawiki` command
256
+
257
+
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:
258
+
259
+
* 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.
260
+
261
+
* 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.
262
+
249
263
## Mappings
250
264
251
265
The following key mappings are defined inside notes.
@@ -351,6 +365,7 @@ This software is licensed under the [MIT license] [mit].
0 commit comments