Giter Club home page Giter Club logo

livedown's Introduction

livedown's People

Contributors

delapouite avatar hcgatewood avatar joaosa avatar kocakosm avatar machinekoder avatar niftylettuce avatar r0xsh avatar shime avatar wendorf 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

livedown's Issues

Can't install if port 22 is blocked

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

highlight.js outdated

highlight.min.js (everything in /vendor really) is 2 years old which means there is no syntax highlighting for Rust and many other languages.

livedown stop not working

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

This is my demo screenshot.
livedown_stop_not_working_test

Thanks.

TypeError: TokenConstructor is not a constructor

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?

Livedown doesn't recognize links to file urls

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

live updates not working on firefox

I'm on:

  • OSX 10.14.4
  • livedown 2.1.1
  • npm 6.9.0
  • node 11.13.0
  • firefox 66.0.2
  • chrome 73.0.3683.86
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.

Browser Window Opens but No Content

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/

Sanity Check

less ./README.md displays the content of the file, leading me to believe my file path is correct

Setup

  • Chrome 39.0
  • OS X 10.9.5

Console Errors

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.

New recording

@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" ๐Ÿ‘

hljs (Highlight.js) language detection should be disabled

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.

"livedown stop" is not working

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.

Add support for previewing HTML?

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.

livedown doesn't detect / refresh changes after first file update

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.

including images doesn't work

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)

Proposal to add functionality to view files

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 ?

no longer opens Firefox

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?

Consider adding after/ftplugin/markdown symlink

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?

Using the backtick syntax results in wrong Markdown rendering

If you use the simple in-line backtick format, e.g. some_function(your_data), it does not render as in-line code in the livedown CSS sheet. See this example screenshot:

livedown_css_bug

I suspect this is because it's being converted into a <code> element which is always being set on its own lines and such.

Bootstrap call from emacs

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?

install ERR

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~

Allow markdown-it plugins

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.

Propose: support directory as path

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:

  1. Run livedown start --open or livedown --open is same with livedown start . --open
  2. Open http://localhost:{port} rendering README.md by default browser
  3. I could preview and live edit docs/foo.md by url http://localhost:{port}/docs/foo.md
    • I could preview and live edit docs/readme.md by url http://localhost:{port}/docs/ too.

livedown support a single markdown file now, I'd like to PR.

XSS

Hey there, an XSS is present in livedown you can trigger it with

[link](<script>alert(1)</script>)

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.