asciidoc-helper.sh 877 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh
  2. # Copyright (c) The Tor Project, Inc.
  3. # See LICENSE for licensing information
  4. # Run this to generate .html.in or .1.in files from asciidoc files.
  5. # Arguments:
  6. # html|man asciidocpath outputfile
  7. set -e
  8. if [ $# != 3 ]; then
  9. exit 1;
  10. fi
  11. output=$3
  12. if [ "$1" = "html" ]; then
  13. input=${output%%.html.in}.1.txt
  14. base=${output%%.html.in}
  15. "$2" -d manpage -o $output $input;
  16. elif [ "$1" = "man" ]; then
  17. input=${output%%.1.in}.1.txt
  18. base=${output%%.1.in}
  19. if "$2" -f manpage $input; then
  20. mv $base.1 $output;
  21. else
  22. echo "==================================";
  23. echo;
  24. echo "a2x is installed, but some required docbook support files are";
  25. echo "missing. Please install docbook-xsl and docbook-xml (Debian)";
  26. echo "or similar.";
  27. echo;
  28. echo "==================================";
  29. exit 1;
  30. fi
  31. fi