Git Product home page Git Product logo

instant-markdown-d's Introduction

!nstant-markdown-d

npm Node.js open collective badge

instant-markdown-d is a small Node.js server that enables instant compilation and previewing of Markup files. A plugin can easily be written for any text editor to interface with it. One currently exists for Vim: https://github.com/instant-markdown/vim-instant-markdown

Installation

Install the mini-server by running either:

[sudo] npm -g install instant-markdown-d

or using yarn (not recommended. See issue #86):

[sudo] yarn global add instant-markdown-d

To install from the bleeding edge development version, read the contributing guide. See vim-instant-markdown for Vim / Neovim integration.

REST API

Action HTTP Method Request URL Request Body
Refresh Markdown on page PUT http://localhost:\<port> <New Markdown file contents>
Close Webpage DELETE http://localhost:\<port>

By default, <port> is 8090

Environment variables

  • INSTANT_MARKDOWN_OPEN_TO_THE_WORLD=1 - by default, the server only listens on localhost. To make the server available to others in your network, set this environment variable to a non-empty value. Only use this setting on trusted networks!

  • INSTANT_MARKDOWN_ALLOW_UNSAFE_CONTENT=1 - by default, scripts are blocked. Use this preference to allow scripts.

  • INSTANT_MARKDOWN_BLOCK_EXTERNAL=1 - by default, external resources such as images, stylesheets, frames and plugins are allowed. Use this setting to block such external content.

  • INSTANT_MARKDOWN_MATHJAX_FONTS="/usr/share/mathjax/fonts/HTML-CSS/" - to serve fonts for Mathjax from a local directory.

instant-markdown-d's People

Contributors

ashwinvis avatar dependabot[bot] avatar enotionz avatar ernestre avatar euclio avatar felixge avatar hitzhangjie avatar hugopoi avatar leayeh avatar modood avatar rob--w avatar suan avatar wiredolphin avatar ylecuyer avatar

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

instant-markdown-d's Issues

Ability to open on new browser window

First of all, let me say that this is a very useful piece of software, thanks for that.
I use it along with your vim-instant-markdown. I've seen that it will open the preview in a new tab (if there's a browser already open), and that could sometimes be impractical, particularly when that browser is open in another desktop (I'm using OS X).

I've seen that this can be solved by changing line 97 on instant-markdown-d to:

exec('osascript -e \'tell application "Safari" to make new document with properties    {URL:"http://localhost:8090"}\'', function(error, stdout, stderr){});

This will open the preview on a new window instance at the current desktop. I think this can also be extended to open the user's default browser instead of safari (as in my code above).

Please tell me if you think this is worth it (useful for the rest of the users) and I'll prepare a PR.

Mermaid and Mathjax packages missing from node_modules when installed using yarn

Problem summary

Yarn seems to use a flat package layout (?) and therefore mermaid.js and mathjax.js are not placed where npm would place it. Code blocks and mermaid graphs fail to render.

Expected

Mermaid.js and Mathjax.js just works with yarn

Environment Information

  • OS and version: Linux
  • Vim: 8.2
  • Browser and version: Firefox 89

Provide the output of test command (required)

All tests pass

Steps to reproduce the issue (required)

Start with command you used to install instant-markdown-d

  1. yarn global add instant-markdown-d
  2. instant-markdown-d --mathjax --mermaid <test_math.md
  3. instant-markdown-d --mathjax --mermaid <test_mermaid.md
  4. ls ~/.config/yarn/global/node_modules/instant-markdown-d/node_modules -> empty!
  5. yarn global remove instant-markdown-d
  6. npm install -g instant-markdown-d
  7. ls ~/.npm-packages/lib/node_modules/instant-markdown-d/node_modules -> all dependencies!

Feature Enhancement

Feature Enhancement summary

http://localhost:8090/ can't work vim-like browser plug in.

vim-like : Vimium
https://github.com/philc/vimium

Expected

Since the "preview" is open in the browser, how can we set up instant-markdown-d work with browser?

Environment Information

  • OS and version: macOS Mojave, 10.14.6
  • Vim / Neovim version: version 8.2.1800
  • Browser and version: Firefox 85.0b4 (64-bit)

Problems with 4 spaces

Apparently, there's a problem when putting a file with lines starting with 4 spaces:

echo '   foo'  | curl -X PUT -T - http://localhost:8090/ # ok
echo '    foo' | curl -X PUT -T - http://localhost:8090/ # fail

The plug can't produce id for title

Problem summary

The plug can't produce id for title

Expected

Environment Information

  • OS:windows7
  • Vim / Neovim version:vim8.1.24
  • Browser:firefox

Steps to reproduce the issue (required)

Start with command you used to install instant-markdown-d. Use a
minimal.vimrc

to reproduce the issue and open your markdown file as:

vim -u minimal.vimrc my_markdown_file.md

Provide the debug output (required)

Run cat my_markdown_file.md | instant-markdown-d --mathjax --debug. It
generates a debug.html file - attach it here. Also, paste the console output
here:

Screen shot (if possible)

1630074819(1)

Add ability to configure browser autostart.

Can we disable the browser auto-launching? I edit via SSH and use a local browser to connect to the global port if possible, or the local port via SSH tunnel, but the latest version seems to fail if it can't launch a browser.

I've seen pull requests which let you configure the browser to use, but they don't support a 'none' browser, or browser disable functionality.

Fails on OS X

file test.markdown:

dot_files
=========

My unix dot files
$ cat test.markdown | instant-markdown-d
Option log level is not valid. Please refer to the README.
connection established!

But the body of the html served is empty.

I believe I've installed this correctly. To verify that, what other kind of debugging info would be helpful for me to provide?

Multimarkdown support?

My situation

Multimarkdown (MMD) is a popular superset of markdown. It has the killer (for me) feature of LaTeX-style equations -- a must, since I plan to switch to markdown for scientific communication.

Unfortunately, your plugin has spoiled me! I can't write MMD without missing the in-browser preview. :)

What to do?

Obviously, you can't simply add MMD support. Your GFM support is a killer feature, and GFM is incompatible with MMD.

So I guess I'm asking: is there a way for end-users to customize the markdown parser, so we can switch between GFM, MMD, or anything else we have installed?

What would you recommend?

Future of instant-markdown-d and vim-instant-markdown?

instant-markdown-d is a great solution to have live rendering of markdown with vim. Although you had other plans such as a rewrite to ruby, I have found very interesting solutions such as

  • autoscroll to cursor position
  • CSS fixes
  • fixes to serve files
  • Mathjax / Katex support

the fact that the community seems to be actively modifying, developing and pushing PRs is a proof of the support for instant-markdown-d.

My question to @suan is, would you come back anytime soon to maintain it? Are you leaving it for dead and there is no sense in submitting bugs, pull requests etc. any more? Would you be willing to grant more people the power over the project, so the maintainer workload is spread across more people? Or would it be best to agree on a common community-led fork?

Error during installation (caused by legacy binary "node" ?)

Hi,
I wanted to install the plugin vim-instant-markdown, but, it doesn't work. And I think it's because my installation of this Node.js server fail. I'm using the version v.0.10.25, and this is what I have when I want to install instant-markdown-d.

There is a specific warning which can help, maybe ?

npm WARN This failure might be due to the use of legacy binary "node"

nairolf@nairolf-UX301LAA:~$ sudo npm -g install instant-markdown-d
[sudo] password for nairolf: 
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/highlight.js
npm http GET https://registry.npmjs.org/markdown-it
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/send
npm http 304 https://registry.npmjs.org/highlight.js
npm http 304 https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/send
npm http 304 https://registry.npmjs.org/markdown-it
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/fresh/0.2.0
npm http GET https://registry.npmjs.org/range-parser/0.0.4
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/socket.io-parser/2.2.4
npm http GET https://registry.npmjs.org/engine.io/1.5.4
npm http GET https://registry.npmjs.org/socket.io-client/1.3.7
npm http GET https://registry.npmjs.org/has-binary-data/0.1.3
npm http GET https://registry.npmjs.org/socket.io-adapter/0.3.1
npm http GET https://registry.npmjs.org/debug/2.1.0
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/argparse
npm http GET https://registry.npmjs.org/linkify-it
npm http GET https://registry.npmjs.org/mdurl
npm http GET https://registry.npmjs.org/uc.micro
npm http 304 https://registry.npmjs.org/fresh/0.2.0
npm http 304 https://registry.npmjs.org/engine.io/1.5.4
npm http 304 https://registry.npmjs.org/socket.io-parser/2.2.4
npm http 304 https://registry.npmjs.org/socket.io-client/1.3.7
npm http 304 https://registry.npmjs.org/argparse
npm http 304 https://registry.npmjs.org/debug/2.1.0
npm http 304 https://registry.npmjs.org/linkify-it
npm http 304 https://registry.npmjs.org/mdurl
npm http 304 https://registry.npmjs.org/has-binary-data/0.1.3
npm http 304 https://registry.npmjs.org/uc.micro
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/sprintf-js
npm http 304 https://registry.npmjs.org/range-parser/0.0.4
npm http 304 https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/ms/0.7.1
npm http 304 https://registry.npmjs.org/sprintf-js
npm http 304 https://registry.npmjs.org/socket.io-adapter/0.3.1
npm http GET https://registry.npmjs.org/debug/1.0.2
npm http GET https://registry.npmjs.org/socket.io-parser/2.2.2
npm http GET https://registry.npmjs.org/object-keys/1.0.1
npm http GET https://registry.npmjs.org/ms/0.6.2
npm http GET https://registry.npmjs.org/isarray/0.0.1
npm http GET https://registry.npmjs.org/debug/1.0.3
npm http GET https://registry.npmjs.org/base64id/0.1.0
npm http GET https://registry.npmjs.org/engine.io-parser/1.2.2
npm http GET https://registry.npmjs.org/ws/0.8.0
npm http GET https://registry.npmjs.org/debug/0.7.4
npm http GET https://registry.npmjs.org/engine.io-client/1.5.4
npm http GET https://registry.npmjs.org/component-bind/1.0.0
npm http GET https://registry.npmjs.org/object-component/0.0.3
npm http GET https://registry.npmjs.org/component-emitter/1.1.2
npm http GET https://registry.npmjs.org/has-binary/0.1.6
npm http GET https://registry.npmjs.org/indexof/0.0.1
npm http GET https://registry.npmjs.org/parseuri/0.0.2
npm http GET https://registry.npmjs.org/to-array/0.1.3
npm http GET https://registry.npmjs.org/backo2/1.0.2
npm http 304 https://registry.npmjs.org/ms/0.6.2
npm http 304 https://registry.npmjs.org/isarray/0.0.1
npm http 304 https://registry.npmjs.org/socket.io-parser/2.2.2
npm http 304 https://registry.npmjs.org/object-keys/1.0.1
npm http 304 https://registry.npmjs.org/debug/1.0.2
npm http GET https://registry.npmjs.org/json3/3.2.6
npm http GET https://registry.npmjs.org/benchmark/1.0.0
npm http 304 https://registry.npmjs.org/debug/1.0.3
npm http 304 https://registry.npmjs.org/debug/0.7.4
npm http 304 https://registry.npmjs.org/engine.io-parser/1.2.2
npm http 304 https://registry.npmjs.org/ms/0.7.1
npm http 304 https://registry.npmjs.org/engine.io-client/1.5.4
npm http 304 https://registry.npmjs.org/component-bind/1.0.0
npm http 304 https://registry.npmjs.org/object-component/0.0.3
npm http 304 https://registry.npmjs.org/component-emitter/1.1.2
npm http 304 https://registry.npmjs.org/has-binary/0.1.6
npm http 304 https://registry.npmjs.org/indexof/0.0.1
npm http 304 https://registry.npmjs.org/base64id/0.1.0
npm http 304 https://registry.npmjs.org/parseuri/0.0.2
npm http 304 https://registry.npmjs.org/to-array/0.1.3
npm http 304 https://registry.npmjs.org/backo2/1.0.2
npm http 304 https://registry.npmjs.org/ws/0.8.0
npm http GET https://registry.npmjs.org/better-assert
npm http GET https://registry.npmjs.org/after/0.8.1
npm http GET https://registry.npmjs.org/arraybuffer.slice/0.0.6
npm http GET https://registry.npmjs.org/base64-arraybuffer/0.1.2
npm http GET https://registry.npmjs.org/blob/0.0.4
npm http GET https://registry.npmjs.org/utf8/2.1.0
npm http GET https://registry.npmjs.org/options
npm http GET https://registry.npmjs.org/ultron
npm http GET https://registry.npmjs.org/utf-8-validate
npm http GET https://registry.npmjs.org/bufferutil
npm http GET https://registry.npmjs.org/component-inherit/0.0.3
npm http GET https://registry.npmjs.org/debug/1.0.4
npm http GET https://registry.npmjs.org/has-cors/1.0.3
npm http GET https://registry.npmjs.org/parsejson/0.0.1
npm http GET https://registry.npmjs.org/parseuri/0.0.4
npm http GET https://registry.npmjs.org/parseqs/0.0.2
npm http GET https://github.com/rase-/node-XMLHttpRequest/archive/a6b6f2.tar.gz
npm http 304 https://registry.npmjs.org/better-assert
npm http GET https://registry.npmjs.org/callsite/1.0.0
npm http 304 https://registry.npmjs.org/base64-arraybuffer/0.1.2
npm http 304 https://registry.npmjs.org/arraybuffer.slice/0.0.6
npm http 304 https://registry.npmjs.org/blob/0.0.4
npm http 304 https://registry.npmjs.org/utf8/2.1.0
npm http 304 https://registry.npmjs.org/after/0.8.1
npm http 304 https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/ultron
npm http 304 https://registry.npmjs.org/utf-8-validate
npm http 304 https://registry.npmjs.org/bufferutil
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/component-inherit/0.0.3
npm http 304 https://registry.npmjs.org/debug/1.0.4
npm http 304 https://registry.npmjs.org/parsejson/0.0.1
npm http 304 https://registry.npmjs.org/parseuri/0.0.4
npm http 304 https://registry.npmjs.org/callsite/1.0.0
npm http 304 https://registry.npmjs.org/json3/3.2.6
npm http 304 https://registry.npmjs.org/benchmark/1.0.0
npm http 304 https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/parseqs/0.0.2

> [email protected] install /usr/local/lib/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild


> [email protected] install /usr/local/lib/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil
> node-gyp rebuild

npm http 304 https://registry.npmjs.org/has-cors/1.0.3
npm http 200 https://github.com/rase-/node-XMLHttpRequest/archive/a6b6f2.tar.gz
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-65-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok 
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm WARN optional dep failed, continuing [email protected]
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-65-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok 
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm WARN optional dep failed, continuing [email protected]
npm http GET https://github.com/component/global/archive/v2.0.1.tar.gz

> [email protected] install /usr/local/lib/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild


> [email protected] install /usr/local/lib/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil
> node-gyp rebuild

/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-65-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok 
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm WARN optional dep failed, continuing [email protected]
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-65-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok 
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm WARN optional dep failed, continuing [email protected]
npm http 200 https://github.com/component/global/archive/v2.0.1.tar.gz
/usr/local/bin/instant-markdown-d -> /usr/local/lib/node_modules/instant-markdown-d/instant-markdown-d
[email protected] /usr/local/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])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

