Problem: in markdown links, '/' should always be used as path separator ,
e.g. GitHub renderer is not threating link `[x](a\b.md)` as a link
to file in dir `a`
We use OS-dependent file separators everywhere, so
e.g. `canonizeLocalRef "./a.md"="./a.md`"` on Windows
Solution: replace '\' to '/' while constructing repo tree if needed
and then use only '/', preferring functions from `System.FilePath.Posix`.
We can do this, since 'a/b' and `a\b` are equivalent paths on Windows
Problem:
We often need to create large strings, and we use different
fmt tools for this (by-hand concatenation, unlinesF, etc).
Sometimes it is unclear or too heavy, and it always can
be called error-prone
Solution: use `int` quasiquoter to build large strings and
have nice-looking and easy-to-read code
Problem: in #158, we started using `optFootnotes` from the `cmark-gfm`
package. This feature hadn't yet been released on hackage, so we pulled
the package from its github repo.
Since then, cmark-gfm-0.2.5 has been released on hackage.
Solution: pull the latest version from hackage and add a lower bound on
the dependency.
Problem: We depend on `roman-numerals` package,
which is outdatead and can't be built with
GHC 9.2.4, which is used by Hackage to generate Haddocks.
Solution: the only place we use this package is showing header levels,
so we can show them "by hands" instead
Problem: we can wrongly report footnotes as broken links (#155),
because footnotes support is disabled by default in cmark-gfm
Solution: add `optFootnotes` to `commonMarkToNode`
(this option was recently added to cmark-gfm-hs,
so we need to temporarily pull it from github instead hackage)
Problem: At new resolver version we recieved obscure error when tried to cross-compile project to Windows on CI. Changing file-embed version to the old one doesn't help us.
Solution: inline content of this file into haskell source, using raw-string-qq library, that helps us to avoid escaping and typing newline characters.
Problem: We had old resolver version, that used ghc 8.10.4 and outdated versions of libraries
Solution: Change resolver to lts 19.13, that uses ghc 9.0.2 and update haskell.nix configuration files to can build project via `nix-build` command
Problem:
We do not know what to do with protected links, because we cannot check
them. So we have two options, assume that these links is valid or not.
Solution:
Provide config option for user to decide what to do - assume protected
links valid or not.
Problem: LTS-14.16 that we currently using and a bit old.
And its GHC is old as well.
Solution: update the resolver, make some changes that were necessary.
They are pretty trivial. The only essential breaking change is the
removal of `parseUrl` from `req`.
Problem: lootbox is not uploaded to hackage, so when we upload
xrefcheck, its build on hackage fails.
Solution: we can use `mixins` feature to set Universum as prelude
without any intermediate packages.
This seems to be supported even by quite old versions of stack, like
1.7.3, so that should not bring build problems in most cases.