Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

pdfman.sh 1.6 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
  1. #!/bin/bash
  2. #-----------------------------------------------------------------------------
  3. # $Id$
  4. #
  5. # pdfman.sh - Automatic generation of the GMT ps and pdf manual pages
  6. #
  7. # Author: Paul Wessel and Remko Scharroo
  8. # Date: 29-JUN-2007
  9. #
  10. # Uses groff -man
  11. # Assumes a svn update has occured so files are fresh.
  12. #
  13. # Must be run from the main GMT directory after man pages have
  14. # been made.
  15. #
  16. #-----------------------------------------------------------------------------
  17. tmp=${TMPDIR:-/tmp}/gmt.$$
  18. trap 'rm -rf $tmp;exit 1' 1 2 3 15
  19. if [ $# = 1 ]; then # If -s is given we run silently with defaults
  20. gush=0
  21. else # else we make alot of noise
  22. gush=1
  23. fi
  24. echo "Creating PDF man pages ..."
  25. mkdir -p pdf $tmp
  26. cd ..
  27. man2pdf () {
  28. rm -f $tmp/$1.ps
  29. add=0
  30. echo "Creating $1.ps ..."
  31. while read f; do
  32. [ $gush = 1 ] && echo "Appending $f"
  33. [ $add = 1 ] && echo "false 0 startjob pop" >> $tmp/$1.ps
  34. add=1
  35. groff -man $f >> $tmp/$1.ps
  36. done
  37. echo "Converting $1.ps to $1.pdf"
  38. ps2pdf $tmp/$1.ps doc/pdf/$1.pdf
  39. }
  40. # Convert all program manuals to PS and PDF
  41. grep -h ".[135]\$" guru/GMT_progs_files_ascii.lis | man2pdf GMT_Manpages
  42. # Do the supplemental packages
  43. grep -h ".[135]\$" guru/GMT_suppl.lis | man2pdf GMT_Manpages_suppl
  44. # Gurus who have their own supplemental packages can have them processed too by
  45. # defining an environmental parameter MY_GMT_SUPPL which contains a list of these
  46. # supplements. They must all be in src of course
  47. rm -f $tmp/suppl.lis
  48. for package in ${MY_GMT_SUPPL}; do
  49. ls src/$package/*.[135] >> $tmp/suppl.lis
  50. done
  51. [ -f $tmp/suppl.lis ] && man2pdf GMT_My_Manpages_suppl < $tmp/suppl.lis
  52. rm -rf $tmp
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...