{"id":18019980,"url":"https://github.com/macedigital/angular-markdown-it","last_synced_at":"2025-03-26T20:31:38.378Z","repository":{"id":57178712,"uuid":"43183005","full_name":"macedigital/angular-markdown-it","owner":"macedigital","description":"Angular 1.x directive for rendering markdown with markdown-it.","archived":false,"fork":false,"pushed_at":"2020-02-13T18:13:26.000Z","size":86,"stargazers_count":5,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T11:24:29.128Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/macedigital.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-26T00:41:40.000Z","updated_at":"2022-09-22T11:32:28.000Z","dependencies_parsed_at":"2022-09-09T17:30:21.697Z","dependency_job_id":null,"html_url":"https://github.com/macedigital/angular-markdown-it","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macedigital%2Fangular-markdown-it","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macedigital%2Fangular-markdown-it/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macedigital%2Fangular-markdown-it/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macedigital%2Fangular-markdown-it/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/macedigital","download_url":"https://codeload.github.com/macedigital/angular-markdown-it/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245731514,"owners_count":20663200,"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":[],"created_at":"2024-10-30T05:13:16.650Z","updated_at":"2025-03-26T20:31:36.116Z","avatar_url":"https://github.com/macedigital.png","language":"JavaScript","readme":"![Bower version][bower-image]\n![NPM version][npm-image]\n![Dev Dependencies][david-dev]\n![Peer Dependencies][david-peer]\n[![Build Status][ci-image]][ci-url]\n[![Code Coverage status][codecov-image]][codecov-url]\n\n# angular-markdown-it\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/macedigital/angular-markdown-it.svg)](https://greenkeeper.io/)\n\n\u003e [Angular 1.x](https://angularjs.org) directive for rendering markdown with [markdown-it](https://github.com/markdown-it/markdown-it). This directive is based on @btford's [markdown directive](https://github.com/btford/angular-markdown-directive).\n\n## Getting started\n\n### Quick start\n\nPick one of these options:\n\n- [Download latest release](https://github.com/macedigital/angular-markdown-it/archive/master.zip)\n- Clone the repository `git clone https://github.com/macedigital/angular-markdown-it.git`\n- Install with [NPM](https://npmjs.org/) `npm install angular-markdown-it`\n- Install with [Bower](http://bower.io/) `bower install angular-markdown-it`\n\n### Installation\n\nYou'll need to load `angular`, `angular-sanitize`, and `markdown-it` in your markup like in the example below (assuming you installed via `npm`).\n\n````html\n\u003chtml ng-app=\"myapp\"\u003e\n  \u003chead\u003e\n    \u003c!-- ... --\u003e\n    \u003cscript src=\"node_modules/angular/angular.min.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"node_modules/angular-sanitize/angular-sanitize.min.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"node_modules/markdown-it/dist/markdown-it.min.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"node_modules/angular-markdown-it/dist/ng-markdownit.min.js\"\u003e\u003c/script\u003e\n    \u003c!-- ... --\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003c!-- ... --\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n````\n\nSince release 0.5 it is possible to lazy-load the `markdown-it` dependency. Just make sure it is available before a markdown-it directive is first called.\n\nIf you like *browserify*, you could include this snippet into your `entry.js` file instead.\n\n```js\nrequire('angular');\nrequire('angular-sanitize');\nglobal.markdownit = require('markdown-it');\nrequire('angular-markdown-it');\n\nangular.module('myapp', ['mdMarkdownIt']);\n```\n\n## Usage\n\nInclude the `markdown-it` directive in your templates:\n\n````html\n\u003cmarkdown-it\u003e\n# Hey there!\n*It works!*\n\u003c/markdown-it\u003e\n````\n\nYou can also bind the markdown input to a scope variable:\n\n````html\n\u003cdiv markdown-it=\"markdown\"\u003e\u003c/div\u003e\n\u003c!-- Uses $scope.markdown --\u003e\n````\n\nOr, you include a markdown file:\n\n````html\n\u003cdiv markdown-it ng-include=\"'README.md'\"\u003e\u003c/div\u003e\n\u003c!-- Uses content from README.md --\u003e\n````\n\n## Configuration\n\nBy default, nothing has to be configured. All markdown will be rendered similar to [GFM](https://help.github.com/categories/writing-on-github/), but without HTML, typographer \u0026 autolinker features.\n\nNonetheless, there are two methods for changing behavior, which can be combined:\n\n### Changing options\n\nYou can pass in custom options to the `markdownItConverterProvider` by choosing a preset, and/or custom settings calling the `config()` method.\n\n````js\nangular.module('myapp', ['ngSanitize', 'mdMarkdownIt'])\n  .config(['markdownItConverterProvider', function(markdownItConverter) {\n      markdownItConverter.config('commonmark', {\n        breaks: true,\n        html: true\n      });\n  }])\n````\n\nIn above example, we'll use [CommonMark](http://commonmark.org/) mode, render line-breaks as `\u003cbr\u003e` tags, and enable HTML tags in the source.\n\nSee [markdown-it presets and options](https://github.com/markdown-it/markdown-it#init-with-presets-and-options) for all possible variations.\n\n### Using plugins\n\nAdding plugins is supported by calling the `use()` method.\n\nEach plugin must be added individually, but you can use method-chaining to simplify the process. The signature of `use()` mimicks the way how you would add plugins to vanilla `markdown-it`.  \n\n````js\nangular.module('myapp', ['ngSanitize', 'mdMarkdownIt'])\n  .config(['markdownItConverterProvider', function(markdownItConverter) {\n      markdownItConverter\n        .use(plugin1)\n        .use(plugin2, opts, ...)\n        .use(plugin3)\n      ;\n  }])\n````\n\nThere are many [markdown-it plugins](https://www.npmjs.org/browse/keyword/markdown-it-plugin) available.\n\n## License\n\nMIT\n\n[npm-image]:https://img.shields.io/npm/v/angular-markdown-it.svg?style=flat\n[bower-image]:https://img.shields.io/bower/v/angular-markdown-it.svg?style=flat\n[ci-image]: https://travis-ci.org/macedigital/angular-markdown-it.svg?style=flat\n[ci-url]: https://travis-ci.org/macedigital/angular-markdown-it\n[david-dev]:https://img.shields.io/david/dev/macedigital/angular-markdown-it.svg?style=flat\n[david-peer]:https://img.shields.io/david/peer/macedigital/angular-markdown-it.svg?style=flat\n[codecov-image]:https://img.shields.io/codecov/c/github/macedigital/angular-markdown-it.svg?style=flat\n[codecov-url]:https://codecov.io/github/macedigital/angular-markdown-it\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacedigital%2Fangular-markdown-it","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacedigital%2Fangular-markdown-it","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacedigital%2Fangular-markdown-it/lists"}