Skip to content

Commit

Permalink
fixed documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
timcharper committed Nov 3, 2008
1 parent efbbc43 commit 8fc6ddb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
14 changes: 7 additions & 7 deletions doc/textile.txt
@@ -1,9 +1,9 @@
*textile.txt* Textile for Vim Last Change: August 26, 2008
*textile.txt* Textile for Vim Last Change: November 3, 2008

===============================================================================
REQUIREMENTS *textile-requirements*

- ruby - http://ruby-lang.org/
- ruby - http://ruby-lang.org/ (seperate executable, not compiled in)
- RedCloth - http://whytheluckystiff.net/ruby/redcloth/

Files with the extension *.textile will auto-detected. If editing a new file,
Expand All @@ -13,7 +13,7 @@ or otherwise, run ":setf textile" to enable textile commands.
==============================================================================
CHANGELOG *textile-changelog*


0.3 - Fixed keymappings in the documentation
0.2 - Added multiple colors for headers, and alternating colors for list
items
- Fixed error in the vim script for TextileRenderBufferToFile
Expand All @@ -29,17 +29,17 @@ h2. Commands
:TextilePreview - Render the current buffer to a temp file, and open it in
your web browser (OSX only)

<Leader>tp
<Leader>rp

:TextileRenderTab - ... to a new tab

<Leader>tr
<Leader>rt

:TextileRenderFile - ... to a file

<Leader>tf
<Leader>rf

<Leader> is \ by default, so <Leader>tp == \tp
<Leader> is \ by default, so <Leader>rp == \rp

==============================================================================
CREDITS *textile-credits*
Expand Down
10 changes: 6 additions & 4 deletions ftplugin/textile.vim
Expand Up @@ -19,11 +19,13 @@ function! TextileRender(lines)

let text = join(a:lines, "\n")
let html = system("ruby -e \"def e(msg); puts msg; exit 1; end; begin; require 'rubygems'; rescue LoadError; e('rubygems not found'); end; begin; require 'redcloth'; rescue LoadError; e('RedCloth gem not installed. Run this from the terminal: sudo gem install RedCloth'); end; puts(RedCloth.new(\\$stdin.read).to_html(:textile))\"", text)
return split("<html><head><title>" . bufname("%") . "</title><body>\n" . html . "\n</body></html>", "\n")
return html
endfunction

function! TextileRenderFile(lines, filename)
return writefile(TextileRender(getbufline(bufname("%"), 1, '$')), a:filename)
let html = TextileRender(getbufline(bufname("%"), 1, '$'))
let html = "<html><head><title>" . bufname("%") . "</title><body>\n" . html . "\n</body></html>"
return writefile(split(html, "\n"), a:filename)
endfunction

function! TextileRenderBufferToPreview()
Expand All @@ -41,9 +43,9 @@ function! TextileRenderBufferToFile()
endfunction

function! TextileRenderBufferToTab()
let html_lines = TextileRender(getbufline(bufname("%"), 1, '$'))
let html = TextileRender(getbufline(bufname("%"), 1, '$'))
tabnew
call append("^", html_lines)
call append("^", split(html, "\n"))
set syntax=html
endfunction

0 comments on commit 8fc6ddb

Please sign in to comment.