{"id":15130906,"url":"https://github.com/greybax/md-article","last_synced_at":"2026-01-20T01:04:56.723Z","repository":{"id":56638539,"uuid":"61265094","full_name":"greybax/md-article","owner":"greybax","description":"Extract data from markdown article","archived":false,"fork":false,"pushed_at":"2020-10-27T17:50:49.000Z","size":16,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T17:13:52.734Z","etag":null,"topics":["article","helper","js","markdown","markdown-article","markdown-parser","md-article","mdast"],"latest_commit_sha":null,"homepage":null,"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/greybax.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":"2016-06-16T05:36:42.000Z","updated_at":"2020-10-27T17:50:49.000Z","dependencies_parsed_at":"2022-08-15T22:20:49.557Z","dependency_job_id":null,"html_url":"https://github.com/greybax/md-article","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greybax%2Fmd-article","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greybax%2Fmd-article/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greybax%2Fmd-article/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greybax%2Fmd-article/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greybax","download_url":"https://codeload.github.com/greybax/md-article/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246996915,"owners_count":20866684,"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":["article","helper","js","markdown","markdown-article","markdown-parser","md-article","mdast"],"created_at":"2024-09-26T03:08:22.478Z","updated_at":"2026-01-20T01:04:56.688Z","avatar_url":"https://github.com/greybax.png","language":"JavaScript","readme":"# md-article\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/greybax/md-article.svg)](https://greenkeeper.io/)\n\n[![NPM version][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Coveralls Status][coveralls-image]][coveralls-url]\n[![Dependency Status][depstat-image]][depstat-url]\n\n\u003e Extract data from your markdown article\n\n## Install\n\n    npm install --save md-article\n\n## Usage\n\n```js\nimport extract from 'md-article';\n\nconst input = `\n# title\n\n_24 june 2016_\n\n#tag1 #tag2 #tag3;\n\ndesc\n\ncontent1\n\ncontent2`;\n\nconst article = extract(input, 'D MMMM YYYY', 'en');\narticle.title.text;    // title\narticle.date.text;     // 24 june 2016\narticle.tags.text;     // tag1 tag2 tag3\narticle.content.html;  // \u003cp\u003edesc\u003c/p\u003e\n                       // \u003cp\u003econtent1\u003c/p\u003e\n                       // \u003cp\u003econtent2\u003c/p\u003e\n```\n\n## API\n\n### extract(input, dateFormat, dateLocale)\n\nReturn object `{ title, date, tags, content }`.\n\nI hope that all fields have self-explanatory names. \nAnyway, `tags` and `content` should be explained further: `desc` — paragrapgh with elements like ```#tag1 #tag2;```, `content` input without title, tags and date.  All the fields are objects with such fields:\n\n* title, content: `text` and `html`\n* tags: `list`, `text` and `html`\n* date: `text`, `html`, `unix` and `moment`\n\nAlso everything in returned ```mdast``` object node, see [MDAST][mdast].\n\n[mdast]: https://github.com/wooorm/mdast\n\n#### input\n\n*Required*  \nType: `String`\n\nMarkdown string.\n\n#### dateFormat\n\n*Required*  \nType: `String`\n\nMomentjs [format][format] for date, e.g. `D MMMM YYYY`.\n\n[format]: http://momentjs.com/docs/#/displaying/format/\n\n#### dateLocale\n\n*Required*  \nType: `String`\n\nOne of 83 available in momentjs [locales][i18n], e.g. `en` or `fr`.\n\n[i18n]: http://momentjs.com/docs/#/i18n/\n\n## Related\n\n* [md-title][md-title] — get title from markdown article\n* [md-date][md-date] — get date from markdown article\n* [md-tags][md-tags] — get tags from markdown article\n* [md-content][md-content] — get content from markdown article\n\n## Roadmap\n\n- [x] ```remark``` instead of ```commonmark``` for all markdown helpers\n\n## License\n\nMIT © [Aleksandr Filatov](https://alfilatov.com/)\n\n[npm-url]: https://npmjs.org/package/md-article\n[npm-image]: https://img.shields.io/npm/v/md-article.svg?style=flat-square\n\n[travis-url]: https://travis-ci.org/greybax/md-article\n[travis-image]: https://img.shields.io/travis/greybax/md-article/master.svg?style=flat-square\n\n[coveralls-url]: https://coveralls.io/r/greybax/md-article\n[coveralls-image]: https://img.shields.io/coveralls/greybax/md-article/master.svg?style=flat-square\n\n[depstat-url]: https://david-dm.org/greybax/md-article\n[depstat-image]: https://david-dm.org/greybax/md-article.svg?style=flat-square\n\n\n[md-title]: https://github.com/greybax/md-title\n[md-date]: https://github.com/greybax/md-date\n[md-tags]: https://github.com/greybax/md-tags\n[md-content]: https://github.com/greybax/md-content","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreybax%2Fmd-article","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreybax%2Fmd-article","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreybax%2Fmd-article/lists"}