TypeError: Cannot read property 'emit' crash

Hi,

While checking why markdown is not working and running one of your testcases resulted in a crash as soon as curl was started in another window. instant-markdown-d is the latest. Following is the input:

% echo lala | instant-markdown-d
Option log level is not valid. Please refer to the README.
/usr/local/lib/node_modules/instant-markdown-d/instant-markdown-d:40
output.emit('newContent', md.render(body));
^

TypeError: Cannot read property 'emit' of undefined
at IncomingMessage. (/usr/local/lib/node_modules/instant-markdown-d/instant-markdown-d:40:11)
at emitNone (events.js:67:13)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:905:12)
at nextTickCallbackWith2Args (node.js:441:9)
at process._tickCallback (node.js:355:17)

% echo abcdefg | curl -X PUT -T - http://localhost:8090

web-server didn't get started and I didn't see the output of testing.md file. I would be happy to provide any inputs required to solve this problem. Thanks!

nodejs not found and too old on Ubuntu 16.04

Just a giving my feedback having installed on Ubuntu 16.04. The default nodejs package installs at /usr/bin/nodejs, not /usr/bin/node, so instant-markdown-d complains about not being able to find it. However, creating a symlink didn't help because the version of nodejs is too old anyway, and gives a syntax error about block-scoped declarations not being allowed outside of strict mode.

