Giter Club home page Giter Club logo

instantrst's Introduction

Hello

instantrst's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

instantrst's Issues

Server hangs when header hierarchy is not respected ((SEVERE/4) Title level inconsistent)

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.

It does not work in windows8 gvim

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.

Setting g:instant_rst_static Does not Work

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!

Fail to run on Windows

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:

  • create a InstantRst.bat file in the related Python package.
  • Adapt the redirction to windows from >/def/null to >nul
  • Make small adaption to the curl call (replace the ' by ")
  • Avoid the installation of Flask-SocketIO > 5.0.0
  • Create the C:\Users\myuser.vim folder (I'm using neovim)

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.

Very slow option

Feature request

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>)

<DEL> key not workin on *.rst files

DEL key behaviour on any *rst files

Into Screen:

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.

  • normal mode: Toggle CASE of the character under Cursor, and of the following characters when repeated, briefly printing ^[[3~ below status bar each TIME. Takes ~2 sec for each.
  • insert mode: Toggle case of the character before cursor, briefly printing...
  • visual mode: Toggle case of the first character of selected string
    Have to use CTRL + Backspace, which works in normal and insert modes but is totaly unatural (try explain that to your hand!)

in Screen, uninstalled InstantRst: DEL works fine
in Screen, rst file copied in $HOME: DEL> works fine! (scratching my head)

In urxvt only:<DEL> works fine.
Checkin keycodes (with CTRL + V):
  • In Vim (urxvt) : DEL : ^[[3~ (for the record, ESC : ^[ and Backsp : ^? )
  • Out of Screen: same
  • With/without IntantRst: same
  • editing standard / *.rst file: same.

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

Bind_scroll offset with expanding fields (..contents::)

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,

changing g:instant_rst_localhost_only has no effect

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

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!

How to set template (.css, syntax/.css)?

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.

vim don't refresh screen with bind_scroll

I use Vim with cygwin.

At enable bind_scroll, Vim don't refresh window after inputing j, k or other moving key. I must press ctrl+L to refresh screen to recover.

screenshot

When the filename incluing a space, the plugin will fail.

Two files have the same contents and in the same directory.

julien:rst julien$ ls /tmp/*.rst
/tmp/b.rst   /tmp/c c.rst
  • When VI open file b.rst, :instantRst command works fine.
  • When VI open file c c.rst, :instantRst command wont open a tab in web browser, and you can view nothing even you open a tab for localhost:5676 manually. While you open another file and call :instantRst correctly, the file with spaces in the filename can also have a live view in the browser.

Utf-8 support

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.

Error when switching buffer

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

Give error message if starting server fails

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

Additional install information (gevent)

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

Sphinx support

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.

Blank screen on vim 8.2

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)

Running :InstantRst gives the error that it can't open a .tmp file

When I run the :InstantRst command from a RST file I get the following error messages:
image

Sorry for it being in dutch, but it means:

  • Error occured while processing function startdaemon
  • Opening file Appdata\Local\xxxxx.tmp has failed
  • Error occured while processing function refreshview
  • Opening file xxxxx.tmp has failed

Could you help me to make this work?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.