Functional TOC

This commit is contained in:
Tom Moor
2017-10-15 19:21:47 -07:00
parent 53d9e221a5
commit 5f4b5f6d33
5 changed files with 103 additions and 32 deletions

View File

@ -0,0 +1,8 @@
// @flow
import { escape } from 'lodash';
import slug from 'slug';
export default function headingToSlug(heading: string, title: string) {
const level = heading.replace('heading', 'h');
return escape(`${level}-${slug(title)}`);
}