1
0
Fork 0
mirror of https://github.com/kdeldycke/awesome-falsehood.git synced 2024-11-20 11:35:56 -05:00

Auto-generate TOC.

This commit is contained in:
Kevin Deldycke 2020-08-03 14:39:28 +02:00
parent 72cd8f0d00
commit 1606e4e4b0
No known key found for this signature in database
GPG key ID: C572BB01B1ED5A3A
2 changed files with 42 additions and 0 deletions

38
.github/workflows/autofix.yaml vendored Normal file
View file

@ -0,0 +1,38 @@
name: Autofix
on:
push:
# Only targets master default branch to avoid amplification effects of
# auto-fixing the exact same stuff in multiple non-rebased branches.
branches:
- 'master'
schedule:
# Run linter every week to catch regressions from external dependencies.
- cron: 17 9 * * 1
jobs:
toc:
name: Generator TOC and auto-commit
runs-on: ubuntu-latest
steps:
- name: Install doctoc
run: |
sudo npm install -g doctoc
- uses: actions/checkout@v2.3.1
- name: Generate full TOC
run: |
# Generates title as part of the TOC to avoid extra non-conform blank
# lines. See:
# https://github.com/thlorenz/doctoc/issues/101
# https://github.com/thlorenz/doctoc/pull/145
doctoc --github --title "## Contents" readme.md
- name: Remove blacklisted TOC entries
# See: https://github.com/sindresorhus/awesome-lint/blob/v0.13.0/rules/toc.js#L15-L20
run: |
gawk -i inplace '!/^- \[(Contribute|Contributing|Licence|License)\]\(#.+\)$/{print}' ./readme.md
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v4.4.0
with:
commit_author: "Kevin Deldycke <kevin@deldycke.com>"
commit_message: "[lint] Update TOC."
file_pattern: readme.md

View file

@ -23,6 +23,8 @@ subtleties.
In a sense, *Falsehood* articles are a suite of wordy unit-tests covering
extensive edge-cases provided by real-world usage.
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Contents
@ -45,6 +47,8 @@ extensive edge-cases provided by real-world usage.
- [Software Engineering](#software-engineering)
- [Typography](#typography)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Meta