Live markdown previews for your favorite editor.
- Emojis โจ ๐ ๐
- GitHub flavored clickable headings/permalinks
- GitHub flavored checkboxes
- Real-time instant preview
And more!
$ npm install -g livedown
$ livedown --help
MIT
Live Markdown previews for your favorite editor.
License: MIT License
Live markdown previews for your favorite editor.
And more!
$ npm install -g livedown
$ livedown --help
MIT
Editing and view mode are both useful. Having both available just with a single click would be great.
1ac8ac9
In a Readme.md file you might have a link LICENSE which points to LICENSE
(a file in the root of your project). I suggest we drop this in favor of another static server that serves up the entire directory (this would also handle the image extension case you had built in by default):
+app.use(express.static(path.join(__dirname)))
-app.use(function (req, res, next) {
- if (new RegExp('.' + ImageExtensions.join('|') + '$').test(req.path)) {
- res.sendFile(path.join(filePath, '../' + req.path), sendFileOpts)
- } else {
- next()
- }
-})
Curious if you had thoughts AGAINST this @shime ?
@shime are you down to do a new recording / animated demo gif for the Readme.md
with the latest version? would be your "trial run" ๐
File changes of a file are not recognized. So you have to refresh the browser manually.
When previewing a markdown file, and if a browser instance is already open, a new tab gets attached to it, it would be nice to have the option to open the preview in a new browser instance.
livedown start README.md --open
no longer works with firefox, even with the --browser
option. this was working fine till very recently for me & I see no recent changes on the project - perhaps some OSX or firefox update broke it?
Hello,
A feature request to scroll the page to a particular line number, or percent of the page.
It would be usefull when editing a md file in an editor, the compiled md file on the browser scroll with it.
First of all, thanks for the work on this, I'm using the vim plugin on a daily basis, both professionally and on hobby projects.
As mentioned in #34 and #15, people seem to have a wish for being able to preview markdown with extensions. While I'm personally not really a fan of those, a project I'm working on right now uses a lot of PlantUML for documentation.
I personally dislike having to leave my terminal for something trivial like editing some UML diagrams, so I'd like to have the PlantUML plugin available within Livedown. Hardcoding this here wouldn't make a ton of sense as most people probably won't use this.
I'd be willing to look into creating a PR to allow for plugin support, if that would be appreciated. I'd love to discuss the option here, so please let me know what you think.
Livedown is working well from my emacs client, but this kind of code doesn't render:
<div class="alert alert-warning">
You can use an alert to highlight something you want to stand out.
</div>
Any way to get bootstrap elements rendered?
I'm running
livedown start ./README.md --open --verbose
which opens a new tab in Chrome which appears empty.
The url is
http://localhost:1337/
less ./README.md
displays the content of the file, leading me to believe my file path is correct
In the Chrome developer console, I'm seeing
Failed to load resource: net::ERR_CONNECTION_REFUSED http://localhost/socket.io/?EIO=3&transport=polling&t=1422024891424-0
This error is repeated multiple times.
Hey there, an XSS is present in livedown you can trigger it with
[link](<script>alert(1)</script>)
Hi shime
MacOS 10.13.3
node v9.4.0
npm 5.6.0
When I run this command, sth I don't know happened.
sudo npm install -g livedown
Output:
/usr/local/bin/livedown -> /usr/local/lib/node_modules/livedown/bin/livedown
> [email protected] install /usr/local/lib/node_modules/livedown/node_modules/fsevents
> node install
node-pre-gyp ERR! Tried to download(undefined): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v59-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v59 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! clean error
gyp ERR! stack Error: EACCES: permission denied, rmdir 'build'
gyp ERR! System Darwin 17.4.0
gyp ERR! command "/usr/local/Cellar/node/9.4.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "clean"
gyp ERR! cwd /usr/local/lib/node_modules/livedown/node_modules/fsevents
gyp ERR! node -v v9.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/9.4.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js clean' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/livedown/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:160:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:943:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
node-pre-gyp ERR! System Darwin 17.4.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/9.4.0/bin/node" "/usr/local/lib/node_modules/livedown/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/livedown/node_modules/fsevents
node-pre-gyp ERR! node -v v9.4.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node/9.4.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js clean' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/livedown/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
+ [email protected]
updated 1 package in 20.309s
Please help~
A link to a document [here](file:///Users/hortense/somefile.html)
is rendering by livedown as:
[here](file:///Users/hortense/somefile.html)
On the other hand a link like this [this here link](html://example.com)
is rendered correctly as a link: this here link
The same problem occurs with reference-style links
It doesn't appear to correctly include images. Here's how to minimally reproduce.
index.markdown:
#image test
![alt text](test.png)
test.png a valid image in the same directory
run with:
livedown start index.markdown --open
error:
TypeError: path must be absolute or specify root to res.sendFile
at ServerResponse.sendFile (/usr/local/lib/node_modules/livedown/node_modules/express/lib/response.js:389:11)
at /usr/local/lib/node_modules/livedown/server.js:73:11
at Layer.handle [as handle_request] (/usr/local/lib/node_modules/livedown/node_modules/express/lib/router/layer.js:82:5)
at trim_prefix (/usr/local/lib/node_modules/livedown/node_modules/express/lib/router/index.js:271:13)
at /usr/local/lib/node_modules/livedown/node_modules/express/lib/router/index.js:238:9
at Function.proto.process_params (/usr/local/lib/node_modules/livedown/node_modules/express/lib/router/index.js:313:12)
at /usr/local/lib/node_modules/livedown/node_modules/express/lib/router/index.js:229:12
at Function.match_layer (/usr/local/lib/node_modules/livedown/node_modules/express/lib/router/index.js:296:3)
at next (/usr/local/lib/node_modules/livedown/node_modules/express/lib/router/index.js:190:10)
at SendStream.error (/usr/local/lib/node_modules/livedown/node_modules/express/node_modules/serve-static/index.js:103:7)
I'm on:
livedown start <path> --open --verbose
[livedown] markdowning started on http://localhost:1337
That displays the markdown file correctly in my browser, but file changes produce no further output on the command line or updates in the browser.
I realize the intended goal of this plugin is to preview Markdown, and that you can easily open HTML files in your browser through Vim with a shell command, but it would be nice to have it incorporated for convenience and also so that HTML is updated on file save (and also so that I can use Vimium while previewing the file through Chrome.) It shouldn't be difficult to incorporate, so I guess the issue is whether it would be within the scope of this plugin. I see that other Markdown plugins have done the same, I just prefer this one.
Not sure why, but I had to symlink mkd
to markdown
before this started working for me, using pathogen with macvim and tpope's vim-markdown. Is it worth adding a markdown
symlink pointing to mkd
?
livedown is awesome!
In my screen, I have a lots of markdown files in same directory, the file struct below:
README.md
docs/
readme.md
foo.md
I expect livedown should works with the experience:
livedown start --open
or livedown --open
is same with livedown start . --open
http://localhost:{port}
rendering README.md
by default browserdocs/foo.md
by url http://localhost:{port}/docs/foo.md
docs/readme.md
by url http://localhost:{port}/docs/
too.livedown support a single markdown file now, I'd like to PR.
After installing livedown with
npm install -g livedown
and trying to start a preview with
livedown start README.md --open
I'm getting:
/Users/hrvoje/.nvm/versions/node/v7.3.0/lib/node_modules/livedown/node_modules/markdown-it-github-headings/index.js:73
return Object.assign(new TokenConstructor(), token, {content: token.markup})
^
TypeError: TokenConstructor is not a constructor
at unemoji (/Users/hrvoje/.nvm/versions/node/v7.3.0/lib/node_modules/livedown/node_modules/markdown-it-github-headings/index.js:73:26)
at Array.map (native)
at Object.md.renderer.rules.heading_open (/Users/hrvoje/.nvm/versions/node/v7.3.0/lib/node_modules/livedown/node_modules/markdown-it-github-headings/index.js:40:56)
at Renderer.render (/Users/hrvoje/.nvm/versions/node/v7.3.0/lib/node_modules/livedown/node_modules/markdown-it/lib/renderer.js:326:38)
at MarkdownIt.render (/Users/hrvoje/.nvm/versions/node/v7.3.0/lib/node_modules/livedown/node_modules/markdown-it/lib/index.js:543:24)
at /Users/hrvoje/.nvm/versions/node/v7.3.0/lib/node_modules/livedown/server.js:89:36
at tryToString (fs.js:425:3)
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:412:12)
It looks like the issue with markdown-it-github-headings
. @niftylettuce?
I'm inside a heinous corporate firewall.
I get the following output when attempting to install this module:
npm install -g livedown
npm WARN optional dep failed, continuing [email protected]
> [email protected] install /home/ME/.npm-packages/lib/node_modules/livedown/node_modules/socket.io/node_modules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
npm ERR! git clone [email protected]:rase-/node-XMLHttpRequest Cloning into bare repository '/home/solnet/.npm/_git-remotes/git-github-com-rase-node-XMLHttpRequest-01a5ec93'...
npm ERR! git clone [email protected]:rase-/node-XMLHttpRequest ssh: connect to host github.com port 22: Connection timed out
npm ERR! git clone [email protected]:rase-/node-XMLHttpRequest fatal: Could not read from remote repository.
npm ERR! git clone [email protected]:rase-/node-XMLHttpRequest
npm ERR! git clone [email protected]:rase-/node-XMLHttpRequest Please make sure you have the correct access rights
npm ERR! git clone [email protected]:rase-/node-XMLHttpRequest and the repository exists.
npm ERR! notarget No compatible version found: xmlhttprequest@'rase-/node-XMLHttpRequest#a6b6f2'
npm ERR! notarget Valid install targets:
npm ERR! notarget ["1.0.0","1.2.0","1.2.1","1.2.2","1.3.0","1.4.0","1.4.2","1.5.0","1.6.0","1.7.0"]
npm ERR! notarget
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! System Linux 3.16.6-2-desktop
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "livedown"
npm ERR! cwd /home/solnet
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! code ETARGET
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ME/npm-debug.log
npm ERR! not ok code 0
The plugin does not work well when there are spaces in the file name, and the path reading will fail.For example, if the file name is ''Preview File.md",then the llivedown plugin could not recognize the file name correctly, it has read the "./Preview",without the "File.md"
I wonder it is possible to use livedown with Restructured text.
@shime Thoughts on adding support for relative links to other markdown files in the same base directory?
The npm module (livedown) uses highlight.js for code highlighting with default options. For a standard README.md I just opened, it thought some Python code blocks were alternatively nginx or bash, because they were very short, thus did wrong syntax highlighting. You probably want to turn off language auto-detection. You can do this by doing:
hljs.configure({languages: []})
before calling hljs.highlightBlock()
. HTH. Originally reported on HN.
Homewbrew is a solution that most mac developers use to install libraries/packages/binaries. It would be really nice if we could also install livedown using Homebrew vs npm.
Hello Shime
I'm using your vim-livedown and livedown to preview md files.
Recently I got a problem.
I found the command "livedown stop" doesn't stop the livedown process.
Some version infomation.
MacOS 10.13.3
Darwin mbp 17.4.0 Darwin Kernel Version 17.4.0
Node: v9.4.0
livedown: 2.1.1
Thanks.
would be neat - just export the whole thing into one single html-file so I don't need other markdown-converter aside from livedown
thanks for the consideration
In my Ubuntu 14.04 the shebang line
#!/usr/bin/env node
does not work. What works is
#!/usr/bin/env nodejs
When using MathJax via
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default"></script>
the equations are not rerendered.
Do you have any recommendation for that?
The problem can be seen in this example:
https://raw.githubusercontent.com/oplatek/lxmls-toolkit/lecture_notes/lecture_notes/7-16-01morning-session.md
Hey @shime
Could you please publish version 1.0.7
on npm?
thanks.
I have a small nuisance of an issue. I use livedown with vim-livedown on Ubuntu 14.04. I have version 1.0.8 installed. Though livedown opens on my Markdown file fine and shows it in a browser window, it only live-refreshes the browser window upon the first change to the file. Every change after the first does not live-refresh the browser, but instead requires me to refresh my browser window. That said, once manually refreshed, the changes on-disk are reflected. Let me know if there is any way I can provide more debugging information for this.
Hello,
Markdeep ( https://casual-effects.com/markdeep/ ) is allow to use markdown with advance feature, notably the integration of Latex paragraphs.
Would it be possible to integrate it with livedown?
highlight.min.js
(everything in /vendor
really) is 2 years old which means there is no syntax highlighting for Rust and many other languages.
I start livedown as livedown start PATH
and stop as livedown stop
, but the server isn't stopped. Even when using verbose the there is no error shown. I have to either do ctrl+c on livedown start PATH
or kill using process id. This is a problem when using livedown vim plugin as I cannot do ctrl+c. For vim :livedownKill
does nothing just as livedown stop
.
PS: Thanks for the awesome application.
Is there a way to force the page to refresh?
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.