]> git.tuebingen.mpg.de Git - aple.git/blob - include/m4/aple.m4
Unix_Concepts: Only mark up I/O operations as code and not comma
[aple.git] / include / m4 / aple.m4
1 changequote(`«', `»')dnl
2 dnl Discard output by diverting to a negative diversion to suppress
3 dnl unwanted trailing newlines after macro definitions.
4 divert(«-1»)
5
6 define(«LOCAL_LINK_NAME», «translit(«$1», «A-Z 
7
8 », «a-z__»)»)
9 define(«REMOVE_NEWLINE», «translit(«$1»,«
10 », « »)»)
11
12 define(«REFERENCE», [«REMOVE_NEWLINE(«$2»)»](««#»»«LOCAL_LINK_NAME(«$1»)»))
13 define(«XREFERENCE», «[$2]»«($1)»)
14 define(«EMPH», ««_»REMOVE_NEWLINE(«$1»)«_»»)
15 define(«CMD», «`REMOVE_NEWLINE(«$1»)`»)
16 define(«SECTION», « divert(«0») <a
17 href='«#»LOCAL_LINK_NAME(«$1»)'>$1</a><br> divert(«2») <h2
18 id="LOCAL_LINK_NAME(«$1»)">$1</h2> ») define(«SUBSECTION»,
19 «<h3 id="LOCAL_LINK_NAME(«$1»)">$1</h3> »)
20
21 define(«OVERVIEW», «
22
23 <div class="overview">
24         <center> <strong>
25                 ifelse(«$2», «», «Overview», «$2»)
26         </strong> </center>
27         $1
28 </div>
29 »)
30 define(«EXERCISES», «<h3> Exercises </h3>»)
31
32 define(«HOMEWORK», «
33 <h3> Homework </h3>
34 ifelse(«$2», «», «$1», «dnl
35 <details> <summary>
36 $1
37 </summary> <h4> Solution </h4>
38 <div class="solution">$2</div> </details>»)
39 »)
40 define(«SUPPLEMENTS», «SECTION(«Supplements»)»)
41
42 define(«TOC_ENTRY», «
43         ifelse(«$1.m4», «$2», «», «<a href="$1.html">»)
44         translit(«$1», «_», « »)
45         ifelse(«$1.m4», «$2», «», «</a>»)
46         <br>
47 »)
48 define(«LOGO», «<a title="home" href="."><img src="aple.svg" alt="logo"></a>»)
49
50 define(«HEADER», «
51 <!DOCTYPE HTML>
52 <html lang="en">
53 <head>
54         <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
55         <title>Unix course</title>
56         <link href="aple.css" rel="stylesheet" type="text/css">
57         <link rel="shortcut icon" href="aple.ico">
58 </head>
59 <body>
60 <table class="logo"> <tr>
61         <td class="logo">LOGO()</td>
62         <td class="logo"> <h1>
63                 ifelse(«$3», «», «
64                         substr(translit(«$2», «_», « »), 0, index(«$2», .m4))
65                 », «
66                         $3
67                 »)
68         </h1> <p> <small> $1 </small> </p>
69         </td>
70 </tr> </table>
71
72 »)
73
74 define(«TABLE_OF_CONTENTS», «
75         TOC_ENTRY(«Introduction», «$2»)
76         TOC_ENTRY(«Unix_Concepts», «$2»)
77         ifelse(PUBLIC(), «false», «
78                 TOC_ENTRY(Command_Line_Utilities, «$2»)
79         »)
80         TOC_ENTRY(Networking, «$2»)
81         TOC_ENTRY(LVM, «$2»)
82         TOC_ENTRY(«Filesystems», «$2»)
83         TOC_ENTRY(OS-Level_Virtualization, «$2»)
84         ifelse(PUBLIC(), «false», «
85                 TOC_ENTRY(Gridengine, «$2»)
86                 TOC_ENTRY(Git, «$2»)
87                 TOC_ENTRY(Bash, «$2»)
88                 TOC_ENTRY(Debugging, «$2»)
89         »)
90 »)
91
92 define(«TITLE», «
93 HEADER(«$1», «$2», «$3»)
94
95 <div class="dropdown">
96 <svg
97         height="35" width="30"
98         xmlns="http://www.w3.org/2000/svg"
99         xmlns:xlink="http://www.w3.org/1999/xlink"
100 >
101         <rect fill="black" height="3" width="20" x="5" y="5" rx="2"/>
102         <rect fill="black" height="3" width="20" x="5" y="11" rx="2"/>
103         <rect fill="black" height="3" width="20" x="5" y="17" rx="2"/>
104 </svg>
105 <div class="dropdown-content">
106         <table class="menu">
107                 <tr>
108                         <th> Chapter </th>
109                         <th> Section </th>
110                 </tr> <tr>
111                         <td class="menu">
112                                 TABLE_OF_CONTENTS(«chapter_list»)
113                         </td> <td class="menu">
114 divert(«1»)
115                         </td>
116                 </tr>
117         </table>
118 </div>
119 </div>
120 divert(«2»)
121 »)
122 divert(«0»)dnl