Skip to content

Commit dcd9486

Browse files
committed
DOC: generate from json format
1 parent 9960b13 commit dcd9486

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

documentation/mkref.bas

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# left outer join d7_comment as C on C.nid = FDB.entity_id
77
# left outer join d7_field_data_comment_body as FDCB on FDCB.entity_id = C.cid
88
# where FDB.body_value like '%sbasic reference%'
9-
# order by FDB.body_value
9+
# order by FDB.body_value, FDB.entity_id
1010
#
1111
# Then export the results in JSON format
1212
#
@@ -35,6 +35,13 @@ func get_field(row, key)
3535
get_field = result
3636
end
3737

38+
func get_help_field(row, key)
39+
local result
40+
result = get_field(row, key)
41+
result = translate(result, "\\\"", "\"\"")
42+
get_help_field = result
43+
end
44+
3845
func fix_comments(comments, keyword)
3946
comments = translate(comments, "p. ", "")
4047
comments = translate(comments, "bq. ", "")
@@ -55,11 +62,11 @@ sub mk_help(byref in_map)
5562
local in_map_len = len(in_map) - 1
5663
for i = 0 to in_map_len
5764
row = in_map(i).body_value
58-
group = get_field(row, "group=")
59-
type = get_field(row, "type=")
60-
keyword = get_field(row, "keyword=")
61-
syntax = get_field(row, "syntax=")
62-
brief = translate(get_field(row, "brief="), "\\\"", "\"\"")
65+
group = get_help_field(row, "group=")
66+
type = get_help_field(row, "type=")
67+
keyword = get_help_field(row, "keyword=")
68+
syntax = get_help_field(row, "syntax=")
69+
brief = get_help_field(row, "brief=")
6370
while (i + 1 < in_map_len && in_map(i).entity_id == in_map(i + 1).entity_id)
6471
i++
6572
wend
@@ -72,7 +79,6 @@ sub mk_text_reference(byref in_map)
7279
local in_map_len = len(in_map) - 1
7380
local end_block = "<!-- end heading block -->"
7481

75-
7682
? "SmallBASIC Language reference"
7783
? "See: http://smallbasic.sourceforge.net/?q=node/201"
7884
?

0 commit comments

Comments
 (0)