Skip to content

Commit

Permalink
docs lychee as part of script
Browse files Browse the repository at this point in the history
  • Loading branch information
martukas committed Nov 1, 2024
1 parent d047cf6 commit f62222e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ jobs:
- name: Pull in relevant images only
run: git lfs pull -I "docs/wiring/images/*.png"
- name: Build docs
run: cd docs
&& ./docs.sh build
&& touch _build/html/.nojekyll
- name: Link Checker
uses: lycheeverse/lychee-action@v1.8.0
with:
fail: true
# Check all markdown and html files
args: -c docs/lychee.toml .
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: ./docs/docs.sh build
- name: Check links
run: ./docs/docs.sh check
# - name: Link Checker
# uses: lycheeverse/lychee-action@v1.8.0
# with:
# fail: true
# # Check all markdown and html files
# args: -c docs/lychee.toml .
# env:
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Deploy to Github Pages
if: ${{ github.ref == 'refs/heads/master' }}
uses: JamesIves/github-pages-deploy-action@v4
Expand Down
8 changes: 6 additions & 2 deletions docs/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.

# This script should work no matter where you call it from.
cd "$(dirname "$0")"
pushd "$(dirname "$0")" > /dev/null || exit_fail

. ../software/common/base.sh

Expand Down Expand Up @@ -47,8 +47,10 @@ install_linux() {
sudo apt update
sudo apt install -y \
make \
docker.io \
doxygen \
graphviz
docker pull lycheeverse/lychee
echo "If you wish to use \`./docs.sh check\` to check validity of links locally, please follow installation instructions at https://github.com/lycheeverse/lychee"
}

Expand All @@ -58,6 +60,7 @@ build_all() {
poetry run wiring -d ./wiring
poetry run parts -f ./purchasing/parts.json
poetry run make html
touch ./_build/html/.nojekyll
}

launch_browser() {
Expand All @@ -66,7 +69,8 @@ launch_browser() {

check_links() {
echo "If you wish to use \`./docs.sh check\` to check validity of links locally, please follow installation instructions at https://github.com/lycheeverse/lychee"
lychee ..
docker run --init -it --rm -w /input -v $(pwd)/..:/input lycheeverse/lychee -c ./docs/lychee.toml .
# lychee ..
}

########
Expand Down
13 changes: 12 additions & 1 deletion docs/lychee.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
############################# Display #############################

# Verbose program output
# Accepts log level: "error", "warn", "info", "debug", "trace"
#verbose = "info"

# Don't show interactive progress bar while checking links.
no_progress = true

# Path to summary output file.
#output = ".config.dummy.report.md"

############################# Runtime #############################

# Number of threads to utilize.
# Defaults to number of cores available to the system if omitted.
threads = 2

# Maximum number of allowed redirects.
max_redirects = 5

Expand Down Expand Up @@ -47,7 +58,7 @@ headers = []
# HTTP basic auth support. This will be the username and password passed to the
# authorization HTTP header. See
# <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization>
basic_auth = "user:pwd"
#basic_auth = "user:pwd"

############################# Exclusions ##########################

Expand Down

0 comments on commit f62222e

Please sign in to comment.