Skip to content

Commit

Permalink
chore(doctoc): install precommit hook to maintain TOCs in docs
Browse files Browse the repository at this point in the history
Use doctoc to create and maintain table of contents in our markdown
documentation files.

Install the new precommit hook with `pre-commit install`.

Reference: https://github.com/thlorenz/doctoc
  • Loading branch information
nikomakela committed Dec 4, 2024
1 parent 5530249 commit 2ed46e5
Show file tree
Hide file tree
Showing 13 changed files with 164 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,9 @@ repos:
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
- id: gitlint
stages: [commit-msg]
- id: gitlint
stages: [commit-msg]
- repo: https://github.com/thlorenz/doctoc
rev: v2.2.0
hooks:
- id: doctoc
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- DOCTOC SKIP -->
<!-- REMINDER: While updating changelog, also remember to update
the version in kukkuu/__init.py__ -->

Expand Down
36 changes: 33 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,33 @@

[![status](https://travis-ci.com/City-of-Helsinki/kukkuu.svg)](https://github.com/City-of-Helsinki/kukkuu)

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Environments](#environments)
- [Development with Docker](#development-with-docker)
- [Development without Docker](#development-without-docker)
- [Installing Python requirements](#installing-python-requirements)
- [Database](#database)
- [Notification import](#notification-import)
- [Cron jobs](#cron-jobs)
- [Reminder notifications](#reminder-notifications)
- [Feedback notifications](#feedback-notifications)
- [Queued email sending](#queued-email-sending)
- [SMS notifications](#sms-notifications)
- [Daily running, Debugging](#daily-running-debugging)
- [Authorization](#authorization)
- [GDPR API data export](#gdpr-api-data-export)
- [GraphQL API Documentation](#graphql-api-documentation)
- [Report API](#report-api)
- [QR-code ticket verification](#qr-code-ticket-verification)
- [Keeping Python requirements up to date](#keeping-python-requirements-up-to-date)
- [Code linting & formatting](#code-linting--formatting)
- [Pre-commit hooks](#pre-commit-hooks)
- [Issues board](#issues-board)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Environments

Production environment:
Expand Down Expand Up @@ -192,15 +219,18 @@ Basic `ruff` commands:
- Format: `ruff format`

Basically:
- Ruff linter (i.e. `ruff check --fix`) does what `flake8` and `isort` did before.
- Ruff formatter (i.e. `ruff format`) does what `black` did before.

- Ruff linter (i.e. `ruff check --fix`) does what `flake8` and `isort` did before.
- Ruff formatter (i.e. `ruff format`) does what `black` did before.

Integrations for `ruff` are available for many editors:
- https://docs.astral.sh/ruff/integrations/

- https://docs.astral.sh/ruff/integrations/

### Pre-commit hooks

You can use [`pre-commit`](https://pre-commit.com/) to lint and format your code before committing:

1. Install `pre-commit` (there are many ways to do but let's use pip as an example):
- `pip install pre-commit`
2. Set up git hooks from `.pre-commit-config.yaml`, run this command from project root:
Expand Down
9 changes: 9 additions & 0 deletions docs/setup-keycloak.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Setup Keycloak](#setup-keycloak)
- [Use the public test Keycloak](#use-the-public-test-keycloak)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Setup Keycloak

## Use the public test Keycloak
Expand Down
10 changes: 10 additions & 0 deletions docs/setup-tunnistamo.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Setup Tunnistamo](#setup-tunnistamo)
- [Use a local Tunnistamo](#use-a-local-tunnistamo)
- [Use the public test Tunnistamo](#use-the-public-test-tunnistamo)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Setup Tunnistamo

## Use a local Tunnistamo
Expand Down
10 changes: 10 additions & 0 deletions gdpr/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [How to integrate the Culture Kids to Helsinki-Profile GDPR API](#how-to-integrate-the-culture-kids-to-helsinki-profile-gdpr-api)
- [GDPR API data export](#gdpr-api-data-export)
- [Kukkuu GDPR API tester](#kukkuu-gdpr-api-tester)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# How to integrate the Culture Kids to Helsinki-Profile GDPR API

As background information and instructions for integrating the service with Helsinki-Profile, see the documentation for [How to integrate to Helsinki-Profile through Tunnistamo](./docs/how-to-integrate-to-Helsinki-profile-with-Tunnistamo.md).
Expand Down
15 changes: 15 additions & 0 deletions gdpr/docs/how-to-integrate-to-Helsinki-profile-with-Tunnistamo.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Integrate the Culture Kids service to the Helsinki-Profile](#integrate-the-culture-kids-service-to-the-helsinki-profile)
- [1. Download and install all the needed services](#1-download-and-install-all-the-needed-services)
- [2. Setup the clients and their scopes in Tunnistamo](#2-setup-the-clients-and-their-scopes-in-tunnistamo)
- [Communication between the Culture kids apps and the Tunnistamo](#communication-between-the-culture-kids-apps-and-the-tunnistamo)
- [Communication between the Helsinki-profile and the Tunnistamo](#communication-between-the-helsinki-profile-and-the-tunnistamo)
- [Communication from Helsinki-profile to the Culture Kids through Tunnistamo](#communication-from-helsinki-profile-to-the-culture-kids-through-tunnistamo)
- [3. Setup the Helsinki-Profile](#3-setup-the-helsinki-profile)
- [4. Test that all the communication works](#4-test-that-all-the-communication-works)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Integrate the Culture Kids service to the Helsinki-Profile

## 1. Download and install all the needed services
Expand Down
11 changes: 11 additions & 0 deletions gdpr/docs/kukkuu-profile-through-tunnistamo.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Culture Kids with Helsinki-Profile GDPR API through Tunnistamo](#culture-kids-with-helsinki-profile-gdpr-api-through-tunnistamo)
- [OIDC API scopes](#oidc-api-scopes)
- [Kukkuu GDPR Query API Scope Specifier](#kukkuu-gdpr-query-api-scope-specifier)
- [Kukkuu GDPR Delete API Scope Specifier](#kukkuu-gdpr-delete-api-scope-specifier)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Culture Kids with Helsinki-Profile GDPR API through Tunnistamo

## OIDC API scopes
Expand Down
10 changes: 10 additions & 0 deletions gdpr/docs/setup-helsinki-profile.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Setup the Helsinki-Profile for internal use and for UI](#setup-the-helsinki-profile-for-internal-use-and-for-ui)
- [Configure the internal service (for Helsinki-Profile-UI and internal Graphql-UI)](#configure-the-internal-service-for-helsinki-profile-ui-and-internal-graphql-ui)
- [Configure the Culture kids service](#configure-the-culture-kids-service)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Setup the Helsinki-Profile for internal use and for UI

In order to get the Helsinki-Profile UI to work with API, The Helsinki-Profile services needs to be set so that they match with the Tunnistamo client ids. Also, the Helsinki-Profile API itself needs an internal service.
Expand Down
16 changes: 16 additions & 0 deletions gdpr/docs/tunnistamo-kukkuu-configuration.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Culture Kids with Tunnistamo](#culture-kids-with-tunnistamo)
- [OIDC provider clients](#oidc-provider-clients)
- [Kukkuu API](#kukkuu-api)
- [Kukkuu UI](#kukkuu-ui)
- [Kukkuu Admin UI](#kukkuu-admin-ui)
- [OIDC API](#oidc-api)
- [Kukkuu API](#kukkuu-api-1)
- [OIDC API scopes](#oidc-api-scopes)
- [Kukkuu API Scope](#kukkuu-api-scope)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Culture Kids with Tunnistamo

## OIDC provider clients
Expand Down
15 changes: 15 additions & 0 deletions gdpr/docs/tunnistamo-profile-configuration.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Helsinki-Profile with Tunnistamo](#helsinki-profile-with-tunnistamo)
- [OIDC provider clients](#oidc-provider-clients)
- [Helsinki-Profile API](#helsinki-profile-api)
- [Helsinki-Profile UI](#helsinki-profile-ui)
- [OIDC API](#oidc-api)
- [Helsinki-profile API](#helsinki-profile-api)
- [OIDC API scopes](#oidc-api-scopes)
- [Helsinki-profile API Scope](#helsinki-profile-api-scope)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Helsinki-Profile with Tunnistamo

## OIDC provider clients
Expand Down
11 changes: 11 additions & 0 deletions subscriptions/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Subscriptions app](#subscriptions-app)
- [Free spot notifications](#free-spot-notifications)
- [Authenticated users](#authenticated-users)
- [Authorization with a token](#authorization-with-a-token)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

### Subscriptions app

#### Free spot notifications
Expand Down
17 changes: 17 additions & 0 deletions users/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Users app](#users-app)
- [Models](#models)
- [User](#user)
- [Guardian](#guardian)
- [GraphQL Schema](#graphql-schema)
- [Guardians](#guardians)
- [My profile](#my-profile)
- [Update the email](#update-the-email)
- [Manage communication subscriptions](#manage-communication-subscriptions)
- [My admin profile](#my-admin-profile)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

### Users app

#### Models
Expand Down

0 comments on commit 2ed46e5

Please sign in to comment.