To get it to work, I had to install a newer version of nodejs:

sudo npm -g install n
sudo n stable

Then it all works fine!

Bump on Highlight.js ^9, not rendered

Problem summary

Few days ago this vim extension work as usual, but today after I'm updating all
plugin with Plug suddenly I get encountered this issue, instant-markdown rendered with blank,
as screen shot below.

Expected

Environment Information

  • OS: Arch
  • Vim / Neovim version: VIM - Vi IMproved 8.2
  • Browser: Firefox

Provide the debug output (required)

Run cat my_markdown_file.md | instant-markdown-d --mathjax --debug and paste the
console output here:

instant-mardown-d version: v0.2.0-rc.2
nodejs version: v15.5.0
Run the following to manually open browser:
    xdg-open http://localhost:8090/
    Version 9 of Highlight.js has reached EOL and is no longer supported.
    Please upgrade or ask whatever dependency you are using to upgrade.
    https://github.com/highlightjs/highlight.js/issues/2877
    Rendered html saved as debug.html

and I did update Highlight.js, result

instant-mardown-d version: v0.2.0-rc.2
nodejs version: v15.5.0
Run the following to manually open browser:
    xdg-open http://localhost:8090/
    Rendered html saved as debug.html

Generate log files (required)

let g:instant_markdown_logfile = '/tmp/instant_markdown.log'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1458    0     0    0  1458      0   355k --:--:-- --:--:-- --:--:--  355k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1459    0     0    0  1459      0   474k --:--:-- --:--:-- --:--:--  474k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1460    0     0    0  1460      0   475k --:--:-- --:--:-- --:--:--  475k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1461    0     0    0  1461      0   203k --:--:-- --:--:-- --:--:--  203k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1462    0     0    0  1462      0   178k --:--:-- --:--:-- --:--:--  203k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1463    0     0    0  1463      0   357k --:--:-- --:--:-- --:--:--  357k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1464    0     0    0  1464      0   476k --:--:-- --:--:-- --:--:--  476k
  1. Add the above in your ~/.vimrc or ~/.config/nvim/init.vim. Modify the
    path if needed and generate the log file.
  2. Minimal ~/.vimrc or ~/.config/nvim/init.vim where variables for
    vim-instant-markdown defined
  3. debug.html

