All Projects → nitin42 → Linkify Markdown

nitin42 / Linkify Markdown

🚀 A cli tool which automatically add references to issues, pull requests, user mentions and forks to a markdown file.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Linkify Markdown

json2xml
json to xml converter in python3
Stars: ✭ 76 (+13.43%)
Mutual labels:  converter, command-line-tool
Remarshal
Convert between CBOR, JSON, MessagePack, TOML, and YAML
Stars: ✭ 421 (+528.36%)
Mutual labels:  command-line-tool, converter
Nomino
Batch rename utility for developers
Stars: ✭ 282 (+320.9%)
Mutual labels:  command-line-tool, files
Kepubify
Fast, standalone EPUB to KEPUB converter CLI app / library (and a few other utilities).
Stars: ✭ 225 (+235.82%)
Mutual labels:  command-line-tool, converter
Ox Hugo
A carefully crafted Org exporter back-end for Hugo
Stars: ✭ 591 (+782.09%)
Mutual labels:  markdown, converter
Hyde
Call of Duty XAsset compiler that transforms raw assets into digestible data.
Stars: ✭ 15 (-77.61%)
Mutual labels:  files, converter
Breakdance
It's time for your markup to get down! HTML to markdown converter. Breakdance is a highly pluggable, flexible and easy to use.
Stars: ✭ 418 (+523.88%)
Mutual labels:  markdown, converter
Markdown Pdf
📄 Markdown to PDF converter
Stars: ✭ 2,365 (+3429.85%)
Mutual labels:  markdown, converter
Pandoc
Universal markup converter
Stars: ✭ 24,250 (+36094.03%)
Mutual labels:  markdown, converter
Mdpdf
Markdown to PDF command line app with support for stylesheets
Stars: ✭ 512 (+664.18%)
Mutual labels:  markdown, converter
Notes Cli
Small markdown note taking CLI app playing nicely with your favorite editor and other CLI tools
Stars: ✭ 122 (+82.09%)
Mutual labels:  command-line-tool, markdown
Mybox
Easy tools of document, image, file, network, location, color, and media.
Stars: ✭ 45 (-32.84%)
Mutual labels:  markdown, converter
Github Files Fetcher
Download a specific folder or file from a GitHub repo through command line
Stars: ✭ 73 (+8.96%)
Mutual labels:  command-line-tool, files
diskusage
FANTASTIC SPEED utility to find out top largest folders/files on the disk.
Stars: ✭ 64 (-4.48%)
Mutual labels:  files, command-line-tool
Evernote2md
Convert Evernote .enex files to Markdown
Stars: ✭ 193 (+188.06%)
Mutual labels:  markdown, converter
Sourcedocs
Generate Markdown documentation from source code
Stars: ✭ 286 (+326.87%)
Mutual labels:  command-line-tool, markdown
Showdown
A bidirectional Markdown to HTML to Markdown converter written in Javascript
Stars: ✭ 12,137 (+18014.93%)
Mutual labels:  markdown, converter
Yarle
Yarle - The ultimate converter of Evernote notes to Markdown
Stars: ✭ 170 (+153.73%)
Mutual labels:  markdown, converter
K2tf
Kubernetes YAML to Terraform HCL converter
Stars: ✭ 477 (+611.94%)
Mutual labels:  command-line-tool, converter
Online Markdown
A online markdown converter specially for Wechat Public formatting.
Stars: ✭ 812 (+1111.94%)
Mutual labels:  markdown, converter

Linkify markdown

version Build Status

A cli tool which automatically adds references to issues, pull requests, user mentions and forks to your project markdown file.

Demo

demo

Install

To use the cli-tool, install using the following command -

npm install linkify-markdown -g

To use this as a package on web -

npm install linkify-markdown

Why ?

