2727 mk_help(in_map)
2828fi
2929
30- func get_field(row, key )
30+ func get_field(row, key , escq )
3131 local n1, n2, result
3232 n1 = instr(row, key ) + len( key )
3333 n2 = instr(n1, row, "\\r" ) - n1
3434 result = mid(row, n1, n2)
35+ if (escq) then
36+ result = translate(result, "\\\"", " \ "\" ")
37+ else
38+ result = translate(result, "\\\"", " \ "" )
39+ endif
3540 get_field = result
3641end
3742
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-
4543func fix_comments(comments, keyword)
4644 comments = translate(comments, "p. " , "" )
4745 comments = translate(comments, "bq. " , "" )
@@ -51,8 +49,9 @@ func fix_comments(comments, keyword)
5149 comments = translate(comments, "**" , "" )
5250 comments = translate(comments, " " , " " )
5351 comments = translate(comments, "\\\"", " \ "" )
54- comments = translate(comments, "<code>" , "----[ " + keyword + " example. cut here ]----" + chr( 10 ))
55- comments = translate(comments, "</code>" , chr( 10 ) + "----[ cut here ]----" )
52+ comments = translate(comments, "<code>" , "----[ " + keyword + " example. cut here ]--->" + chr( 10 ))
53+ comments = translate(comments, "</code>" , chr( 10 ) + "<---[ cut here ]----" + chr( 10 ))
54+ comments = translate(comments, "\\r\\n\\r\\n" , chr( 10 ))
5655 comments = translate(comments, "\\r\\n" , chr( 10 ))
5756 fix_comments = comments
5857end
@@ -62,11 +61,11 @@ sub mk_help(byref in_map)
6261 local in_map_len = len(in_map) - 1
6362 for i = 0 to in_map_len
6463 row = in_map(i).body_value
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=" )
64+ group = get_field (row, "group=" , true )
65+ type = get_field (row, "type=" , true )
66+ keyword = get_field (row, "keyword=" , true )
67+ syntax = get_field (row, "syntax=" , true )
68+ brief = get_field (row, "brief=" , true )
7069 while (i + 1 < in_map_len && in_map(i).entity_id == in_map(i + 1 ).entity_id)
7170 i++
7271 wend
@@ -80,7 +79,12 @@ sub mk_text_reference(byref in_map)
8079 local end_block = "<!-- end heading block -->"
8180
8281 ? "SmallBASIC Language reference"
83- ? "See: http://smallbasic.sourceforge.net/?q=node/201"
82+ ?
83+ ? "Online:
84+ ? "http://smallbasic.sourceforge.net/?q=node/201"
85+ ?
86+ ? "Generated with :
87+ ? "https://github.com/smallbasic/SmallBASIC/blob/master/documentation/mkref.bas
8488 ?
8589 ? " _____ _ _ ____ _____ _____ _____
8690 ? " / ____ | | | | _ \ /\ / ____ |_ _/ ____ |
@@ -89,14 +93,15 @@ sub mk_text_reference(byref in_map)
8993 ? " ____) | | | | | | ( _| | | | |_) / ____ \ ____) |_| || |____
9094 ? " |_____/ |_| |_| |_|\__, _|_|_|____/ _/ \ _\_____/ |_____\_____ |
9195 ?
96+ ?
9297
9398 for i = 0 to in_map_len
9499 row = in_map(i).body_value
95- group = get_field(row, "group=" )
96- type = get_field(row, "type=" )
97- keyword = get_field(row, "keyword=" )
98- syntax = get_field(row, "syntax=" )
99- brief = translate( get_field(row, "brief=" ), "\\\"", " \ "" )
100+ group = get_field(row, "group=" , false )
101+ type = get_field(row, "type=" , false )
102+ keyword = get_field(row, "keyword=" , false )
103+ syntax = get_field(row, "syntax=" , false )
104+ brief = get_field(row, "brief=" , false )
100105
101106 ? (i+ 1 ) + ". (" + group + ") " + keyword
102107 ?
0 commit comments