Hello
gu-fan / instantrst Goto Github PK
View Code? Open in Web Editor NEWinstant rst preview in browser
instant rst preview in browser
Hello
The server hangs when I have a header 3 without having a header 2 before.
For example, write:
h1 header
*********
h2 header
=========
h3 header
---------
Now go and remove the h2 header (and the ====). This will make the streaming to hang. If you quit vim and restart the server the server will fail to restart even the previous generated page and it will throw a 500 error. (and show the 'Preview RST' page)
(complete error log: http://www.pasteall.org/54139)
If you go to the file and fix that, the problem is solved (you don't even need to restart the server).
The error is (SEVERE/4) Title level inconsistent, and got me really confused when I was first trying the plugin. That said I'm enjoying it a lot and think it will be very useful, thanks for this project.
I have created a instantRst.bat file for this plugin InstantRst to call InstantRst python script:
@"c:\myapps\python36\python.exe" "c:\myapps\python36\Scripts\instantRst" %*
but, there are still problem to preview rst file.
Hi! I have been using InstantRst for some time, and find this plugin really wonderful.
However, there is a small issue with the option g:instant_rst_static
- it does not seem to work. I want to change the style sheet from mars.css
to rhythm.rss
, and add this line let g:instant_rst_static = '/path/to/instant_rst/static/rhythm.css'
in ~/.vimrc
, but the preview of the rst file in firefox does not seem to change at all.
Then I try to modify /instant_rst/templates/index.html
, changing the line
<link rel="stylesheet" href="/static/mars.css">
to
<link rel="stylesheet" href="/static/rhythm.css">
and this time it works. So I just wonder what the real function of g:instant_rst_static
is. (It sets the -t
argument of instant-rst.py
in Rykka/InstantRst actually. So Is it just an option to indicate the directory of static files rather than to refer to a css file directly? And if I want to change the style sheet, I have no other options but to modify the related line in index.html
as above?)
By the way, I also happen to find that rhythm.css
in Rykka/InstantRst is a little different from the one in Rykka/rhythm. I prefer the latter one for it has wider line spacing, which makes the rendering of rst much more beautiful. (The former one would sometimes make the lines overlap with each other.)
Thanks again for your great work!
Dear InstantRst,
It seems that the default version of InstantRst fail to run on Windows.
After some adaptation I managed to have it working.
I had to:
pip install Flask-SocketIO==4.3.2
I have made the change in a local branch.
Let me know if you are interested I pushed my change in a branch.
Best regards,
Vivian.
To my personal taste it is annoying to have the rendering triggered any time that I press <enter>
, so is it possible to add a g:instant_rst_very_slow
option to exclude it?
(ideally I would like to have only BufWrite, InsertLeave
triggering rendering, so having the option removes also CursorHold
, but it's really not a priority compared to <enter>
)
with InstantRst, Vim for some reason doesn't recognize any keybinding for the Delete key, and simply tries to interpret the string ^[[3~ as input instead. Here's what I could profile till now.
^[[3~
below status bar each TIME. Takes ~2 sec for each.in Screen, uninstalled InstantRst: DEL works fine
in Screen, rst file copied in $HOME: DEL> works fine! (scratching my head)
<DEL>
works fine.^[[3~
(for the record, ESC : ^[
and Backsp : ^?
)With urxvt-v9.21, screen-4.02.01 (GNU), vim-7.4.663, vim.riv, IntantRst.
Refs:
Looks very similar to (riv.vim) Delete key is remapped as #89
Bonjour,
I noticed and offsed in the "Vim vs Browser" binded scrolling when there is a "..contents::" field (and probably also with any other expanding content like (ex: ..image::)). I looked at the s:scroll() function but sorry not being able to propose a pull request.
Best regards,
This message appears in vim when I run :InstantRst command.
[InstantRst] Preview buffer at http://localhost:5676
Error detected while processing function 53_preview:
line 27:
E216: No such group or event:
Press ENTER or type command to continue
My objective is to bind InstantRst to 0.0.0.0.
I am assuming this is achieved by setting g:instant_rst_localhost_only to 0 even though its value is 0 when I start Vim.
Perhaps I am misunderstanding Vim and/or InstantRst since I am new to both.
Steps taken:
open .rst document in vim
check value of g:instant_rst_localhost_only: :echo g:instant_rst_localhost_only
result: 0
start InstantRst: :InstantRst
result: [InstantRst] Preview buffer at http://localhost:5676
StopInstantRst
set g:instant_rst_localhost_only to 1: :let g:instant_rst_localhost_only=1
check value of g:instant_rst_localhost_only: :echo g:instant_rst_localhost_only
result: 1
start InstantRst: :InstantRst
result: [InstantRst] Preview buffer at http://localhost:5676
I expected 'localhost' to be '0.0.0.0' with g:instant_rst_localhost_only equals 0 though I am getting no change when it is equal to 0 or 1.
Thanks for the really cool plugin!
I'm working on Ubuntu. The Webpage is shown, but only mars.css without syntax highlighting is used. Set the template directory to the rhythm.css bundle doesn't change anything.
Two files have the same contents and in the same directory.
julien:rst julien$ ls /tmp/*.rst
/tmp/b.rst /tmp/c c.rst
I'm using Google Chrome, MacOS(darwin).
let g:instant_rst_browser = 'Google Chrome'
The plugin can not start the browser.
Dear InstantRst,
It seems that when the file contains utf-8 code (that are not ascii code) the server fail to serve.
In the code of server.py I have replace
open(file, "r")
by
open(file, mode="rt", encoding="utf8")
To solve the problem.
Best regards,
Vivian.
Hey there,
here is another one, I get an error when I switch out of the buffer containing the rst file.
Error detected while processing BufWinLeave Auto commands for "<buffer=3>":
E119: Not enough arguments for function: <SNR>133_cleanUp
I could solve it by changing line 205 of instantRst.vim to
au BufWinLeave <buffer> call s:cleanUp('')
Greetings
Swen
Hi there,
I tried your plugin today and once I set up everything, it works fine.
However before I got there it told me that the server is ready at http://localhost:5676 although it obviously was not.
In fact instant-rst.py was not installed at all and even after I installed it I had the same problem until I noticed that I forgot to add the executable to the path variable.
Dunno how exactly your code works but maybe you could include some check like 'which instantRst' to make sure it is actually accessible and give an error message if it's not? Would've saved me some time figuring out where the problem is.
Greetings
Swen
Bonjour,
I went into install difficulties. I found the need to follows these steps on debian:
$ sudo apt-get install libevent-dev
$ sudo apt-get install python-all-dev
$ sudo pip install greenlet
$ sudo pip install gevent
I think it may help many potential users to add this information in a FAQ section or in the Install documentation.
Thanks
Are there any plans to support sphinx render? It could be very useful for documentation writing: docutils don't support all those special tags and emit error blocks in each case.
Hello,
Whenever I start the server, I got blank screen instead of the preview. Here is a screenshot
Vim 8.2 on OSX + Edge (tried Safari, Google Chrome, same issue)
When I run the :InstantRst command from a RST file I get the following error messages:
Sorry for it being in dutch, but it means:
Could you help me to make this work?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.