3.1.10 • Published 1 month ago

remark-conventional-commit-changelog-timeline v3.1.10

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

Install

This package is not pure ESM, you can require it.

npm i remark-conventional-commit-changelog-timeline

Quick Take

import { strict as assert } from "assert";
import { unified } from "unified";
import remarkParse from "remark-parse";
import remarkRehype from "remark-rehype";
import remarkGfm from "remark-gfm";
import rehypeFormat from "rehype-format";
import rehypeStringify from "rehype-stringify";

import c from "remark-conventional-commit-changelog-timeline";

function render(str, opts) {
  let res = unified()
    .data("settings", { fragment: true })
    .use(remarkParse)
    .use(remarkGfm)
    .use(remarkRehype)
    .use(c, opts)
    .use(rehypeFormat)
    .use(rehypeStringify)
    .processSync(str);

  return res.value;
}

let input = `
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# 3.1.0 (2022-08-12)

### Features

- abc
- xyz
`;

let expected = `
<h2>3.1.0</h2>
<div class="release-date">Aug 12, <span>2022</span></div>
<h3><span class="emoji">✨</span> Features</h3>
<ul>
  <li>abc</li>
  <li>xyz</li>
</ul>
`;

assert.equal(
  render(input, {
    // defaults:
    dateDivLocale: "en-US",
    // eslint-disable-next-line no-unused-vars
    dateDivMarkup: ({ date, year, month, day }) =>
      `${month} ${day}, <span>${year}</span>`,
  }),
  expected,
);

Documentation

Please visit codsen.com for a full description of the API.

Contributing

To report bugs or request features or assistance, raise an issue on GitHub.

Licence

MIT License.

Copyright © 2010-2024 Roy Revelt and other contributors.

3.1.10

1 month ago

3.1.9

3 months ago

3.1.8

4 months ago

3.1.7

5 months ago

3.1.6

7 months ago

3.1.5

7 months ago

3.1.4

8 months ago

3.1.3

8 months ago

3.1.2

10 months ago

3.1.1

11 months ago

3.1.0

12 months ago

3.0.10

1 year ago

3.0.8

1 year ago

3.0.7

1 year ago

3.0.9

1 year ago

3.0.6

1 year ago

3.0.5

1 year ago

3.0.4

1 year ago

3.0.3

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago