OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [ecos-2.0/] [packages/] [net/] [common/] [v2_0/] [doc/] [prepare-manpages.sh] - Blame information for rev 1254

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1254 phoenix
#! /bin/sh
2
 
3
echo 'dude, assuming you are running this script from the ecos-docs/tcpip directory'
4
 
5
MANPAGE_LIST=`find manpages -type f -name '*.?'`
6
 
7
echo "MANPAGE_LIST is $MANPAGE_LIST"
8
 
9
echo 'removing the previous file tcpip-manpages.sgml'
10
/bin/rm -f tcpip-manpages.sgml
11
touch tcpip-manpages.sgml
12
echo '<!-- HEY YOU!!!!!!!!! -->' >> tcpip-manpages.sgml
13
echo '<!-- this file is automatically generated by the script -->' >> tcpip-manpages.sgml
14
echo '<!-- ' "     $0    " ' -->' >> tcpip-manpages.sgml
15
echo '<!-- so PLEASE do not modify it: your changes will be lost -->' >> tcpip-manpages.sgml
16
echo >> tcpip-manpages.sgml
17
echo >> tcpip-manpages.sgml
18
 
19
echo "<chapter id=\"tcpip-library-reference\">" >> tcpip-manpages.sgml
20
echo "  <title>TCP/IP Library Reference</title>" >> tcpip-manpages.sgml
21
 
22
echo >> tcpip-manpages.sgml
23
echo >> tcpip-manpages.sgml
24
 
25
for manpage in $MANPAGE_LIST
26
do
27
    echo "processing $manpage"
28
    # get the title for this section
29
    manpage_title=`egrep '^\.Dt' $manpage | awk '{print $2}' | tr 'A-Z' 'a-z'`
30
    # note that _ is illegal in an id, so we canonicalize it to -
31
    docbook_section_id=`echo $manpage_title | sed 's/_/-/g'`
32
    # now prepare out a section and title
33
    echo "  <sect1 id=\"net-common-tcpip-manpages-$docbook_section_id\">" >> tcpip-manpages.sgml
34
    echo "    <title>$manpage_title</title>" >> tcpip-manpages.sgml
35
    # we make it <screen> so that it is a monospaced font
36
    echo "    <screen>" >> tcpip-manpages.sgml
37
 
38
    # now put the contents into this section
39
    cat $manpage | groff -Tascii -mandoc | sed 's/\_\(.\)/\1/g' \
40
      | sed 's/\(.\)\(.\)/\1/g' \
41
      | sed 's/\&/\&amp;/g' \
42
      | sed 's/</\&lt;/g' \
43
      | sed 's/+o/o/g' >> tcpip-manpages.sgml
44
 
45
    # now close out the section
46
    echo "    </screen>" >> tcpip-manpages.sgml
47
    echo "  </sect1>" >> tcpip-manpages.sgml
48
    echo >> tcpip-manpages.sgml
49
done
50
 
51
echo >> tcpip-manpages.sgml
52
echo "</chapter>" >> tcpip-manpages.sgml
53
 
54
cat <<EOF >> tcpip-manpages.sgml
55
 
56
<!-- Keep this comment at the end of the file
57
Local variables:
58
mode: sgml
59
sgml-omittag:nil
60
sgml-shorttag:t
61
sgml-namecase-general:t
62
sgml-general-insert-case:lower
63
sgml-minimize-attributes:nil
64
sgml-always-quote-attributes:t
65
sgml-indent-step:2
66
sgml-indent-data:t
67
sgml-parent-document:("tcpip.sgml" "book" "chapter")
68
sgml-exposed-tags:nil
69
sgml-local-catalogs:nil
70
sgml-local-ecat-files:nil
71
sgml-doctype:"book"
72
End:
73
-->
74
 
75
EOF

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.