- From: Marcos Caceres <w3c@marcosc.com>
- Date: Fri, 22 Nov 2019 16:15:44 +1100
- To: spec-prod <spec-prod@w3.org>
- Cc: sid Vishnoi <sidvishnoi8@gmail.com>
- Message-Id: <2F3849FA-CD1D-4D7C-BD26-26AE8FC5CF7A@marcosc.com>
Hi ReSpec users, tl;dr, we invite folks to beta test and provide feedback on a new custom element: ``` <rs-changelog from="git tag or commit" to="git tag or commit" filter="nameOfFilerFunction"> </rs-changelog> ``` It generates a commit log list from git commits. Usage docs and screenshot: https://github.com/w3c/respec/wiki/rs-changelog Full details below ==== We are excited to introduce our first ReSpec custom element: "<rs-changelog>". Now available for *beta* testing 🔬 in . The `<rs-changelog>` custom element to show a list of commits between two commits or 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 last 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: * `commit` - the commit hash. * `message` - the headline of the commit message. ### Filtering example ```JS 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 ```html <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> ``` ## 💰 Become a sponsor Show your support for ReSpec by becoming a sponsor. Your contributions help support the project's maintenance costs and helps us keep ReSpec going. https://opencollective.com/respec <https://opencollective.com/respec>
Received on Friday, 22 November 2019 05:15:54 UTC