Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 329650a

Browse files
committed
[[ LCIDLC ]] Update extract docs script for lcidl
This patch allows the extract-docs script to handle either a stack or a lcidl file.
1 parent a615a61 commit 329650a

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

util/extract-docs.livecodescript

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,34 @@ on extractDocs
3030

3131
local tArg
3232
repeat with tArg = 4 to the number of elements of tArgs
33+
local tName, tSource, tContent
3334

34-
if there is not a stack tArgs[tArg] then
35+
if there is a stack tArgs[tArg] then
36+
put tolower(the short name of stack tArgs[tArg]) into tName
37+
put the script of stack tArgs[tArg] into tContent
38+
put the long id of stack tArgs[tArg] into tSource
39+
else if tArgs[tArg] ends with ".lcidl" then
40+
if the platform is "Win32" then
41+
set the itemDelimiter to backslash
42+
else
43+
set the itemDelimiter to slash
44+
end if
45+
put "com.livecode.external." & tolower(char 1 to -7 of the last item of tArgs[tArg]) into tName
46+
put textDecode(url ("binfile:" & tArgs[tArg]), "UTF8") into tContent
47+
put tArgs[tArg] into tSource
48+
else
3549
write "Error: stack not found: " & tArgs[tArg] & return to stderr
3650
quit 3
3751
end if
3852

3953
local tDocs
40-
put revDocsGenerateDocsFileFromText(the script of stack tArgs[tArg],the long id of stack tArgs[tArg]) into tDocs
54+
put revDocsGenerateDocsFileFromText(tContent, tSource) into tDocs
4155

4256
put textEncode(tDocs, "UTF-8") into tDocs
4357

4458
replace numToByte(13) with numToByte(10) in tDocs
4559

46-
put tDocs into url ("binfile:" & tOutputDir & "/" & tolower(the short name of stack tArgs[tArg]) & ".lcdoc")
60+
put tDocs into url ("binfile:" & tOutputDir & "/" & tName & ".lcdoc")
4761
end repeat
4862

4963
quit 0

0 commit comments

Comments
 (0)