Skip to content
Sid Vishnoi edited this page Jun 30, 2020 · 12 revisions

<rs-changelog>

The <rs-changelog> custom element to show a list of commits between two commits/tags. This list of commits is shown from newest to oldest. Each commit message is linked to the commit.

Attributes

  • from: a commit hash or git tag, from when (inclusive).
  • to: optional, a commit hash or git tag until when (inclusive). If omitted, it just does to the latest commit.
  • filter: the name of a JS function to call, which allows you to filter out commits.

Filtering

The filter function takes one argument, which is a commit object. The object is composed of two properties:

  • hash - the abbreviated commit hash.
  • message - the headline of the commit message.

Filtering example

function respecChangelogFilter(commit) {
  // commit.hash = commit hash
  // commit.message = commit message headline
  // Return `true` if commit is to be shown, false otherwise.
  return !commit.message.startsWith("chore");
}

Usage examples

<p>Commits since "CR":</p>
<rs-changelog from="CR"></rs-changelog>

<p>All commits between "CR" tag and a commit "5b1a9da":</p>
<rs-changelog from="CR" to="5b1a9da"></rs-changelog>

<p>
  Show commits since "CR", but filter the commits to be shown using a function
  called `respecChangelogFilter` which is defined globally:
</p>
<rs-changelog from="CR" filter="respecChangelogFilter"></rs-changelog>

Screenshot

image

Guides

Configuration options

W3C Configuration options

Linter rules

Internal properties

Handled by ReSpec for you.

Special <section> IDs

HTML elements

Custom Elements

WebIDL

HTML attributes

CSS Classes

Special properties

Clone this wiki locally