forked from jkubin/m4root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoc.m4
108 lines (94 loc) · 1.95 KB
/
doc.m4
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
dnl vim:ts=32:sw=32
divert(-1)changequote([,])
__HEADER([Josef Kubin], [2020/01/20], [m4root])
___DESCR([extracts headers from source files and creates brief documentation])
___POINT([brief documentation is a solution for cryptic short filenames])
___USAGE([m4 doc.m4 …])
# strings for documentation
define([__AUTHOR_NAME], [Author])
define([__CREATION_DATE], [Started])
define([__FILE_NAME], [File])
define([__HEADER_NOTE], [Note])
define([__THANKS_CAPT], [Thanks])
define([__VERSION], [Version])
define([___DESCR_CAPT], [Description])
define([___POINT_CAPT], [Reason])
define([___USAGE_CAPT], [Usage])
define([__FILE_VERSION], [__VERSION: $1.$2.$3
])
# A → β
define([__HEADER], [
doc_divert(0)doc_dnl
---
__FILE_NAME: __file__
__AUTHOR_NAME: $1
__CREATION_DATE: $2
__HEADER_NOTE: $3
doc_ifelse([$4], [], [], [__FILE_VERSION($4)])doc_dnl
doc_divert(-1)
])
# A → β
define([__THANKS], [
doc_divert(0)doc_dnl
$0_CAPT: $1
doc_divert(-1)
])
# A → β
define([___DESCR], defn([__THANKS]))
define([___POINT], defn([__THANKS]))
define([___USAGE], defn([__THANKS]))
# create aliases for the necessary keywords
# A → β
define([doc_divert], defn([divert]))
define([doc_ifelse], defn([ifelse]))
define([doc_dnl], defn([dnl]))
# comment out this paragraph if you do not like it
divert(0)dnl
[#] vim:wrap:spell:spelllang=en
This is a generated brief documentation from all source files.
It also shows the possibilities of the M4.
divert(-1)
# disable one-line comments and turn off all M4 keywords
changecom
undefine(
[builtin],
[changecom],
[changequote],
[changeword],
[debugmode],
[decr],
[define],
[defn],
[divert],
[divnum],
[dnl],
[dumpdef],
[errprint],
[esyscmd],
[eval],
[format],
[ifdef],
[ifelse],
[include],
[incr],
[index],
[indir],
[len],
[m4exit],
[m4wrap],
[maketemp],
[patsubst],
[popdef],
[pushdef],
[regexp],
[shift],
[sinclude],
[substr],
[syscmd],
[sysval],
[traceoff],
[traceon],
[translit],
[undefine],
[undivert],
)