Skip to content

Reorder the output of the anchor links check

Achilleas Pipinellis requested to merge reorder-output-anchor-links-check into master

It's was hard to parse the information of the output when an anchor link was found broken. This gets even harder when there are multiple broken anchors in multiple files.

You should first see the source file the link was broken from, and then the link itself (destination) along with the actual relative link (link) and finally the anchor.

Before:

nanoc check internal_anchors

     [ ERROR ] internal_anchors - Broken anchor detected!
      - anchor `#avoid-using-awss-elastic-file-system-efs`
      - link `../../administration/high_availability/nfs.html#avoid-using-awss-elastic-file-system-efs`
      - source file `/tmp/gitlab-docs/public/ee/install/aws/index.html`
      - destination `/tmp/gitlab-docs/public/ee/administration/high_availability/nfs.html`
    [ ERROR ] internal_anchors - Broken anchor detected!
      - anchor `#provide-your-own-redis-instance-core-only`
      - link `../../administration/high_availability/redis.html#provide-your-own-redis-instance-core-only`
      - source file `/tmp/gitlab-docs/public/ee/install/aws/index.html`
      - destination `/tmp/gitlab-docs/public/ee/administration/high_availability/redis.html`

After:

nanoc check internal_anchors

     [ ERROR ] internal_anchors - Broken anchor detected!
      - source file `/tmp/gitlab-docs/public/ee/install/aws/index.html`
      - destination `/tmp/gitlab-docs/public/ee/administration/high_availability/nfs.html`
      - link `../../administration/high_availability/nfs.html#avoid-using-awss-elastic-file-system-efs`
      - anchor `#avoid-using-awss-elastic-file-system-efs`
    [ ERROR ] internal_anchors - Broken anchor detected!
      - source file `/tmp/gitlab-docs/public/ee/install/aws/index.html`
      - destination `/tmp/gitlab-docs/public/ee/administration/high_availability/redis.html`
      - link `../../administration/high_availability/redis.html#provide-your-own-redis-instance-core-only`
      - anchor `#provide-your-own-redis-instance-core-only`

The output might now differ with the nanoc check internal_links, but I believe it's worth it.

Edited by Achilleas Pipinellis

Merge request reports