instant-markdown / vim-instant-markdown Goto Github PK
View Code? Open in Web Editor NEWInstant Markdown previews from Vim
Home Page: https://instant-markdown.github.io
License: Other
Instant Markdown previews from Vim
Home Page: https://instant-markdown.github.io
License: Other
3 ticks followed by 'javascript' doesn't work although it's supported on github. 'js' works though.
The default css is github style.
Could add some config for customizing style except modify the ghf_marked.css
shipped with npm module
Hi Suan,
After installation of vim-instant-markdown
using Vundle
and following the instructions in the README I found the following problem:
On opening a markdown file in Vim, the same file opens in a browser window.
Unfortunately, editing the file is very unresponsive. I can only type about one character per second, otherwise characters get lost. Also, the browser window does not update and a manual reload of the page leads to a could not connect to localhost:8090.
I am sure the problem must be on my side, otherwise someone would have reported it before me. However, I just have no clue of what might have gone wrong.
Stefan
I got a really weird issue as following:
Testing
======
---
at the 1st line of this fine, save and exit. When I reopen the file it's working very good.So the conclusion is: something wrong when open the markdown file. And this problem may be related to ---
I've check the needed gems / node:
Plus I've try instructions in #41 by adding set shell=bash\ -i
in my .vimrc file, since I am using Mavericks.
Any help would be appreciated 😃
In the readme, you mention a limitation on linux. When vim launches the browser, the focus moves to the browser rather than staying in vim.
Here's an idea that may help solve the problem:
I recently came across wmctrl. sudo apt-get install wmctrl
Cache the currently active window in an environment variable with a command something like this: (this is the terminal window vim is running in, or the gvim window):
#Saves the currently active window's ID to $cachedWindowID environment variable
cachedWindowID=$(wmctrl -a :ACTIVE: -v |& sed -e "1,1 d" -e "s/Using window: //")
Then after the browser is launched with xdg-open http://localhost:8090
, switch back to the previously active window with a command like this:
wmctrl -i -a $cachedWindowID
Maybe you could use a strategy something like the above here?: https://github.com/suan/instant-markdown-d/blob/master/instant-markdown-d#L97
It is working fine until I type <bla>
. For example etc. The < ...>
makes the browser disappear all the contents.
If I use it in the code, 4 spaces after, or back-ticks, then it is alright.
Is there any work around?
Thanks in advance.
Is it possible to have the plugin only try to preview markdown files? At the moment it is opening a browser tab for every file I open, which is annoying.
I'm not sure if this is a bug or a feature request :)
I'm using Ubuntu 12.04 64bit.
Vim-instant-markdown only automatically launch the preview window when you open a markdown file.
How does it support .md file?
I already have something that uses port :8090, so I can't use this plugin without figuring out how to change the port.
I've noticed that many people have similar problem during compilation of markdown files. I also have it.
Usually users think that is wrong instalation of software (sometimes it is), but the problem is probably with used markdown compiler.
I spin around for a while trying to debug what can cause this bug and I found some interesting issues with compilation process.
Some word into header section can't be compile properly:
## Użytkownik (FAIL with "ż" sign)
but below sample dump text compile properly.
## DasdfFAFfgsvsv żżżżż
Code snippets with given language formatting:
Correct:
```
cd some sample code
```
Fail:
```shell
cd some sample code
```
I'm not sure yet what is the main source of this issue, but I'm convinced that this bunch of problems is caused mainly by markdown compilator or "Github markdown flavor" styles.
Did you observe the same problem on your machines?
Error detected while processing function <SNR>82_pushMarkdown..<SNR>82_startDaemon:
line 2:
E677: Error writing temp file
:help E677 shows this is a problem with the system() call. This strikes me as lame. :P However, a fix is easy enough, I should think.
I install a markdown plugin(this one), It can't works.
On changing to zsh shell when creating a markdown file a blank screen is displayed in the browser.
Have read through previous issues and all the tests work.
Changing back to bash and I have no problems and everything works fine.
Any ideas please?
Installation of instant-markdown failed due to a connection error:
sovonex@sovonex:~/Desktop/temp/chinese/dev/css$ npm -d install instant-markdown-d
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info bundling for [email protected] [ 'https://[email protected]/suan/Docter/tarball/master' ]
npm ERR! Error connecting to server https://suan/github.com/suan/Docter/tarball/master
npm ERR! Error installing https://[email protected]/suan/Docter/tarball/master
npm ERR! install failed Error: ENOTFOUND, Domain name not found
npm ERR! install failed at IOWatcher.callback (dns.js:74:15)
npm info install failed rollback
npm info uninstall [ '[email protected]' ]
npm info preuninstall [email protected]
npm info uninstall [email protected]
npm info auto-deactive not symlink
npm info postuninstall [email protected]
npm info uninstall [email protected] complete
npm info install failed rolled back
npm ERR! Error: ENOTFOUND, Domain name not found
npm ERR! at IOWatcher.callback (dns.js:74:15)
npm ERR! Report this *entire* log at <http://github.com/isaacs/npm/issues>
npm ERR! or email it to <[email protected]>
npm ERR! Just tweeting a tiny part of the error will not be helpful.
npm not ok
Is there something wrong with https://suan/github.com/suan/Docter/tarball/master
at the moment?
Stefan
I think it would be even better if it was possible to disable and enable the instantinaity of this plugin via a command.
:InstantMarkdownEnable " enable instant markdown functionality
:InstantMarkdownDisable " disable instant markdown functionality
Or something other API. Basically, after :InstantMarkdownEnable
is called, it'll check to see if current file is a markdown file and then open up the instant preview and then whenever a markdown buffer is navigated to the instant preview is opened. After :InstantMarkdownDisable
, the plugin should never open instant previews for markdown files.
I'm getting an error when trying to install pygments.rb.
$ gem install pygments.rb
ERROR: Error installing pygments.rb:
invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /Users/olalonde/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/cache/yajl-ruby-1.1.0.gem
Installing yajl-ruby directly works.
os x 10.10 yosemite + rbenv + ruby v2.1.3
I had a problem similar to some other people that have reported issues. That is, I do the full install and when I open a markdown file in vim, the browser window opens but nothing displays. When I perform the tests you suggest the connection is established but no border shows up and no text displays.
Through some debugging I was able to determine that the problem was that redcarpet had not properly installed. As it turns out, the real problem was that redcarpet doesn't seem to work with osx and 1.8.7 once I updated the ruby version everything worked great.
So, I suggest that you let users know that for best results on osx at least, they should upgrad to at least 1.9.3
It works well on my Mac when it runs Mac OSX Mountain Lion. After update to Mavericks, vim-instant-markdown not work proper.
It will still open a new tab with uri: http://localhost:8090/
each time I open a markdown file in vi. But the new tab displays nothing.
I have tried to reinstall vim-instant-markdown, including rubygem and npm. But nothing changes.
Here is my environment:
OS: Marvericks
ruby: 1.9.3
npm: 1.2.2
rubygem: 1.8.23
It would be great if it could re-use previously opened page, if possible, rather than just opening a new page every single time.
When i insert a line like below, the whole preview is empty.
# _hello_ man how are _you_ ?
But if i change it to something like these, the preview comes back
_hello_ man how are _you_ ?
# _hello_ man how are you ?
Seems there is a problem with headings containing multiple italic word.
Love the plugin, here's a feature request:
I keep all my notes in markdown now in Vim, it's slightly annoying to switch to a note and have the preview pop up all the time. It'd be great if it can be triggered via a mapping. I assume this would be a relatively small change, so let me know if you want me to go ahead and make it.
Thanks!
For each header (ie #
, ##
, ###
, etc..) create ids like github does.
For example in github, https://github.com/suan/vim-instant-markdown#installation is a link to the Installation
header defined by the following snippet from the markdown:
Installation
------------
Is this something that can be configured?
Hi,
The plugin works great but there are small differences with the way it render the markdown and the way github shows it. Like the page heading shows up with a small line in Github but in preview it does not!
$ npm -g install instant-markdown-d
gives
npm http GET http://registry.npmjs.org/instant-markdown-d
npm http GET http://registry.npmjs.org/instant-markdown-d
npm http 304 http://registry.npmjs.org/instant-markdown-d
npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules/instant-markdown-d'
npm ERR! { [Error: EACCES, mkdir '/usr/lib/node_modules/instant-markdown-d']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/lib/node_modules/instant-markdown-d',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/lib/node_modules/instant-markdown-d',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ 'DirWriter._create (/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23)',
npm ERR! '/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
npm ERR! 'Object.oncomplete (fs.js:297:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.14.8-1-MANJARO
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "-g" "install" "instant-markdown-d"
npm ERR! cwd /home/bryan/linguist
npm ERR! node -v v0.8.14
npm ERR! npm -v 1.1.65
npm ERR! path /usr/lib/node_modules/instant-markdown-d
npm ERR! fstream_path /usr/lib/node_modules/instant-markdown-d
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/lib/node_modules/instant-markdown-d'
npm ERR! fstream_stack DirWriter._create (/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23)
npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:297:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/bryan/linguist/npm-debug.log
npm ERR! not ok code 0
$ sudo npm -g install instant-markdown-d
gives
npm http GET https://registry.npmjs.org/instant-markdown-d
npm http GET https://registry.npmjs.org/instant-markdown-d
npm http 304 https://registry.npmjs.org/instant-markdown-d
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://github.com/suan/Docter/tarball/master
npm http GET https://registry.npmjs.org/send
npm ERR! fetch failed https://github.com/suan/Docter/tarball/master
npm http 304 https://registry.npmjs.org/send
npm http 200 https://registry.npmjs.org/socket.io
npm http GET https://github.com/suan/Docter/tarball/master
npm ERR! fetch failed https://github.com/suan/Docter/tarball/master
npm http GET https://github.com/suan/Docter/tarball/master
npm ERR! fetch failed https://github.com/suan/Docter/tarball/master
npm ERR! Error: getaddrinfo ENOENT
npm ERR! at errnoException (dns.js:31:11)
npm ERR! at Object.onanswer [as oncomplete] (dns.js:123:16)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Linux 3.14.8-1-MANJARO
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "-g" "install" "instant-markdown-d"
npm ERR! cwd /home/bryan/linguist
npm ERR! node -v v0.8.14
npm ERR! npm -v 1.1.65
npm ERR! syscall getaddrinfo
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/bryan/linguist/npm-debug.log
npm ERR! not ok code 0
$ sudo curl http://npmjs.org/install.sh | sh
gives
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: npmjs.org
$ curl http://npmjs.org/install.sh | sudo sh
gives
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 193 100 193 0 0 415 0 --:--:-- --:--:-- --:--:-- 415
sh: ligne 1: html: Aucun fichier ou dossier de ce type
sh: ligne 2: erreur de syntaxe près du symbole inattendu « < »
'h: ligne 2: `<head><title>301 Moved Permanently</title></head>
I also did
npm config set registry http://registry.npmjs.org/
and it didn't change anything
OS: Manjaro 0.8.10 Ascella
Kernel: x86_64 Linux 3.14.8-1-MANJARO
npm --version : 1.1.65
node --version : v0.8.14
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
if [ -f /usr/bin/screenfetch ]; then
screenfetch;
fi
xhost +local:root > /dev/null 2>&1
complete -cf sudo
shopt -s cdspell
shopt -s checkwinsize
shopt -s cmdhist
shopt -s dotglob
shopt -s expand_aliases
shopt -s extglob
shopt -s histappend
shopt -s hostcomplete
shopt -s nocaseglob
export HISTSIZE=10000
export HISTFILESIZE=${HISTSIZE}
export HISTCONTROL=ignoreboth
alias ls='ls --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
alias ll='ls -l --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
alias la='ls -la --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
alias grep='grep --color=tty -d skip'
alias cp="cp -i" # confirm before overwriting something
alias df='df -h' # human-readable sizes
alias free='free -m' # show sizes in MB
alias np='nano PKGBUILD'
alias lol="env WINEPREFIX="/home/bryan/.wine" wine C:\\windows\\command\\start.exe /Unix /home/bryan/.wine/dosdevices/c:/users/Public/Bureau/Play\League\of\Legends.lnk"
# ex - archive extractor
# usage: ex <file>
ex ()
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
# prompt
PS1='[\u@\h \W]\$ '
export PATH="$PATH:~/.cabal/bin:~/.xmonad/bin"
pathadd() {
if [ -d "$1" ] && [[ ":PATH:" != *":$1:"* ]]; then
PATH="${PATH:+"$PATH:"}$1"
fi
}
pathadd $HOME/.gem/ruby/2.1.0/bin
When my README.md is "# hello" or "中文", the plugin works fine. But when I want to include something like "# 中文" in it. The plugin just render a white page.
I found that there' s something wrong with github-flavoredmarkdown.rb
/usr/local/lib/node_modules/instant-markdown-d/node_modules/docter/bin
% echo "# 中文" | ./github-flavored-markdown.rb
/usr/lib/ruby/1.9.1/rexml/source.rb:162:in `initialize': incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
from /usr/lib/ruby/1.9.1/rexml/source.rb:17:in `new'
from /usr/lib/ruby/1.9.1/rexml/source.rb:17:in `create_from'
from /usr/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:127:in `stream='
from /usr/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:116:in `initialize'
from /usr/lib/ruby/1.9.1/rexml/parsers/treeparser.rb:9:in `new'
from /usr/lib/ruby/1.9.1/rexml/parsers/treeparser.rb:9:in `initialize'
from /usr/lib/ruby/1.9.1/rexml/document.rb:243:in `new'
from /usr/lib/ruby/1.9.1/rexml/document.rb:243:in `build'
from /usr/lib/ruby/1.9.1/rexml/document.rb:43:in `initialize'
from ./github-flavored-markdown.rb:62:in `new'
from ./github-flavored-markdown.rb:62:in `header'
from ./github-flavored-markdown.rb:99:in `render'
from ./github-flavored-markdown.rb:99:in `fromMarkdown'
from ./github-flavored-markdown.rb:103:in `<main>'
I've successfully installed and used this plugin on a different computer, but on this one, using headers (i.e. # Title
) causes the page to display nothing. Other things (including code fencing) display correctly, but as soon as I add a header, it wipes the page out. I've tried about everything I can think of. I'm using Ruby 1.9.3 under rvm - 1.9.3 is the default and gems were installed without sudo. instant-markdown-d is installed globally. I have xdg-utils. I've also tried many of the fixes found in other issues (e.g. changing mentos.py to use python2). Any insights into what else to try would be useful. FWIW, I am on Ubuntu 12.10 on this computer (but I was on 13.10 on the other, working, one).
It does seem like this would be a redcarpet issue. I'm using version 3.1.0. Is that what everyone else is using or is that a new version (and maybe that's why it's breaking)? Incidentally, I have tried it with -v 2.3.0, and that did not solve the problem.
I have all the required packages installed, but when I enter some code samples (by indenting the line 4 spaces) the entire browser screen clears and nothing is displayed. Any ideas on how we can fix this?
Firstly - great plugin! Thanks so much for this!
I have an idea for a feature. It might be something you've thought of already, I don't know. I think it would be awesome if it was possible to comment on GitHub issues straight from Vim. You could also create new issues, and maybe even edit them.
GitHub provide an API for this stuff here.
I'd be happy to try and implement this, but I've got my hands full with some other projects at the moment, and I don't know anything at all about Vim scripting. However, maybe in a month I should have some time spare to look at this, so if you don't feel like doing this yourself, then let me know and I'll have a go!
Again, thanks for the awesome plugin!
I have been using this plugin for a while, and I just installed in a new machine.
When I open a markdown file, a new browser window pops up and renders the file correctly, but it never gets updated anymore. If I close the vim session, it leaves node process a new intents to edit a markdown file doesn't even render the first time they're opened.
These are the software I'm using:
Thanks a lot!
I did a screencast to show: http://screencast.com/t/097egG9sTGtk
Doesn't do anything even tho it's installed correctly, right version, etc. All my other plugins seem to work tho.
Ideas?
In ubuntu 12.04(and others) it requires 2.3.0 version of redcarpet
sudo gem install -v 2.3.0 redcarpet
also need ruby-dev installed via apt or something
The \
is not escaped when inside ``.
So I was getting an empty \n
while on github it works properly.
I write quite a lot of scientific text, and Pandoc with its extended MarkDown has excellent support for some features that ordinary MarkDown oor GitHub-flavored MarkDown doesnẗ. On the other hand, I believe pandoc has support for most, if not all, GH flavored extensions. So maybe it would be great with an option to use Pandoc as the converting backend if it is installed on the user's system?
I was having some problems when editing a Markdown file that had headers. If I removed all header lines, updating worked fine. But as soon as I put "#" to the left of a line or "------" underneath a line to turn it into a header, the whole browser window went blank, not even an empty box.
I checked my gems and found that I had both redcarpet 3.0.0 and 3.1.1 installed. So I removed 3.1.1 and tried again. This cleared up the problem for me.
Currently, when editing long documents, there's a lot of switching back and forth between the editor and browser to scroll to the part of the document you're editing, particularly if your'e making edits in various parts of the doc.
It would be super-handy to have the browser client either scroll to follow the line of output that matches the current cursor position in the source, or alternatively - since that may be somewhat difficult - scrolling on change would also be fine, so that the line currently being changed is always visible in the browser.
Hi,
I had to install inherits before instant-markdown-d (fedora 20)
Without inherits :
> [email protected] install /lib/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make : on entre dans le répertoire « /usr/lib/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build »
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
COPY Release/bufferutil.node
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/obj.target/validation.node
SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
COPY Release/validation.node
make: on quitte le répertoire « /usr/lib/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build »
/bin/instant-markdown-d -> /lib/node_modules/instant-markdown-d/instant-markdown-d
npm WARN unmet dependency /lib/node_modules/block-stream requires inherits@'~2.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /lib/node_modules/fstream requires inherits@'~2.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /lib/node_modules/fstream-ignore requires inherits@'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /lib/node_modules/fstream-npm requires inherits@'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /lib/node_modules/glob requires inherits@'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /lib/node_modules/npmconf requires inherits@'~2.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /lib/node_modules/tar requires inherits@'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
[email protected] /lib/node_modules/instant-markdown-d
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])
You can update README.md with "npm -g install inherits".
github renders:
> Example
> * [suan/vim-instant-markdown · GitHub](https://github.com/suan/vim-instant-markdown)
> * testing 123
as the following:
Example
- suan/vim-instant-markdown · GitHub
- testing 123
But vim-instant-markdown, doesn't create the list bullet inside the blockquotes section.
To make it work for vim-instant-markdown, an extra line has to be added like this:
> Example
>
> * [suan/vim-instant-markdown · GitHub](https://github.com/suan/vim-instant-markdown)
> * testing 123
It seems nested lists do not work correctly or at least in an inconsistent way:
If I write:
* level 1
* level 2
* level 3
level 2 is correctly indented. However level 3 is on the same level as level2. Adding two more spaces before level 3 will fix the indentation but this is inconsistent with the fact that 2 spaces already suffice to start the first nested list.
I just got my new machine, and it's running ubuntu 13.10. By default curl is not installed in ubuntu, so your plugin will not refresh the view. Better to put this in your document.
Great work Suan!
I found that apostrophes are treated like string delimiters. This means I can'tcannot use contractions.
After some digging, I found somebody else had an identical problem:
thoughtbot/dotfiles#18
It seems an easy way to fix this is to add an autocmd
which sets the filetype correctly. I added the following to my instant-markdown.vim
and it worked for me:
autocmd BufWinEnter *.{md,mkd,mkdn,mark*} silent setf markdown
(This comes right after the other autocmd BufWinEnter
.)
after loading a markdown file, a new browser tab opens but only a white page is seen (with the following source):
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="/node_modules/docter/ghf_marked.css" />
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://localhost:8090/');
socket.on('connect', function () {
socket.on('newContent', function(newHTML) {
document.body.innerHTML = newHTML;
});
socket.on('die', function(newHTML) {
window.open('', '_self', '');
window.close();
var firefoxWarning =
"<h1>Oops!</h1>" +
"<h3>Firefox doesn't allow windows to self-close.</h3>" +
"<h3>If you want the preview window to close automatically like in other browsers, go to about:config and set dom.allow_scripts_to_close_windows to true.</h3>"
document.body.innerHTML = firefoxWarning;
});
});
</script>
</head>
<body>
</body>
</html>
I'd just followed the installation procedure. I'm running MacVim. Once launching and opening a markdown file, Chrome opens a new http://localhost:8090
tab. The problem is that I just get a blank web page. It has some source code for socket connection, but it does not display anything.
Do you think that you could provide a high level explanation of what's going on in your code? Thanks.
I installed vim-instant-markdown by invoking the documented gem and npm commands. I also installed the vim plugin with pathogen by moving the .vim
file into to a plugin
directory within my bundle/
directory.
When I open vim files in both macvim and vim, chrome opens up a new tab to localhost:8090
but doesn't display any content. Writing the buffer doesn't seem to help either.
I'm on mac os x version 10.7.3, running ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.1], running node v0.4.10.
When I open a markdown file, a blank browser tab opens.
The blank browser tab does not respond to updates to the markdown text. There are no console errors and no failed requests.
When I run echo Hello | instant-markdown-d
from the console, a blank page opens.
My $PATH seems to be ok (pygments.rb, redcarpet, and instant-markdown-d are all available from within vim).
Any help is much appreciated.
I would like to use relative images. But even with an absolute path used I can't get it to work.
When I've got Chrome and Vim open with this plugin, the rendered markdown in Chrome doesn't always fit within the window without horizontal scrolling. Would this be possible to achieve?
Let me know if what I'm saying isn't clear and I'll upload a screenshot.
Thanks.
This isn't a real issue with vim-instant-markdown, but I couldn't find another way to contact you and have a question. I use rvm, and when I am in a directory that has a .rvmrc file, when I open a markdown file in there, I have predictable issues if I don't have the two gems installed in the particular ruby environment/gemset that is in the .rvmrc. So I would have to install the two gems in each gemset that I have. Even installing in the global gemset for each ruby version is kind of a pain because I have multiple versions of ruby floating around. Any ideas on how to make this whole process easier? Feel free to close if you feel this is off-topic. Thanks!
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.