From 82d5e401761f17b84d050411f7214e5d2419f233 Mon Sep 17 00:00:00 2001 From: enitrat Date: Thu, 24 Apr 2025 18:16:25 +0100 Subject: [PATCH] dev: fix deadlinks & add CI checker --- .github/workflows/link-check.yml | 19 +++++++++++++++++++ src/custom_types/enum.md | 2 +- src/error/option_unwrap.md | 2 +- src/hello.md | 2 +- src/hello/print.md | 4 ++-- src/hello/print/print_display.md | 2 +- src/testing/dev_dependencies.md | 2 +- src/testing/unit_testing.md | 2 +- 8 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/link-check.yml diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml new file mode 100644 index 0000000..0ca8a2e --- /dev/null +++ b/.github/workflows/link-check.yml @@ -0,0 +1,19 @@ +name: Check Markdown links + +on: + pull_request: + branches: + - main + +jobs: + markdown-link-check: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install markdown-link-check + run: | + npm install -g markdown-link-check + - name: Run markdown-link-check + run: | + find src -name "*.md" | xargs markdown-link-check diff --git a/src/custom_types/enum.md b/src/custom_types/enum.md index f231f4f..bf6c36c 100644 --- a/src/custom_types/enum.md +++ b/src/custom_types/enum.md @@ -24,4 +24,4 @@ want to rename it. [match]: ../flow_control/match.md [fn]: ../fn.md -[str]: ../core/bytearray.md +[str]: ../core/bytearrays.md diff --git a/src/error/option_unwrap.md b/src/error/option_unwrap.md index e17ab5e..882be43 100644 --- a/src/error/option_unwrap.md +++ b/src/error/option_unwrap.md @@ -27,4 +27,4 @@ controlled result while retaining the option to `panic` if desired. {{#include ../../listings/error/option_unwrap/src/lib.cairo}} ``` -[expect]: https://docs.cairo-lang.org/std/option/enum.Option.html#method.expect +[expect]: https://docs.cairo-lang.org/core/core-option-OptionTrait.html#expect diff --git a/src/hello.md b/src/hello.md index 29adb89..1e43cf4 100644 --- a/src/hello.md +++ b/src/hello.md @@ -32,4 +32,4 @@ Hello World! I'm a Caironaut! ``` -[macros]: macros.md +[macros]: https://book.cairo-lang.org/ch12-05-macros.html?#macros diff --git a/src/hello/print.md b/src/hello/print.md index dbe6de1..a687c8b 100644 --- a/src/hello/print.md +++ b/src/hello/print.md @@ -37,8 +37,8 @@ for these types. To print text for custom types, more steps are required. [`std::fmt`][fmt], [`macros`][macros], [`struct`][structs], [`traits`][traits] [fmt]: https://docs.swmansion.com/scarb/corelib/core-fmt.html -[macros]: ../macros.md -[bytearray]: ../core/bytearray.md +[macros]: https://book.cairo-lang.org/ch12-05-macros.html?#macros +[bytearray]: ../core/bytearrays.md [structs]: ../custom_types/structs.md [traits]: https://docs.swmansion.com/scarb/corelib/core-fmt.html#traits [attribute]: ../attribute.md diff --git a/src/hello/print/print_display.md b/src/hello/print/print_display.md index 8951f5d..6c3b478 100644 --- a/src/hello/print/print_display.md +++ b/src/hello/print/print_display.md @@ -51,7 +51,7 @@ Debug: Complex { real: 3, imag: 7 } [derive]: ../../trait/derive.md [fmt]: https://docs.swmansion.com/scarb/corelib/core-fmt.html -[macros]: ../../macros.md +[macros]: https://book.cairo-lang.org/ch12-05-macros.html?#macros [structs]: ../../custom_types/structs.md [traits]: ../../trait.md [use]: ../../mod/use.md diff --git a/src/testing/dev_dependencies.md b/src/testing/dev_dependencies.md index a6a162d..a24d46a 100644 --- a/src/testing/dev_dependencies.md +++ b/src/testing/dev_dependencies.md @@ -22,5 +22,5 @@ File `src/lib.cairo`: [Scarb][scarb] docs on specifying dependencies. -[unit-testing]: testing/unit_testing.md +[unit-testing]: ./unit_testing.md [scarb]: https://docs.swmansion.com/scarb/docs/reference/specifying-dependencies.html diff --git a/src/testing/unit_testing.md b/src/testing/unit_testing.md index 7b2c704..c5070ef 100644 --- a/src/testing/unit_testing.md +++ b/src/testing/unit_testing.md @@ -59,6 +59,6 @@ with command `scarb test -- --ignored` ``` [attribute]: ../attribute.md -[macros]: ../macros.md +[macros]: https://book.cairo-lang.org/ch12-05-macros.html?#macros [mod]: ../mod.md [panic]: ../error/panic.md