Steps to reproduce the issue (required)

Start with command you used to install instant-markdown-d

  1. npm -g i instant-markdown-d
  2. add config in vimrc let g:instant_markdown_autostart = 0
  3. open Readme.md
  4. call instant-markdown-on-vim :InstantMarkdownPreview

Screen shot (if possible)

2021-01-07-022525_859x266_scrot

Tables in a list require preceding blank line on GitHub

For example, this markdown:

1. Configure the fields as follows:
    | Prompt                     | You enter                                        |
    |----------------------------|:------------------------------------------------:|
    | Application Name           | Whatever you'd like                              |
    | Homepage URL               | http://localhost:12345                           |
    | Application Description    | Whatever you'd like or nothing                   |
    | Authorization callback URL | http://localhost:12345/securityRealm/finishLogin |

is rendered by instant-markdown-d as:

<ol>
    <li>Configure the fields as follows:
        <table>
            <thead>
                <tr><th>Prompt</th><th style="text-align:center">You enter</th></tr>
            </thead>
            <tbody>
                <tr><td>Application Name</td><td style="text-align:center">Whatever you'd like</td></tr>
                <tr><td>Homepage URL</td><td style="text-align:center"><a href="http://localhost:12345">http://localhost:12345</a></td></tr>
                <tr><td>Application Description</td><td style="text-align:center">Whatever you'd like or nothing</td></tr>
                <tr><td>Authorization callback URL</td><td style="text-align:center"><a href="http://localhost:12345/securityRealm/finishLogin">http://localhost:12345/securityRealm/finishLogin</a></td></tr>
            </tbody>
        </table>
    </li>
