Git Product home page Git Product logo

urls-md's Introduction

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)

Install

$ npm install --save urls-md

Usage

const urslMd = require('urls-md');

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

API

urlsMd(input)

input

Type: string

Text to extract markdown links and images from.

CLI

$ npm install --global urls-md
$ urls-md --help

  Usage
    urls-md <file>
    cat <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 }

License

MIT © Sindre Sorhus

urls-md's People

Contributors

sindresorhus avatar kevva avatar desmondmorris avatar samverschueren avatar hemanth avatar

Watchers

James Cloos avatar  avatar

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.