{"id":16513704,"url":"https://github.com/nitin42/linkify-markdown","last_synced_at":"2025-03-16T19:30:32.769Z","repository":{"id":55531825,"uuid":"122818789","full_name":"nitin42/linkify-markdown","owner":"nitin42","description":"🚀  A cli tool which automatically add references to issues, pull requests, user mentions and forks to a markdown file.","archived":false,"fork":false,"pushed_at":"2020-12-23T15:47:49.000Z","size":121,"stargazers_count":69,"open_issues_count":3,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-27T12:20:57.998Z","etag":null,"topics":["command-line-tool","converter","files","github","markdown"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nitin42.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-25T08:35:01.000Z","updated_at":"2024-09-08T13:34:05.000Z","dependencies_parsed_at":"2022-08-15T02:40:36.817Z","dependency_job_id":null,"html_url":"https://github.com/nitin42/linkify-markdown","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitin42%2Flinkify-markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitin42%2Flinkify-markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitin42%2Flinkify-markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitin42%2Flinkify-markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nitin42","download_url":"https://codeload.github.com/nitin42/linkify-markdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826780,"owners_count":20354220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","converter","files","github","markdown"],"created_at":"2024-10-11T16:09:59.846Z","updated_at":"2025-03-16T19:30:32.437Z","avatar_url":"https://github.com/nitin42.png","language":"JavaScript","readme":"# Linkify markdown\n\n![version](https://img.shields.io/badge/version-1.0.0-brightgreen.svg)\n[![Build Status](https://travis-ci.org/nitin42/linkify-markdown.svg?branch=master)](https://travis-ci.org/nitin42/linkify-markdown)\n\n\u003e ***A cli tool which automatically adds references to issues, pull requests, user mentions and forks to your project markdown file.***\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://gyazo.com/1518fc90b43476098c17ee268f911fce.png\" /\u003e\n\u003c/p\u003e\n\n## Demo\n\n![demo](http://g.recordit.co/ZTPOJp7ouz.gif)\n\n## Install\n\nTo use the cli-tool, install using the following command -\n\n```\nnpm install linkify-markdown -g\n```\n\nTo use this as a package on web -\n\n```\nnpm install linkify-markdown\n```\n\n## Why ?\n\nEasy to add references automatically to:\n\n* **issues** - `#1` or `GH-1`\n\n* **pull requests** - `#4`\n\n* **commits** - `dfaec38da4cd170dd1acce4e4c260f735fe2cfdc`\n\n* **commit comment** - `dfaec38da4cd170dd1acce4e4c260f735fe2cfdc#commitcomment-16345693`\n\n* **issues across forks** - `repo/#1`\n\n* **issues across projects** - `project-org/project/#2`\n\n* **@mentions** - `@nitin42`\n\n## Usage\n\nTo 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:\n\n```json\n{\n  \"repository\": {\n    \"url\": \"your_project_url\"\n  }\n}\n```\n\nor you can also provide the `repository` url through command line options API.\n\n```\nlinkify readme.md --repo \u003crepository_url\u003e\n```\n\n\u003e **Note** - This will overwrite the package.json `url` field.\n\n### Adding references/links to a single markdown file\n\nTo add links or references to a single markdown file, use command\n\n```\nlinkify sample.md\n```\n\nwhere `sample.md` might look like this:\n\n```markdown\n# Heading\n\n@nitin42\n\n@kentcdodds\n\nIssue 1 - #1\n\nIssue 2 - #2\n\nCommit - 609fc19d2fc1d70e43dcaff3311ad4a79f651c9e\n```\n\nRunning the above command will convert this to -\n\n```markdown\n# Heading\n\n[@nitin42](https://github.com/nitin42)\n\n[@kentcdodds](https://github.com/kentcdodds)\n\nIssue 1 - [#1](https://github.com/\u003cusername\u003e/\u003crepo-name\u003e/issues/1)\n\nIssue 2 - [#2](https://github.com/\u003cusername\u003e/\u003crepo-name\u003e/issues/2)\n\nCommit - [`dfaec38`](https://github.com/\u003cusername\u003e/\u003crepo-name\u003e/commit/dfaec38da4cd170dd1acce4e4c260f735fe2cfdc)\n```\n\nNotice 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.\n\n### Adding references/links to multiple files\n\nTo use this tool for multiple files, use this command\n\n```\nlinkify samples/A.md samples/B.md samples/C.md samples/D.md\n```\n\nRunning 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.\n\nThe output will look like this:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://gyazo.com/16fb0cabaf2635afcf3bd71ec3012e7a.png\" /\u003e\n\u003c/p\u003e\n\nThe same is applicable to running the command for a single file i.e if it the file is empty, it will skip processing it.\n\n### Adding references/links to a directory of markdown files\n\nYou can also add links to all the files in a directory. Use this command -\n\n```\nlinkify -d samples/\n```\n\nThis will add links to all the files (except those which are empty or not in markdown format)\n\n### Usage on web\n\nYou will need to install the package locally in your project repo instead of globally installing it in order to use it on web.\n\n```\nnpm install linkify-markdown\n```\n\nHere is an example to use this on web to process a markdown string of code.\n\n```js\nconst { linkify } = require('linkify-markdown')\n\nconst sample = `\n# Sample\n\n@nitin42\n\n@kentcdodds\n\n#1\n\n#2\n\nCommit - dfaec38da4cd170dd1acce4e4c260f735fe2cfdc\n`\n\nconst options = {\n  strong: true,\n  repository: 'https://github.com/nitin42/cli-test-repo'\n}\n\nlinkify(sample, options)\n```\n\nThis will return the output as a string -\n\n```\n# Sample\n\n[**@nitin42**](https://github.com/nitin42)\n\n[**@kentcdodds**](https://github.com/kentcdodds)\n\n[#1](https://github.com/nitin42/cli-test-repo/issues/1)\n\n[#2](https://github.com/nitin42/cli-test-repo/issues/2)\n\nCommit - [`dfaec38`](https://github.com/nitin42/cli-test-repo/commit/dfaec38da4cd170dd1acce4e4c260f735fe2cfdc)\n```\n\n[Learn more about the Web api](#api)\n\n## Messages\n\nThis is a reference section.\n\n* You will get an error if you don't provide a file or directory -\n\n![msg](https://i.gyazo.com/ba53752071db872258fb7453d1dacf91.png)\n\n* You will receive warning for the empty files or directory\n\n![file](https://gyazo.com/34646a73d23b4dbe59beae9ba8765a37.png)\n\n## API\n\n**For a single or multiple files**\n\nCommand - `linkify \u003cfile 1\u003e \u003cfile 2\u003e ... \u003cfile n\u003e options`\n\n**For directory of files**\n\nCommand - `linkify -d \u003cdirectory_name\u003e options`\n\n`options`\n\n* `-s` or `--strong` - Uses strong nodes for `@mentions`.\n\n* `-h` or `--help` - Use this option for help\n\n**For usage on web**\n\n`linkify(markdown_string, [options])`\n\nReturns the processed markdown code as a string.\n\n`options`\n\nAn object with options `strong` and `repository`.\n\n* `strong` (**`Boolean`**) - Uses strong nodes for `@mentions`. Default value is `false`.\n\n* `repository` (**`String`**) - Repository url. If not given, uses `repository` field from `package.json` file.\n\n\n## License\n\nMIT\n\n**If you liked this project, then ⭐ it or either [share it on Twitter](https://twitter.com/NTulswani) or I'd also love to see your contributions or ideas to improve the tool. Thanks!**\n\n**Also, thanks [remarkjs](https://github.com/remarkjs) for providing such productive tools and ideas.**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitin42%2Flinkify-markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnitin42%2Flinkify-markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitin42%2Flinkify-markdown/lists"}