</ol>

but by GitHub as:

<ol>
<li>Configure the fields as follows:<br>
| Prompt                     | You enter                                        |<br>
|----------------------------|:------------------------------------------------:|<br>
| Application Name           | Whatever you'd like                              |<br>
| Homepage URL               | <a href="http://localhost:12345" rel="nofollow">http://localhost:12345</a>                           |<br>
| Application Description    | Whatever you'd like or nothing                   |<br>
| Authorization callback URL | <a href="http://localhost:12345/securityRealm/finishLogin" rel="nofollow">http://localhost:12345/securityRealm/finishLogin</a> |</li>
</ol>

With an additional empty newline before the table, GitHub will render the table indented with the list item.

Document dependencies

In a new install of Ubuntu 12.04 the command "npm -g install instant-markdown-d" fails with a message:

[email protected] install /usr/local/lib/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
node install.js

[ws v0.4.18] Attempting to compile blazing fast native extensions.
/bin/sh: 1: node-gyp: not found
[ws v0.4.18] Native extension compilation failed.
[ws v0.4.18] On Windows, native extensions require Visual Studio and Python.
[ws v0.4.18] On Unix, native extensions require Python, make and a C++ compiler.
[ws v0.4.18] Start npm with --ws:verbose to show compilation output (if any).
/usr/local/bin/instant-markdown-d -> /usr/local/lib/node_modules/instant-markdown-d/instant-markdown-d
[email protected] /usr/local/lib/node_modules/instant-markdown-d
├── [email protected]
└── [email protected]

