UmbrellaDocs / linkspector

Uncover broken links in your content.
Apache License 2.0
52 stars 8 forks source link

Missing links not found in asciidoc files #29

Open marcindulak opened 4 months ago

marcindulak commented 4 months ago

The example below uses docker https://github.com/UmbrellaDocs/linkspector/pull/23

  1. build the image of the latest linkspector from source
    git clone https://github.com/UmbrellaDocs/linkspector
    cd linkspector
    docker build --build-arg LINKSPECTOR_PACKAGE= -t umbrelladocs/linkspector .
  2. run linkspector check on a test directory
    mkdir -p test/nested
    cp .gitignore test  # due to https://github.com/UmbrellaDocs/linkspector/issues/24
    echo 'footnote:[linkspector-mising[https://github.com/UmbrellaDocs/linkspector-missing]]' > test/nested/nested.asciidoc # 1
    echo 'link:nested/nested-missing.asciidoc[nested-missing]' > test/test.asciidoc # 2
    echo '[[test-missing.png]]' >> test/test.asciidoc
    echo 'image::test-missing.png[test-missing]' >> test/test.asciidoc # 3
    echo '<<test-missing-missing.png>>' >> test/test.asciidoc # 4
    docker run --rm -it -v $PWD/test:/app --name linkspector umbrelladocs/linkspector bash -c 'linkspector check'

Output

⠋ Configuration file not found. Using default configuration.
✨ Success: All hyperlinks in the specified files are valid.
⠋ Configuration file not found. Using default configuration.

It is expected that 'linkspector check' fails for the above 4 types of missing links. There are more types of links, but I think these are the most common ones.

gaurav-nelson commented 4 months ago

Thank you @marcindulak I have a WIP branch for adding AsciiDoc link checking, however, I first want to focus on handling MarkDown better. I'll pick up AsciiDoc soon.