https://github.com/greybax/md-title
https://github.com/greybax/md-title
helper js markdown markdown-article md-article title
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/greybax/md-title
- Owner: greybax
- Created: 2016-06-25T22:26:54.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-04-19T00:59:30.000Z (about 6 years ago)
- Last Synced: 2025-01-15T05:52:49.864Z (5 months ago)
- Topics: helper, js, markdown, markdown-article, md-article, title
- Language: JavaScript
- Size: 18.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# md-title
[](https://greenkeeper.io/)
[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Coveralls Status][coveralls-image]][coveralls-url]
[![Dependency Status][depstat-image]][depstat-url]> get title from markdown article
## Install
npm install --save md-title
## Usage
```js
import getTitle from 'md-title';const input = `
# awesome *heading*# second heading
paragragh`;
getTitle(input).text; // awesome heading
getTitle(input).html; //awesome heading
getTitle(input).node; // mdast node, see remark API
getTitle(''); // undefined
```## API
### getTitle(input)
#### input
*Required*
Type: `String`Markdown string.
## Related
* [md-article][md-article] - extract data from your markdown article
* [md-content][md-content] - get content from markdown article
* [md-date][md-date] - get date from markdown article
* [md-tags][md-tags] - get tags from markdown article## License
MIT © [Aleksandr Filatov](https://alfilatov.com)
[npm-url]: https://npmjs.org/package/md-title
[npm-image]: https://img.shields.io/npm/v/md-title.svg?style=flat-square[travis-url]: https://travis-ci.org/greybax/md-title
[travis-image]: https://img.shields.io/travis/greybax/md-title.svg?style=flat-square[coveralls-url]: https://coveralls.io/r/greybax/md-title
[coveralls-image]: https://img.shields.io/coveralls/greybax/md-title.svg?style=flat-square[depstat-url]: https://david-dm.org/greybax/md-title
[depstat-image]: https://david-dm.org/greybax/md-title.svg?style=flat-square[md-article]: https://github.com/greybax/md-article
[md-content]: https://github.com/greybax/md-content
[md-date]: https://github.com/greybax/md-date
[md-tags]: https://github.com/greybax/md-tags