• Unwatch
  • Fork

public / urls-md Octocat-spinner-32

Convert URLs to Markdown links: Extracts URLs from text → Gets their article title → Creates Markdown links

Edit
or cancel
branch: master
Octocat-spinner-32 .editorconfig init
Octocat-spinner-32 .gitattributes init
Octocat-spinner-32 .gitignore init
Octocat-spinner-32 .jshintrc init
Octocat-spinner-32 .travis.yml init
Octocat-spinner-32 cli.js init
Octocat-spinner-32 fixture.txt Adds image url support. Fixes #1
Octocat-spinner-32 index.js improve error handling - fixes #3
Octocat-spinner-32 package.json 0.2.1
Octocat-spinner-32 readme.md Update readme.md
Octocat-spinner-32 test.js improve error handling - fixes #3
readme.md

urls-md Build Status

Convert URLs to Markdown links and images

Extracts URLs from textGets their article title → Creates Markdown links and images

Useful for when you have a linkdump and want them in Markdown.

From
Lorem ipsum dolor sit amet
http://updates.html5rocks.com/2014/01/Yo-Polymer-A-Whirlwind-Tour-Of-Web-Component-Tooling
Magnis dis parturient montes.
Lorem http://codelittle.com/tag/yeoman/
https://github.global.ssl.fastly.net/images/modules/logos_page/GitHub-Mark.png
To
[Yo Polymer – A Whirlwind Tour Of Web Component Tooling](http://updates.html5rocks.com/2014/01/Yo-Polymer-A-Whirlwind-Tour-Of-Web-Component-Tooling)

[How To Use Yeoman](http://codelittle.com/tag/yeoman/)

![](https://github.global.ssl.fastly.net/images/modules/logos_page/GitHub-Mark.png)

CLI

Install

npm install --global urls-md

Usage

$ urls-md --help

urls-md <input-file>
or
cat <input-file> | urls-md

You can also easily run through multiple files using shell scripting. In this example using ZSH syntax:

# loops through all .txt files in the current directory and outputs the converted files with .md extension
for f (*.txt) { urls-md $f > $f.md }

API

Install

npm install --save urls-md

Usage

urlsMd('Lorem ipsum http://codelittle.com/tag/yeoman/', function (err, data) {
    console.log(data);
    //=>  ['[How To Use Yeoman](http://codelittle.com/tag/yeoman/)']
});

License

MIT © Sindre Sorhus

Something went wrong with that request. Please try again.