I have installed build_essential, g++, python and automake and still get the error. More details on what is needed to install this on the readme would be great.

No data after refreshing view

While using vim-instant-markdown, if I refresh the browser on localhost:8090, no data is shown.

The network status looks like this:

image.png

And the detailed info on the last item is this:

image.png

New release

Will you push a new release to npm? The windows support is appreciated.

I got an error

instant-markdown-d (master)$ echo hello | instant-markdown-d
   info  - socket.io started

/opt/local/lib/node_modules/instant-markdown-d/node_modules/socket.io/lib/manager.js:916
    match = req.url.substr(0, resource.length);
                    ^
RangeError: Maximum call stack size exceeded

AND

[email protected]
[email protected]

$ uname -v
Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64

TESTS!

Have at least some tests running against multiple node versions on CI (edge, LTS, the version of node on Ubuntu LTS, etc) for stability and ease of contribution

npm ERR not a package instant-markdown-d on Windows 7 system

npm ERR! not a package C:\Users\xiaozhu\markdown-d\instant-markdown-d\inst
rkdown-d
npm ERR! addLocal Could not install C:\Users\xiaozhu\markdown-d\instant-ma
-d\instant-markdown-d
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\no
node_modules\npm\bin\npm-cli.js" "-g" "install" "instant-markdown-d"
npm ERR! node v6.9.4
npm ERR! npm v3.10.10
npm ERR! path C:\Users\xiaozhu\AppData\Local\Temp\npm-6112-663754d1\unpack
e2b\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\xiaozhu
a\Local\Temp\npm-6112-663754d1\unpack-960c4e2b\package.json'
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\xiaozhu
a\Local\Temp\npm-6112-663754d1\unpack-960c4e2b\package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\xiaozhu\markdown-d\instant-markdown-d\npm-debug.log