Easy to add references automatically to:

  • issues - #1 or GH-1

  • pull requests - #4

  • commits - dfaec38da4cd170dd1acce4e4c260f735fe2cfdc

  • commit comment - dfaec38da4cd170dd1acce4e4c260f735fe2cfdc#commitcomment-16345693

  • issues across forks - repo/#1

  • issues across projects - project-org/project/#2

  • @mentions - @nitin42

Usage

To use this tool, you will need to add a repository relative to which references will be added. To add a repository, you can add these fields to your package.json file:

{
  "repository": {
    "url": "your_project_url"
  }
}

or you can also provide the repository url through command line options API.

linkify readme.md --repo <repository_url>

Note - This will overwrite the package.json url field.

Adding references/links to a single markdown file

To add links or references to a single markdown file, use command

linkify sample.md

where sample.md might look like this:

# Heading

@nitin42

@kentcdodds

Issue 1 - #1

Issue 2 - #2

Commit - 609fc19d2fc1d70e43dcaff3311ad4a79f651c9e

Running the above command will convert this to -

# Heading

[@nitin42](https://github.com/nitin42)

[@kentcdodds](https://github.com/kentcdodds)

Issue 1 - [#1](https://github.com/<username>/<repo-name>/issues/1)

Issue 2 - [#2](https://github.com/<username>/<repo-name>/issues/2)

Commit - [`dfaec38`](https://github.com/<username>/<repo-name>/commit/dfaec38da4cd170dd1acce4e4c260f735fe2cfdc)

Notice one thing that we haven't passed the option --repo to provide the repository url so running this command assumes that you have added the repository field in your package.json file.

Adding references/links to multiple files

To use this tool for multiple files, use this command

linkify samples/A.md samples/B.md samples/C.md samples/D.md

Running the above command will convert only those files which are either in markdown format or if they are not empty. If they are empty or not in markdown format, the tool will skip processing those files.

The output will look like this:

The same is applicable to running the command for a single file i.e if it the file is empty, it will skip processing it.

Adding references/links to a directory of markdown files

You can also add links to all the files in a directory. Use this command -

linkify -d samples/

This will add links to all the files (except those which are empty or not in markdown format)

Usage on web

You will need to install the package locally in your project repo instead of globally installing it in order to use it on web.

npm install linkify-markdown

Here is an example to use this on web to process a markdown string of code.

const { linkify } = require('linkify-markdown')

const sample = `
# Sample

@nitin42

@kentcdodds

#1

#2

Commit - dfaec38da4cd170dd1acce4e4c260f735fe2cfdc
`

const options = {
  strong: true,
  repository: 'https://github.com/nitin42/cli-test-repo'
}

linkify(sample, options)

This will return the output as a string -

# Sample

[**@nitin42**](https://github.com/nitin42)

[**@kentcdodds**](https://github.com/kentcdodds)

[#1](https://github.com/nitin42/cli-test-repo/issues/1)

[#2](https://github.com/nitin42/cli-test-repo/issues/2)

Commit - [`dfaec38`](https://github.com/nitin42/cli-test-repo/commit/dfaec38da4cd170dd1acce4e4c260f735fe2cfdc)

Learn more about the Web api

Messages

This is a reference section.

  • You will get an error if you don't provide a file or directory -

msg

  • You will receive warning for the empty files or directory

file

API

For a single or multiple files

Command - linkify <file 1> <file 2> ... <file n> options

For directory of files

Command - linkify -d <directory_name> options

options

  • -s or --strong - Uses strong nodes for @mentions.

  • -h or --help - Use this option for help

For usage on web

linkify(markdown_string, [options])

Returns the processed markdown code as a string.

options

An object with options strong and repository.

  • strong (Boolean) - Uses strong nodes for @mentions. Default value is false.

  • repository (String) - Repository url. If not given, uses repository field from package.json file.

License

MIT

If you liked this project, then ⭐ it or either share it on Twitter or I'd also love to see your contributions or ideas to improve the tool. Thanks!

Also, thanks remarkjs for providing such productive tools and ideas.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].