-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support :make variant/option that renders to a temporary file and opens a webbrowser to display it? #5
Comments
Probably. I for now use |
If you can suggest a mapping implementation that would be nice too. |
Something similar is currently in my
|
Ah, thanks, I'll play with that. (For the OS-dependent side, perhaps you can use |
I was thinking about it the other day and decided not to add it. One can add following snippet into their func! s:rst_view() abort
let output = tempname() . '.html'
call system(printf("%s %s %s %s",
\ "rst2html5.py",
\ " --input-encoding=utf8 --stylesheet-path=minimal.css,responsive.css",
\ shellescape(expand("%:p")),
\ output
\ ))
" Comment/Uncomment what is appropriate
" Windows
exe ':silent !start ' . output
" OSX
" exe ':silent !xdg-open ' . output
" Linux
" exe ':silent !open ' . output
endfunc
command! -buffer RSTView call s:rst_view() |
Your :make currently writes the html output next to the rst file. I have personally found it useful to write instead to a temporary directory, and immediately display the result in a webbrowser. See marshallward/vim-restructuredtext#62 for the implementation I currently use, although variants are certainly possible. Perhaps this behavior can be configured with a variable?
The text was updated successfully, but these errors were encountered: