name: Check README is up to date with pod
command: |
perl Makefile.PL
- touch --no-create doc/pgBadger.pod
+ touch --no-create pgbadger
make README
- git diff --exit-code
+ git diff --exit-code README doc/pgBadger.pod
workflows:
version: 2
pgBadger project provides a [.editorconfig](http://editorconfig.org/) file to
setup consistent spacing in files. Please follow it!
+
+
+## Keep Documentation Updated
+
+The first pgBadger documentation is `pgbadger --help`. `--help` is
+injected in `doc/pgBadger.pod`. `README` is the text formatting of
+`doc/pgBadger.pod`. Update `README` and `doc/pgBadger.pod` with `make
+README`.
+
+A job in CI ensure all versionned documentations are consistent.
return <<'EOMAKE';
README: doc/pgBadger.pod
pod2text $^ > $@
+
+.INTERMEDIATE: doc/synopsis.pod
+doc/synopsis.pod: Makefile pgbadger
+ echo "=head1 SYNOPSIS" > $@
+ ./pgbadger --help >> $@
+ echo "=head1 DESCRIPTION" >> $@
+ sed -i 's/ +$$//g' $@
+
+doc/pgBadger.pod: doc/synopsis.pod Makefile
+ git checkout $@
+ sed -i '/^=head1 SYNOPSIS/,/^=head1 DESCRIPTION/d' $@
+ sed -i '4r $<' $@
EOMAKE
}