Upgrade from deprecated versions of dependencies

Problem summary

 npm WARN deprecated [email protected]: This package has been archived. MathJax v3 provides equivalent functionality.
npm WARN deprecated [email protected]: use String.prototype.padStart()
npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

Expected

No deprecation warnings

Can't preview mermaid

Problem summary

Can't preview mermaid when I had config my .vimrc with let g:instant_markdown_mermaid = 1

Expected

Environment Information

  • OS:Ubuntu20.04
  • Vim / Neovim version:Vim 8.2
  • Browser:Chrome

Steps to reproduce the issue (required)

Start with command you used to install instant-markdown-d. Use a
minimal.vimrc

to reproduce the issue and open your markdown file as:

vim -u minimal.vimrc my_markdown_file.md

my markdown file test.md:

```mermaid
graph TD
    A-->B
    A-->C
    B-->D
    C-->D
graph LR
    A[Square Rect] -- Link text --> B((Circle))
    A --> C(Round Rect)
    B --> D{Rhombus}
    C --> D
![image](https://user-images.githubusercontent.com/58850527/113016082-b7de4180-91b0-11eb-9a41-c3db348ae225.png)

## Provide the debug output (required)

Run `cat my_markdown_file.md | instant-markdown-d --mathjax --debug`. It
generates a `debug.html` file - attach it here. Also, paste the console output
here:
The sh make my terminal blocked.
It only put the nodejs version then it is blocked




## Screen shot (if possible)


Feature Request: could we ignore the YAML meta block in the markdown?

Problem summary

Hi, there're some markdown editors or github, they require or encourage users to write some liquid tags in the document. For example, we could write author, description, tags, then the static site generate like hugo can extract this kind of info to build a static site.

Sometimes, when we edit the file in vim + instant-markdown-d, when rendering, the liquid tags will be treated like normal text. I think we should ignore this part or render it in some fancy way.

Expected

Ignore the liquid tags or render it in some fancy way.

Example

here's a markdown with liquid tags:

image

it will be rendered like this so far:

image

NPM last version with socket.io v2 = Chrome CORS error (solved in master branch)

Npm last version published does not have socket.io v3 as master, Chrome complains about CORS without it

Expected

Start server will spawn a Chrome instance and the transport layer works properly, showing the markdown rendered.

I just removed the pull request template because using the master branch directly works properly, is it possible to publish master as @next at npm?

If more info needed, no problem, I can get back and share that with you.

instant-markdown-d doesn't parse Header any more

In the other day, the instant-markdown-d works fine. However, it doesn't parse header any more after run npm -g update instant-markdown-d to update to the latest version.

Type echo "###hello" | instant-markdown-d into terminal, the web browser pops up and shows "###hello" exactly instead of parsing it to header 3rd-sized.

[Feature] allow remote access preview

Sometimes I need to use vim on remote machine, under this situation localhost would not work.
Could we auto detect browser's URL instead of fixed localhost?

Live preview is not available

Problem summary

Expected

Live preview is not available with [email protected] .
If I rollback to lower version ,it works very well except that no mathjax support.

Environment Information

  • OS:Linux mint
  • Vim / Neovim version:8.0
  • Browser:Firefox

Provide the output of test command (required)

Run npm test&; sleep 5; npm stop or at least equivalent of
cd tests; cat test_math.md | instant-markdown-d --mathjax --debug and paste the
console output here:

Generate logfiles if appropriate

  1. package-lock.json / yarn.lock
  2. minimal ~/.vimrc or ~/.config/nvim/init.vim where variables for vim-instant-markdown defined
  3. debug.html

Steps to reproduce the issue (required)

Start with command you used to install instant-markdown-d

1.sudo npm install -g [email protected]
2.
3.

Screen shot (if possible)

Remove mathjax-node-page and upgrade to Mathjax v3

Problem summary

Some of the dependencies are deprecated, in particular mathjax-node-page. Installling would display the following deprecation:

npm WARN deprecated [email protected]: This package has been archived. MathJax v3 provides equivalent functionality.

Expected

No deprecation warnings

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.