rs changelog - speced/respec GitHub Wiki
A custom HTML element that shows a list of Git commits between two commit hashes or tags. Useful in Status of This Document sections to summarize changes since the last publication.
Requires github to be configured.
<p>Changes since the CR snapshot:</p>
<rs-changelog from="CR"></rs-changelog><rs-changelog from="v1.0" to="v2.0"></rs-changelog><rs-changelog from="CR" path="payment-request/index.html"></rs-changelog><script>
function filterChangelog(commit) {
// Return true to include, false to exclude
return !commit.message.startsWith("chore");
}
</script>
<rs-changelog from="CR" filter="filterChangelog"></rs-changelog>| Attribute | Required | Description |
|---|---|---|
from |
Yes | Starting commit hash or tag (inclusive) |
to |
No | Ending commit hash or tag (inclusive). Defaults to latest commit. |
filter |
No | Name of a global JS function (commit) => boolean to filter commits |
repo |
No | Override the GitHub repo from respecConfig.github (useful for monorepos) |
path |
No | Only show commits touching this file or directory |
The filter function receives a commit object:
| Property | Type | Description |
|---|---|---|
hash |
string |
Abbreviated commit hash |
message |
string |
Commit message headline |
Return true to include the commit, false to exclude it.