Commit 73245c1a authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Add doc.sh to postprocess odoc's output.

parent 1b9c211f
......@@ -100,7 +100,7 @@ CSS = $(DOCDIR)/odoc.css
doc:
@ rm -rf _build/default/_doc
@ dune clean
@ dune build @doc
@ dune build @doc 2>&1 | ./doc.sh | sort | uniq
@ sed -i.bak 's/font-weight: 500;/font-weight: bold;/' $(CSS) && rm -f $(CSS).bak
@ echo "You can view the documentation by typing 'make view'".
......
#!/bin/bash
set -euo pipefail
shopt -s extglob
# This script helps make sense of the error messages produced by odoc.
while read line
do
buffer="$line"
case "$line" in
File*:)
read line
buffer="$buffer$line"
case "$line" in
"Warning: Couldn't find the following modules:")
read line
buffer="$buffer$line"
case "$line" in
*([:blank:])Stdlib)
# A warning that Stdlib could not be found. Skip.
echo "Skipping warnings about Stdlib."
;;
*)
# A warning that some other modules could not be found. Echo.
echo "$buffer"
;;
esac
;;
"Warning: Failed to lookup type unresolvedroot(Stdlib)"*)
# A warning about Stdlib. Skip.
echo "Skipping warnings about Stdlib."
;;
"Warning: While"*)
read line
buffer="$buffer$line"
case "$line" in
"Failed to lookup type unresolvedroot(Stdlib)"*)
# A multi-line warning about Stdlib. Skip.
echo "Skipping warnings about Stdlib."
;;
*)
# Another kind of warning. Echo.
echo "$buffer"
;;
esac
;;
*)
# Another kind of warning. Echo.
echo "$buffer"
;;
esac
;;
*)
echo "$buffer"
;;
esac
done
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment