@@ -1913,7 +1913,7 @@ end escape
19131913command docsBuilderGenerateDocsNew pEdition, pVersion
19141914 start using stack (builderRepoFolder() & slash & "ide-support" & slash & "revdocsparser.livecodescript" )
19151915
1916- builderExtUnpack pEdition
1916+ builderExtUnpack "Business"
19171917
19181918 builderLog "report" , "Building guide into" && builderGuideFolder(pEdition ) & slash & "distributed_guide.js"
19191919 pathEnsure (builderGuideFolder(pEdition ))
@@ -1946,14 +1946,6 @@ private command addFolderToListIfExists pFolder, pThrowIfNot, @xArray
19461946 end if
19471947end addFolderToListIfExists
19481948
1949- private function RepoEditionDocsFolder pEdition
1950- if editionIsInPrivateRepo(pEdition ) then
1951- return builderPrivateRepoFolder() & slash & "docs" & slash & toLower (pEdition )
1952- else
1953- return builderRepoFolder() & slash & "docs" & slash & toLower (pEdition )
1954- end if
1955- end RepoEditionDocsFolder
1956-
19571949private command docsBuilderGetGuideFolders pEdition, @xFolders
19581950 local tRepoGuides
19591951 put builderRepoFolder() & slash & "docs" & slash & "guides" into tRepoGuides
@@ -1963,49 +1955,31 @@ private command docsBuilderGetGuideFolders pEdition, @xFolders
19631955 put builderIDEDocsFolder() & slash & "guides" into tIDEGuides
19641956 addFolderToListIfExists tIDEGuides , true , xFolders
19651957
1966- repeat for each item tEdition in "indy,business"
1967- if editionCompare(pEdition , tEdition ) >= 0 then
1968- local tGuides
1969- put RepoEditionDocsFolder(tEdition ) & slash & "guides" into tGuides
1970- addFolderToListIfExists tGuides , false , xFolders
1958+ local tComponents
1959+ put builderComponentFolders() into tComponents
1960+
1961+ repeat for each element tComponent in tComponents
1962+ if editionCompare(pEdition , tComponent ["metadata" ]["edition" ]) >= 0 then
1963+ addFolderToListIfExists tComponent ["folder" ] & slash & "guides" , false , xFolders
19711964 end if
19721965 end repeat
1973-
1966+
19741967 addFolderToListIfExists builderBuiltGuidesFolder(), false , xFolders
19751968end docsBuilderGetGuideFolders
19761969
19771970private command docsBuilderAddExtFolders pEdition, @xFolders
1978- local tDefaultFolder
1979- put the defaultFolder into tDefaultFolder
1980-
19811971 local tTargetFolder
1982- put builderUnpackFolder() & slash & "Ext" into tTargetFolder
1983- set the defaultFolder to tTargetFolder
1984-
1985- repeat for each line tFolder in the folders
1972+ put builderUnpackFolder("Business" ) & slash & "Ext" into tTargetFolder
1973+ repeat for each line tFolder in folders (tTargetFolder )
19861974 if tFolder is ".." then next repeat
19871975 addFolderToListIfExists tTargetFolder & slash & tFolder , true , xFolders
19881976 end repeat
1989-
1990- set the defaultFolder to tDefaultFolder
19911977end docsBuilderAddExtFolders
19921978
19931979private command docsBuilderGetAdditionalFolders pEdition, @xFolders
19941980 docsBuilderAddExtFolders pEdition , xFolders
19951981end docsBuilderGetAdditionalFolders
19961982
1997- private command docsBuilderGetDictionaryFolders pEdition, @xFolders
1998- local tCommunityDocs
1999- put builderRepoFolder() & slash & "docs" into tCommunityDocs
2000- addFolderToListIfExists tCommunityDocs , true , xFolders
2001-
2002- repeat for each item tEdition in "indy,business"
2003- if editionCompare(pEdition , tEdition ) >= 0 then
2004- addFolderToListIfExists RepoEditionDocsFolder(), true , xFolders
2005- end if
2006- end repeat
2007- end docsBuilderGetDictionaryFolders
2008-
20091983command docsBuilderGenerateDistributedGuide pEdition
20101984 local tGuideFoldersA
20111985 docsBuilderGetGuideFolders pEdition , tGuideFoldersA
@@ -2048,26 +2022,22 @@ end docsFileGetUTF8Contents
20482022
20492023-- Find all lcdoc files in pFolder and add them to the list of docs
20502024-- data in xLibraryA
2051- private command addToDictionaryFromFolder pFolder, @xLibraryA
2052- local tDefaultFolder
2053- put the defaultFolder into tDefaultFolder
2054-
2025+ private command addToDictionaryFromFolder pFolder, pDefaults, @xLibraryA
20552026 docsBuilderProgressUpdate "" , "Building dictionary from folder" && pFolder
2056- set the defaultfolder to pFolder
2057- get the files
2027+
2028+ get files ( pFolder )
20582029 filter it with "*.lcdoc"
20592030 repeat for each line tFile in it
20602031 local tText , tParsedA
20612032 wait 0 with messages
20622033 put docsFileGetUTF8Contents(pFolder & slash & tFile , true ) into tText
2063- put revDocsParseDocText(tText ) into tParsedA
2034+ put revDocsParseDocText(tText , pFolder & slash & tFile , pDefaults ) into tParsedA
20642035 repeat for each element tDoc in tParsedA ["doc" ]
20652036 -- TODO: Work out why something empty is returned
20662037 if tDoc ["display name" ] is empty then next repeat
20672038 addToList tDoc , xLibraryA
20682039 end repeat
20692040 end repeat
2070- set the defaultFolder to tDefaultFolder
20712041end addToDictionaryFromFolder
20722042
20732043/*
@@ -2077,40 +2047,39 @@ pRootDirs (array): An array of paths to the relevant root folders of the
20772047dictionary.
20782048*/
20792049
2080- command docsBuilderParseDictionaryToLibraryArray pRootDirs, @xDocsA
2081- local tDefaultFolder
2082- put the defaultFolder into tDefaultFolder
2083-
2084- # Get the list of canonical glossary entries
2085- local tGlossaryA
2086- repeat for each element tRootDir in pRootDirs
2087- union tGlossaryA with revDocsCollectGlossarySynonyms(tRootDir )
2088- end repeat
2089-
2090- repeat for each element tRootDir in pRootDirs
2050+ command docsBuilderParseDictionaryToLibraryArray pComponents, @xDocsA
2051+ repeat for each element tComponent in pComponents
20912052 local tDictionaryRoot , tGlossaryRoot
2092- put tRootDir & slash & "dictionary" into tDictionaryRoot
2093- put tRootDir & slash & "glossary" into tGlossaryRoot
2053+ put tComponent ["folder" ] & slash & "dictionary" into tDictionaryRoot
2054+ put tComponent ["folder" ] & slash & "glossary" into tGlossaryRoot
2055+
2056+ local tDefaults
2057+ delete variable tDefaults
2058+ if tComponent ["metadata" ]["edition" ] is not empty then
2059+ put editionDisplayName(tComponent ["metadata" ]["edition" ]) into tDefaults ["edition" ]
2060+ end if
20942061
20952062 repeat for each item tRoot in (tDictionaryRoot & "," & tGlossaryRoot )
2096- set the defaultfolder to tRoot
2097- repeat for each line tLine in the folders
2063+ if there is not a folder tRoot then
2064+ next repeat
2065+ end if
2066+
2067+ repeat for each line tLine in folders (tRoot )
20982068 if tLine is ".." then next repeat
2099- addToDictionaryFromFolder tRoot & slash & tLine , xDocsA
2069+ addToDictionaryFromFolder tRoot & slash & tLine , tDefaults , xDocsA
21002070 end repeat
21012071 end repeat
21022072 end repeat
2103- set the defaultFolder to tDefaultFolder
21042073end docsBuilderParseDictionaryToLibraryArray
21052074
21062075command docsBuilderParseAdditionalFoldersToLibraryArray pDirs, @xDocsA
21072076 local tFolder
21082077 repeat for each element tFolder in pDirs
2109- addToDictionaryFromFolder tFolder , xDocsA
2078+ addToDictionaryFromFolder tFolder , empty , xDocsA
21102079 end repeat
21112080end docsBuilderParseAdditionalFoldersToLibraryArray
21122081
2113- function docsBuilderParseDictionary pLibraryName, pAuthor, pRootDirsA , pAdditionalDirsA, pRecursive
2082+ function docsBuilderParseDictionary pLibraryName, pAuthor, pComponents , pAdditionalDirsA, pRecursive
21142083 local tLibraryA
21152084
21162085 put revDocsModifyForUrl(pLibraryName ) into tLibraryA ["name" ]
@@ -2119,7 +2088,7 @@ function docsBuilderParseDictionary pLibraryName, pAuthor, pRootDirsA, pAddition
21192088 put "dictionary" into tLibraryA ["type" ]
21202089
21212090 -- Special case for the dictionary / glossary data extraction
2122- docsBuilderParseDictionaryToLibraryArray pRootDirsA , tLibraryA ["doc" ]
2091+ docsBuilderParseDictionaryToLibraryArray pComponents , tLibraryA ["doc" ]
21232092
21242093 -- Add any additional docs to the dictionary
21252094 docsBuilderParseAdditionalFoldersToLibraryArray pAdditionalDirsA , tLibraryA ["doc" ]
@@ -2132,14 +2101,23 @@ function docsBuilderParseDictionary pLibraryName, pAuthor, pRootDirsA, pAddition
21322101end docsBuilderParseDictionary
21332102
21342103command docsBuilderGenerateDistributedAPI pEdition
2135- local tDictionaryFolders , tAdditionalFolders
2136- docsBuilderGetDictionaryFolders pEdition , tDictionaryFolders
2104+ local tAdditionalFolders
21372105 docsBuilderGetAdditionalFolders pEdition , tAdditionalFolders
21382106
21392107 local tLibrariesA
21402108
2109+ local tComponents
2110+ put builderComponentFolders() into tComponents
2111+
2112+ -- special case the main docs folder
2113+ local tIndex
2114+ put the number of elements of tComponents + 1 into tIndex
2115+ put builderRepoFolder() & "/docs" into tComponents [tIndex ]["folder" ]
2116+ put "engine" into tComponents [tIndex ]["metadata" ]["category" ]
2117+ put "community" into tComponents [tIndex ]["metadata" ]["edition" ]
2118+
21412119 local tLCSDictionaryA
2142- put docsBuilderParseDictionary("LiveCode Script" , "LiveCode" , tDictionaryFolders , tAdditionalFolders , false ) into tLCSDictionaryA
2120+ put docsBuilderParseDictionary("LiveCode Script" , "LiveCode" , tComponents , tAdditionalFolders , false ) into tLCSDictionaryA
21432121
21442122 if tLCSDictionaryA is empty then
21452123 logError "Couldn't parse script dictionary data for" && pEdition
0 commit comments