#!/bin/sh -ex

# SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
# For more information, please refer to <https://unlicense.org/>
# SPDX-License-Identifier: Unlicense

# assumes you are in the root of the repo

feedmark --check-against-schema schema/Topic.md --rewrite-markdown TOPICS.md
# TODO: also check that every section in TOPICS has a body.
feedmark --check-against-schema schema/Book.md --rewrite-markdown ./by-topic/*/Books.md
feedmark --check-against-schema schema/Paper.md --rewrite-markdown ./by-topic/*/Papers.md
python3 ./script/build_readmes/main.py .
