[ library, mpl, program, unclassified ] [ Propose Tags ]

Please see the README on GitHub at https://github.com/serokell/xrefcheck#readme

[Skip to Readme]
Versions [faq], 0.1.1,,, 0.1.2
Change log CHANGES.md
Dependencies aeson, aeson-options, async, base (<4.15), bytestring, cmark-gfm, containers, data-default, deepseq, directory, directory-tree, filepath, fmt, Glob, http-client, http-types, lens, modern-uri, mtl, o-clock, optparse-applicative, pretty-terminal, req, roman-numerals, template-haskell, text, text-metrics, th-lift-instances, th-utilities, universum, with-utf8, xrefcheck, yaml [details]
License MPL-2.0
Copyright 2018-2019 Serokell <https://serokell.io>
Author Kostya Ivanov, Serokell
Maintainer Serokell <hi@serokell.io>
Home page https://github.com/serokell/xrefcheck#readme
Bug tracker https://github.com/serokell/xrefcheck/issues
Source repo head: git clone https://github.com/serokell/xrefcheck
Uploaded by gromak at 2020-06-29T20:58:02Z
Distributions NixOS:0.1.2
Executables xrefcheck
Downloads 441 total (7 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2020-06-29 [all 1 reports]


[Index] [Quick Jump]


Maintainer's Corner

For package maintainers and hackage trustees

Readme for xrefcheck-0.1.2

[back to package description]
<!-- - SPDX-FileCopyrightText: 2018-2019 Serokell <https://serokell.io> - - SPDX-License-Identifier: MPL-2.0 -->


Build status

Xrefcheck is a tool for verifying local and external references in repository documentation that is quick, easy to setup, and suitable to be added to CI.

<img src="https://user-images.githubusercontent.com/5394217/70820564-06b06e00-1dea-11ea-9680-27f661ca2a58.png" alt="Output sample" width="600"/>


As the project evolves, links in documentation have a tendency to get broken. This is usually because of:

  1. File movements;
  2. Markdown header renames;
  3. Outer sites ceasing their existence.

This tool will help you to keep references in order.


Comparing to alternative solutions, this tool tries to achieve the following points:

  • Quickness - local references are verified instantly even for moderately-sized repositories.
  • Easy setup - no extra actions required, just run the tool in the repository root. Both relative and absolute local links are supported out of the box.
  • Conservative verifier allows using this tool in CI, no false positives (e.g. on sites which require authentication) should be reported.

A comparison with other solutions

  • linky - a well-configurable verifier written in Rust, scans one file at a time and works good in pair with system utilities like find. This tool requires some configuring before it can be applied to a repository or added to CI.
  • awesome_bot - a solution written in Ruby that can be easily included in CI or integrated into GitHub. Its features include duplicated URLs detection, specifying allowed HTTP error codes and reporting generation. At the moment of writting, it scans only external references and checking anchors is not possible.
  • remark-validate-links and remark-lint-no-dead-urls - highly configurable Javascript solution for checking local and remote links resp. It is able to check multiple repositores at once if they are gathered in one folder. Being written on JavaScript, it is fairly slow on large repositories.
  • markdown-link-check - another checker written in JavaScript, scans one file at a time. Supports mailto: link resolution.
  • url-checker - GitHub action which checks links in specified files.
  • broken-link-checker - advanced checker for HTML files.


We provide the following ways for you to use xrefcheck:

If none of those are suitable for you, please open an issue!

To find all broken links in a repository, run from within its folder:


To also display all found links and anchors:

xrefcheck -v

For description of other options:

xrefcheck --help


Configuration template (with all options explained) can be dumped with:

xrefcheck dump-config

Currently supported options include:

  • Timeout for checking external references;
  • List of ignored folders.

Build instructions

Run stack install to build everything and install the executable.

CI and nix

To build only the executables, run nix-build. You can use this line on your CI to use xrefcheck:

nix run -f https://github.com/serokell/xrefcheck/archive/master.tar.gz -c xrefcheck

Our CI uses nix-build xrefcheck.nix to build the whole project, including tests and Haddock. It is based on the haskell.nix project. You can do that too if you wish.

For further work

  • [ ] Support for non-Unix systems.
  • [ ] Support link detection in different languages, not only Markdown.
    • [ ] Haskell Haddock is first in turn.

Issue tracker

We use GitHub issues as our issue tracker. You can login using your GitHub account to leave a comment or create a new issue.

For Contributors

Please see CONTRIBUTING.md for more information.

About Serokell

Xrefcheck is maintained and funded with ❤️ by Serokell. The names and logo for Serokell are trademark of Serokell OÜ.

We love open source software! See our other projects or hire us to design, develop and grow your idea!