-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmkreadme.bas
More file actions
66 lines (57 loc) · 1.37 KB
/
mkreadme.bas
File metadata and controls
66 lines (57 loc) · 1.37 KB
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
rem
rem generate README.md from main.cpp
rem
dim code
sub load(file)
local i, s, sline
tload file, s
for i = 0 to len(s) - 1
sline = s[i]
if (INSTR(0, sline, " {") == 1) then
code << DISCLOSE(sline, "\"\"")
endif
next i
end
load("main.cpp")
load("proc-def.h")
load("func-def.h")
tload "raylib/parser/raylib_api.json", s, 1
api = array(s)
functions = {}
for fun in api("functions")
name = upper(fun.name)
functions[name] = fun
next
print "*Raylib* " + trim(command)
print "======="
print "raylib is a simple and easy-to-use library to enjoy videogames programming."
print
print "https://www.raylib.com/
print
print "Implemented APIs (" + len(code) + ")"
print "----------------"
print ""
print "| Name | Description |"
print "|---------|---------------|"
sort code
for i = 0 to len(code) - 1
description = functions(code[i]).description
if (description == 0) then
description = "n/a"
endif
returnType = iff(functions(code[i]).returnType == "void", "sub", "func")
params = ""
comma = ""
name = functions(code[i]).name
if (name == 0) then
name = translate(lower(code(i)), "physics", "Physics")
endif
for param in functions(code[i]).params
params += comma + param.name
comma = ", "
next param
print "| " + returnType + " " + name + "(" + params + ") | " + description + " |"
next i
tload "UNSUPPORTED.md", s, 1
print
print s