Skip to content

Commit 7d2a6ab

Browse files
committed
Added GitHub action to check links
1 parent 9aa2a4f commit 7d2a6ab

File tree

5 files changed

+124
-0
lines changed

5 files changed

+124
-0
lines changed

.github/workflows/check_links.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: check_links
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
push:
7+
branches:
8+
- main
9+
# TODO: make this a cron action
10+
# runs every monday at 9 am
11+
# schedule:
12+
# - cron: "0 9 * * 1"
13+
permissions: read-all
14+
jobs:
15+
check-links:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: ['3.11']
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v1
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install tox
27+
run: |
28+
python3 -m pip install tox
29+
- name: Run tests
30+
env:
31+
LANG: en_US.UTF-8
32+
run: |
33+
tox -edocs

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Files to ignore by git.
2+
3+
# Specific auto-generated build files
4+
/.tox
5+
/docs/index.rst
6+
/dist

build_index.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
#
3+
# Script to build an index.rst for sphinx-build -b linkcheck
4+
5+
cat >docs/index.rst <<EOT
6+
ForensicsWiki linkcheck
7+
=======================
8+
9+
.. toctree::
10+
:maxdepth: 1
11+
12+
EOT
13+
14+
(cd docs && s -1 *.md | sed 's|\(.*\)\.md| <\1>|' >> index.rst)
15+

docs/conf.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'ForensicsWiki'
21+
copyright = '2023, ForensicsWiki authors'
22+
author = 'ForensicsWiki authors'
23+
24+
25+
# -- General configuration ---------------------------------------------------
26+
27+
# Add any Sphinx extension module names here, as strings. They can be
28+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
29+
# ones.
30+
extensions = ['myst_parser']
31+
32+
# Add any paths that contain templates here, relative to this directory.
33+
templates_path = ['_templates']
34+
35+
# List of patterns, relative to source directory, that match files and
36+
# directories to ignore when looking for source files.
37+
# This pattern also affects html_static_path and html_extra_path.
38+
exclude_patterns = []
39+
40+
41+
# -- Options for HTML output -------------------------------------------------
42+
43+
# The theme to use for HTML and HTML Help pages. See the documentation for
44+
# a list of builtin themes.
45+
#
46+
html_theme = 'alabaster'
47+
48+
# Add any paths that contain custom static files (such as style sheets) here,
49+
# relative to this directory. They are copied after the builtin static files,
50+
# so a file named "default.css" will overwrite the builtin "default.css".
51+
html_static_path = ['_static']
52+
53+
54+
# -- Options for MyST-Parser -------------------------------------------------
55+
56+
# Level of headers to automatically generate label "slugs" (heading anchors).
57+
myst_heading_anchors = 3

tox.ini

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[tox]
2+
envlist = docs
3+
4+
[testenv:docs]
5+
allowlist_externals = ./build_index.sh
6+
skipsdist = true
7+
skip_install = true
8+
deps =
9+
myst_parser
10+
sphinx
11+
commands =
12+
./build_index.sh
13+
sphinx-build -b linkcheck docs dist

0 commit comments

Comments
 (0)