REVO7000, Make_docset P/* Make Docset is an attempt to pull out all the documentation and export it as a HTML docset. It is based on a variant of the code developed by Bernd Niggemann, James Hale and Brian Milby for the TinyDict sample stack General steps Preparation: Get user to select folder to save files. then... 1. Extract dictionary entries 2. Step through each entry 2. Create indexed array using same index as dictionary and populate a filename entry for the HTML file - 2. Step through each entry to create a HTML version for export 2.1 Go through the entry and format sections 2.2 Pack into HTML template 3. Get guide files 3.1 go through each one and convert to HTML 3.2 transfer to folder along with image files. */ local sCompleteDictsArray = "" local sChapterEnd local sKeyWordArray = "" local sUniqueEntryIDArray = "" local sCollect local tCollect local fpath local scindex local sFileNames local tnametypes local tglossmultis local newApi local htmlTop1 local htmlTop2 local htmlBottom local htmlstyles local rStart local rMid local rEnd local docpath local tSQid local docArray local defDocuments local guideArray local tMultiArray local tMultis local tbottom local titop local titend on openstack --test for versions. --has to be above 8.15 but --if 8.2dp2 or 9dp10 then need to use new dictionary algo. put the version into tver put empty into fld "prog" set the itemDelimiter to "." put the item 1 of tver into tver1 put the item 2 of tver into tver2 put the item 3 of tver into tver3 if (tver1 = 8) AND (tver2 = 1) AND (tver3 > 4) then put true into goodToGo if (tver1 = 8) AND (tver2 > 1) then put true into goodToGo if tver1 > 8 then put true into goodToGo if goodtogo then --new dictionary? if (tver1 >= 9) then put true into NewApi else if (tver1 = 8) AND (tver2 > 1) then put true into NewApi if NewApi then if item 3 of tver3 > 1 then put true into NewApi else put false into NewApi end if end if end if set the itemDelimiter to "-" if item 3 of tver3 > 9 then put true into NewApi set the itemDelimiter to "," put the cDfolder of this stack into tdf if tdf is empty then set the defaultfolder to the desktop folder set the cDfolder of this stack to the defaultfolder else set the defaultfolder to tdf end if put the defaultfolder into fld "dpath" put empty into fld "tindex" go to card 1 else go to card 5 end if end openstack on mainloop /* Set up html constants file should be htmlTop1 & page title & htmlTop2 & page body & htmlBottom */ put "" into fld "tindex" --set up style put ""&cr into htmlstyles --setup constants put ""&cr&""&cr&""&cr&""&cr&"" into htmlTop1 put ""&cr&htmlstyles&cr&""&cr&""&cr into htmlTop2 put ""&cr&"" into htmlBottom put "" into rStart put "" into rMid put "" into rEnd put "" into tbottom put "" into titop put "
NameTypeDescription
" into titend set the defaultfolder to the cDfolder of this stack --delete any previous copies put "Creating package structure..." into fld "prog" if there is a folder "LiveCode.docset" then answer "Delete the existing docset?" with "Yes" or "No" if it = "No" then exit to top end if end if revdeletefolder "LiveCode.docset" --create docset structure at the current default folder create folder "LiveCode.docset" create folder "LiveCode.docset/Contents"--defContents create folder "LiveCode.docset/Contents/Resources"--defResources create folder "LiveCode.docset/Contents/Resources/Documents" --defDocuments create folder "LiveCode.docset/Contents/Resources/Documents/images" if there is not a folder "LiveCode.docset" then --package not created" answer "The docset package could not be created." exit to top end if --fill docset --put in the icons set the defaultfolder to the defaultfolder&"/LiveCode.docset" put the defaultfolder into defContents export snapshot from rect "30,-20,46,-4" of image "icon.png" to file "icon.png" as PNG export snapshot from rect "100,-40,132,-8" of image "icon@2x.png" to file "icon@2x.png" as PNG --first in plist set the defaultfolder to the defaultfolder&"/Contents" put the defaultfolder into defContents put fld "plist" of card 2 into url ("file:Info.plist") --make sqlite table set the defaultfolder to the defaultfolder&"/Resources" put the defaultfolder into defResources put revOpenDatabase("sqlite", "docSet.dsidx" ) into tSQid if tSQid is not an integer then answer "index database could not be created" exit to top end if put "CREATE TABLE searchIndex(id INTEGER PRIMARY KEY, name TEXT, type TEXT, path TEXT);" into tsql revExecuteSQL tSQid, tsql set the defaultfolder to the defaultfolder&"/Documents" put the defaultfolder into defDocuments --create the css put fld "css" of card 3 into URL ("binfile:userguide.css") --get the markdown guide files and convert to html --write out the guides put "Constructing the Guides..." into fld "prog" getExtguides getguides --first get the dictionary array and clean up content for html conversion put "Getting dictionary entries..." into fld "prog" if NewApi then getNewDict else GetDict end if extractKeywords --convert entries to html and store in array put "Dictionary entries to HTML..." into fld "prog" put sCompleteDictsArray into sCompleteDictsArray put 1 into tindex put the number of elements of sCompleteDictsArray into ttot repeat for each key kindex in sCompleteDictsArray put tindex & " of " & ttot into fld "tindex" add 1 to tindex put sCompleteDictsArray[kindex]["fname"] into docArray[kindex]["fname"] put composepage(kindex) into docArray[kindex]["fcontent"] end repeat --write out dictionary files put "Writing dictionary entries to disk..." into fld "prog" repeat for each key kindex in docArray put docArray[kindex]["fcontent"] into url ("file:"&docArray[kindex]["fname"]) end repeat --write entries to the sqlite index put "" into fld "tindex" put "Writing keyword index..." into fld "prog" put "Begin Transaction" into tSQL revExecuteSQL tSQid, tsql put "" into dsidx[1] put "" into dsidx[2] put "" into dsidx[3] put "> >= < <= <>" into problemNames repeat for each key kindex in sCompleteDictsArray put sCompleteDictsArray[kindex]["Display Name"] into dsidx[1] --need to correct for <> put sCompleteDictsArray[kindex]["Display Name"] into tempid if tempid is among the words of problemnames then switch case tempid=">" put ">" into dsidx[1] break case tempid=">=" put ">=" into dsidx[1] break case tempid="<" put ">" into dsidx[1] break case tempid="<=" put ">=" into dsidx[1] break case tempid="<>" put "<>" into dsidx[1] break default beep end switch end if put capitalise(sCompleteDictsArray[kindex]["type"]) into dsidx[2] put sCompleteDictsArray[kindex]["fname"] into dsidx[3] put "INSERT OR IGNORE INTO searchIndex(name, type, path) VALUES (:1, :2, :3);" into tSQL revExecuteSQL tSQid,tSQL,"dsidx" end repeat put "COMMIT Transaction" into tSQL revExecuteSQL tSQid, tsql put "End Transaction" into tSQL revExecuteSQL tSQid, tsql put "" into fld "prog" answer "Your docset has been created." end mainloop on GetDict local tDictArray, tMenusBuildA, tKeys, tTitle, tPathToStoredNotes, tNotesEncoded local tAssociation, tSubArray, tKeyWord, t, tLongIDDictA -- build Global Array -- get the whole array of all dictionary entries of all dictionaries dispatch function "ideDocsFetchExtensionData" to stack "revIDEDocumentationLibrary" put the result into sCompleteDictsArray set the itemDelimiter to "." repeat for each key anEntry in sCompleteDictsArray put sCompleteDictsArray[anEntry]["associations"][1] into tAssociation if tAssociation is not an array then -- it is empty, happens for lot of LCS entries and Header of com. and community. entries put sCompleteDictsArray[anEntry]["display Name"] into tKeyWord if tKeyWord = "datagrid" then -- datagrid header entry has no association put tKeyword into sCompleteDictsArray[anEntry]["Dict"] next repeat end if -- this is for entries without associaton then the keyword helps again it is assumed to be a header entry if tKeyWord begins with "com." or tKeyWord begins with "community." then if item - 2 of tKeyWord = "livecode" then -- LCB associations are sub packets of LCB in the form of com.livecode.math put "LCB" into sCompleteDictsArray[anEntry]["Dict"] else -- community widgets have author as item -2 of address e.g. community.livecode.elanor.calendar -- IDE widgets/libraries have kind as item - 2 e.g com.livecode.widget.treeview, com.livecode.library.json put item -2 to - 1 of tKeyWord into sCompleteDictsArray[anEntry]["Dict"] end if next repeat end if end if if tAssociation begins with "com." or tAssociation begins with "community." then if item - 2 of tAssociation = "livecode" then put "LCB" into sCompleteDictsArray[anEntry]["Dict"] else put item - 2 to - 1 of tAssociation into sCompleteDictsArray[anEntry]["Dict"] put 1 into tLongIDDictA[tAssociation] end if next repeat else if tAssociation is "Datagrid" then put "DataGrid" into sCompleteDictsArray[anEntry]["Dict"] next repeat else -- for empty tAssociation or the asscociations of LCS put "LCS" into sCompleteDictsArray[anEntry]["Dict"] next repeat end if end if end repeat --workaround docs errors -- to be removed once errors are fixed. fixdocs --create filename entry and array --filename to include indicator of Type put "Still getting dictionary entries..." into fld "prog" repeat for each key anEntry in sCompleteDictsArray put sCompleteDictsArray[anEntry]["Type"] into ttype replace " " with "_" in ttype put ttype into tnametypes[sCompleteDictsArray[anEntry]["display name"]] put percentURLFake(sCompleteDictsArray[anEntry]["Display Name"]&"_"&sCompleteDictsArray[anEntry]["Dict"]&"_"&ttype&".html") into sCompleteDictsArray[anEntry]["fname"] put sCompleteDictsArray[anEntry]["fname"] into sFileNames[sCompleteDictsArray[anEntry]["Display Name"]] end repeat --need to get a list of multiple keyword entries to ensure default to Glossry put "" into tMultiArray put "" into tMultis repeat for each key anEntry in sCompleteDictsArray if sCompleteDictsArray[anEntry]["Dict"] = "LCS" then add 1 to tMultiArray[sCompleteDictsArray[anEntry]["Display Name"]] end if end repeat repeat for each key anEntry in tMultiArray if tMultiArray[anEntry] > 1 then put anEntry & cr after tMultis end if end repeat if line -1 of tMultis is empty then delete line -1 of tMultis put lineoffset ("Result",tMultis) into tR if tr <> 0 then delete line tr of tMultis sort tMultis ascending put empty into tglossmultis repeat for each key anEntry in sCompleteDictsArray if (sCompleteDictsArray[anEntry]["Dict"] = "LCS") AND (sCompleteDictsArray[anEntry]["type"] = "glossary") then put sCompleteDictsArray[anEntry]["Display Name"] & cr after tglossmultis end if end repeat sort tglossmultis ascending if line -1 of tMultis is empty then delete line -1 of tglossmultis end GetDict on fixdocs /* submission to docset user contributions hilited three errors in the current docs this code is simply a workaround until the errors are corrected. two errors are incorrectly formatted data grid properties. https://github.com/livecode/livecode-ide/pull/1775 */ --find and correct first /*repeat for each key anEntry in sCompleteDictsArray if word 1 of sCompleteDictsArray[anEntry]["Display name"] = "dghilitedLines" then put "dghilitedLines" into sCompleteDictsArray[anEntry]["Display name"] put "dghilitedLine" into sCompleteDictsArray[anEntry]["synonyms"][1] put "property" into sCompleteDictsArray[anEntry]["type"] put "datagrid" into sCompleteDictsArray[anEntry]["Associations"][1] put "set the dgHilitedLines of group ""e&"DataGrid""e&" to pLine" into temp1 put temp1 into sCompleteDictsArray[anEntry]["syntax"][1] put "Returns a comma delimited list of the line numbers that are currently selected." into temp1 put temp1 into sCompleteDictsArray[anEntry]["summary"] put "Returns a comma delimited list of the line numbers that are currently selected." into temp1 put temp1 into sCompleteDictsArray[anEntry]["Description"] exit repeat end if end repeat --find and correct second repeat for each key anEntry in sCompleteDictsArray if word 1 of sCompleteDictsArray[anEntry]["Display name"] = "dgHilitedIndexes" then put "dgHilitedIndexes" into sCompleteDictsArray[anEntry]["Display name"] put "dgHilitedIndex" into sCompleteDictsArray[anEntry]["synonyms"][1] put "property" into sCompleteDictsArray[anEntry]["type"] put "datagrid" into sCompleteDictsArray[anEntry]["Associations"][1] put "set the dgHilitedIndexes of group ""e&"DataGrid""e&" to pIndex" into temp1 put temp1 into sCompleteDictsArray[anEntry]["syntax"][1] put "Returns a comma delimited list of the indexes that are currently selected." into temp1 put temp1 into sCompleteDictsArray[anEntry]["summary"] put "Returns a comma delimited list of the indexes that are currently selected." into temp1 put temp1 into sCompleteDictsArray[anEntry]["Description"] exit repeat end if end repeat */ --find and correct third /* these docs (com.livecode....) actually need to be culled from other entries. via a search on associations entry. */ repeat for each key anEntry in sCompleteDictsArray if sCompleteDictsArray[anEntry]["Display name"] = "com.livecode.language" then put "library" into sCompleteDictsArray[anEntry]["type"] put "This library consists of LCS type statements and structures" into temp1 put temp1 into sCompleteDictsArray[anEntry]["Description"] exit repeat end if end repeat end fixdocs on extractKeywords -- built an array of all display names = Keywords -- helps with hiliting in details field repeat for each key aKey in sCompleteDictsArray put 1 into sKeyWordArray[sCompleteDictsArray[aKey]["Display name"]] end repeat end extractKeywords function populateDetails pkey local tKeyword, tEntryType, tSubArray, tCollectTemp, tTempArray, tType, tAuxArray, tKeys, tSections local tResult, tKeyNumber, tRecord, tDetailsArray put pkey into scindex put sCompleteDictsArray[pKey] into tDetailsArray formatDetails return tCollect end populateDetails function composepage pkey local tKeyword, tEntryType, tSubArray, tCollectTemp, tTempArray, tType, tAuxArray, tKeys, tSections local tResult, tKeyNumber, tRecord, tDetailsArray, local tpage /* order of details (and possible array keys) display name type Dict syntax+ multiple lines Synonyms+ variants Associations+ multiple values on single line Summary Edition Introduced Changes Deprecated OS+ multiple values on single line Platforms+ multiple values on single line params++ multiple lines in table Example+ Value++ multiple lines in table References+ (related)+ multiple lines - keyed Security++ multiple lines description Tags+ multiple values on single line fname rather than resolve array, try reading from it directly */ put ""&cr into htmlstyles --setup constants put empty into tpage put pkey into fld "fkey" ##title --depreciated? put sCompleteDictsArray[pkey]["display name"] into temp if "Depreciated" is among the keys of sCompleteDictsArray[pKey] then put "!! "&temp& " !!" into temp end if put htmltop1&temp&htmltop2&cr into tpage put "
" & toh1(temp) & rEnd & cr after tpage ##type if "Type" is among the keys of sCompleteDictsArray[pKey] then put "Type" into temp1 put sCompleteDictsArray[pkey]["type"] into temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if ##Dict if "Dict" is among the keys of sCompleteDictsArray[pKey] then put "Dictionary" into temp1 put sCompleteDictsArray[pkey]["Dict"] into temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if ##Library if "Library" is among the keys of sCompleteDictsArray[pKey] then put "Library" into temp1 put sCompleteDictsArray[pkey]["Library"] into temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if ##syntax+ multiple lines if "syntax" is among the keys of sCompleteDictsArray[pKey] then if sCompleteDictsArray[pKey]["syntax"] is not empty then put "Syntax" into temp1 put empty into temp2 put sCompleteDictsArray[pKey]["syntax"] into tSubarray repeat for each element aValue in tSubarray --put aValue & cr after tCollectTemp put aValue into temp3 put colorscript(aValue) into temp3 replace "&" with "&" in in temp3 --put "
" before temp3
            --put "
" after temp3 put temp3 & cr after temp2 end repeat delete char - 1 of temp2 --replace "

" with "

" in temp2
         --replace "

" with "
" in temp2 replace "

" with "

" in temp2 replace "

" with "

" in temp2 replace "

" with numTochar(31) in temp2 replace cr& "

" with cr in temp2 replace "

" & cr with cr in temp2 replace numTochar(31) with "

" in temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if end if ##Synonyms+ if "Synonyms" is among the keys of sCompleteDictsArray[pKey] then put "Synonyms" into temp1 put sCompleteDictsArray[pKey]["Synonyms"] into tSubarray put empty into temp2 repeat for each element aValue in tSubarray put aValue & comma after temp2 end repeat delete char - 1 of temp2 -- setlinks? put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if ##variants if "variants" is among the keys of sCompleteDictsArray[pKey] then if sCompleteDictsArray[pkey]["variants"] is not empty then put "Variants" into temp1 put sCompleteDictsArray[pkey]["variants"] into temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if end if ##Associations+ multiple values on single line if "Associations" is among the keys of sCompleteDictsArray[pKey] then put "Associations" into temp1 put sCompleteDictsArray[pKey]["Associations"] into tSubarray put empty into temp2 repeat for each element aValue in tSubarray --need to look up correct link and make it, but to do so --requires knowing type of object being associated. put aValue & comma after temp2 end repeat delete char - 1 of temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if ##Summary if "Summary" is among the keys of sCompleteDictsArray[pKey] then put "Summary" into temp1 put sCompleteDictsArray[pkey]["Summary"] into temp2 put setLinks(temp2) into temp2 put mergMarkdownToXHTML(temp2,true, true, true, false, false, false, false, false) into temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if ##Edition if "Edition" is among the keys of sCompleteDictsArray[pKey] then put "Edition" into temp1 put sCompleteDictsArray[pkey]["Edition"] into temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if ##Introduced if "Introduced" is among the keys of sCompleteDictsArray[pKey] then put "Introduced" into temp1 put sCompleteDictsArray[pkey]["Introduced"] into temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if ##Changes if "Changes" is among the keys of sCompleteDictsArray[pKey] then put "Changes" into temp1 put sCompleteDictsArray[pkey]["Changes"] into temp2 put setLinks(temp2) into temp2 put mergMarkdownToXHTML(temp2,true, true, true, false, false, false, false, false) into temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if ##Deprecated if "Deprecated" is among the keys of sCompleteDictsArray[pKey] then put "Deprecated" into temp1 put sCompleteDictsArray[pkey]["Deprecated"] into temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if ##OS+ multiple values on single line if "OS" is among the keys of sCompleteDictsArray[pKey] then put "OS" into temp1 put sCompleteDictsArray[pKey]["OS"] into tSubarray put empty into temp2 repeat for each element aValue in tSubarray put aValue & comma & space after temp2 end repeat delete char -2 to - 1 of temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if ##Platforms+ multiple values on single line if "Platforms" is among the keys of sCompleteDictsArray[pKey] then put "Platforms" into temp1 put sCompleteDictsArray[pKey]["Platforms"] into tSubarray put empty into temp2 repeat for each element aValue in tSubarray put aValue & comma & space after temp2 end repeat delete char -2 to - 1 of temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if ##params++ multiple lines in table local tpKeys, tmorekeys,tEnums, tname, tdescrip if "params" is among the keys of sCompleteDictsArray[pKey] then put sCompleteDictsArray[pKey]["params"] into tSubarray if tSubarray is not empty then put "Parameters" into temp1 put empty into temp2 put the keys of tSubarray into tpkeys if tpKeys is not empty then sort tpKeys numeric put empty into tCollectParams repeat for each line aSubKey in tpKeys--want specific order here put tSubarray[aSubKey]["name"] into tname put tSubarray[aSubKey]["type"] into ttType --if tSubarray[aSubKey]["description"] is not empty then --process description put tSubarray[aSubKey]["description"] into tDescrip --end if put setLinks(tDescrip) into tDescrip put mergMarkdownToXHTML(tDescrip,true, true, true, false, false, false, false, false) into tDescrip put the keys of tSubarray[aSubKey] into tmorekeys--check if enums present put empty into tAenum if "enum" is among the lines of tmorekeys then --process enums and add to description put the keys of tSubarray[aSubKey]["enum"] into tEnums delete char - 1 of tDescrip sort tEnums numeric repeat for each line aEnum in tEnums put tobold(tSubarray[aSubKey]["enum"][aEnum]["value"] & ": ") into kenum put kenum & tSubarray[aSubKey]["enum"][aEnum]["description"] & "
" & cr after tAenum end repeat put tAenum & cr after tDescrip end if if tSubarray[aSubKey]["refparam"] <> "false" then put "Refparam is true???" & cr after tDescrip end if --ok we have a param, now put it into a table. put rStart & tname & rmid & ttype & rmid & tDescrip & rend & cr after tCollectParams end repeat put titop & tCollectParams & titend into temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if end if end if ##Example+ if "Example" is among the keys of sCompleteDictsArray[pKey] then put "Example" into temp1 put empty into temp2 put sCompleteDictsArray[pKey]["Example"] into tSubarray repeat for each element aValue in tSubarray --put aValue & cr after tCollectTemp --reinstate <> put aValue into temp3 put colorscript(aValue) into temp3 replace "&" with "&" in in temp3 --put "
" before temp3
         --put "
" after temp3 put temp3 & cr after temp2 end repeat delete char - 1 of temp2 replace "

" with "

" in temp2 replace "

" with "

" in temp2 replace "

" with numTochar(31) in temp2 replace cr& "

" with cr in temp2 replace "

" & cr with cr in temp2 replace numTochar(31) with "

" in temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if ##Value++ multiple lines in table ##params++ multiple lines in table --local tpKeys, tmorekeys,tEnums, tname, tdescrip if "value" is among the keys of sCompleteDictsArray[pKey] then put sCompleteDictsArray[pKey]["value"] into tSubarray if tSubarray is not empty then put "Values" into temp1 put empty into temp2 put the keys of tSubarray into tpkeys if tpKeys is not empty then sort tpKeys text put empty into tCollectParams repeat for each line aSubKey in tpKeys--want specific order here put aSubKey into tname put tSubarray[aSubKey]["type"] into ttType put tSubarray[aSubKey]["description"] into tDescrip put setLinks(tDescrip) into tDescrip put mergMarkdownToXHTML(tDescrip,true, true, true, false, false, false, false, false) into tDescrip put the keys of tSubarray[aSubKey] into tmorekeys--check if enums present if "enum" is among the lines of tmorekeys then --process enums and add to description put the keys of tSubarray[aSubKey]["enum"] into tEnums delete char - 1 of tDescrip sort tEnums numeric put empty into tAenum repeat for each line aEnum in tEnums put tobold(tSubarray[aSubKey]["enum"][aEnum]["value"] & ": ") after tAenum put kenum & tSubarray[aSubKey]["enum"][aEnum]["description"] & "
" & cr after tAenum end repeat put tAenum & cr after tDescrip end if --ok we have a value, now put it into a table. put rStart & tname & rmid & ttype & rmid & tDescrip & rend & cr after tCollectParams end repeat put titop & tCollectParams & titend into temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if end if end if ##References+ (related)+ multiple lines - keyed if "References" is among the keys of sCompleteDictsArray[pKey] then put "Related" into temp1 put empty into temp2 put sCompleteDictsArray[pKey]["Dict"] into tWhichDict put sCompleteDictsArray[pKey]["References"] into tSubarray repeat for each key aKey in tSubarray put tobold(capitalise(aKey)) & ": " after temp2 put aKey into ttype put the keys of tSubarray[aKey] into tKeys sort tKeys numeric repeat for each line aSubKey in tKeys put tSubarray[ttype][aSubKey] into xtemp put percentURLFake(xtemp & "_" & tWhichDict & "_" & tType) & ".html" into tlinkfname put ""& xtemp &"" & comma & space after temp2 end repeat delete char - 2 to - 1 of temp2 put "
" & cr after temp2 end repeat delete char - 1 of temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if ##Security++ multiple lines if "Security" is among the keys of sCompleteDictsArray[pKey] then put "Security" into temp1 put sCompleteDictsArray[pKey]["Security"] into tSubarray put empty into temp2 repeat for each element aValue in tSubarray put aValue & comma & space after temp2 end repeat delete char -2 to - 1 of temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if ##description if "description" is among the keys of sCompleteDictsArray[pKey] then put "Description" into temp1 put sCompleteDictsArray[pkey]["description"] into temp2 put setLinks(temp2) into temp2 put mergMarkdownToXHTML(temp2,true, true, true, false, false, false, false, false) into temp2 --put checkForCode(temp2) into temp2 put DoBlocks(temp2) into temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if ##Tags+ multiple values on single line if "Tags" is among the keys of sCompleteDictsArray[pKey] then put "Tags" into temp1 put sCompleteDictsArray[pKey]["Tags"] into tSubarray put empty into temp2 repeat for each element aValue in tSubarray put aValue & comma after temp2 end repeat delete char - 1 of temp2 put rStart & toBold(temp1) & rMid & temp2 & rEnd & cr after tpage end if put tbottom after tpage --for library entries, look up all commands from that library and summaraize. -- need to include widgets, modules and objects ( datagrid does not have an entry so no page to group) if (sCompleteDictsArray[pkey]["type"] = "library") OR (sCompleteDictsArray[pkey]["type"] = "widget") OR \ (sCompleteDictsArray[pkey]["type"] = "object") OR (sCompleteDictsArray[pkey]["type"] = "module") OR \ (sCompleteDictsArray[pkey]["display name"] is "datagrid")then if "synonym" is not among the truewords of sCompleteDictsArray[tKey]["display name"] then put composeSummary(pkey) after tpage end if end if --for object entries, look up all entries associated with that object and summaraize. -- need to include widgets ( datagrid does not have an entry so no page to group) -- if (sCompleteDictsArray[pkey]["type"] = "object") then -- if "synonym" is not among the truewords of sCompleteDictsArray[tKey]["display name"] then -- put composeSummary(pkey) after tpage -- end if -- end if put htmlbottom after tpage return tpage end composepage function composeSummary pLib --for library entries, look up all commands from that library and summaraize. -- need to include widgets ( datagrid does not have an entry so no page to group) --need to grab all records where the lib entry matches'local tempIndex --set up table constanys put "" into tiStop put sCompleteDictsArray[pLib]["display name"] into tlibrary --the library entries to find. put the keys of sCompleteDictsArray into thesekeyes put the number of lines of thesekeyes into tlines put empty into titems put empty into tempPage repeat for each line pKey in the keys of sCompleteDictsArray put sCompleteDictsArray[pKey]["associations"] into sAssociationsA if sCompleteDictsArray[pKey]["library"] = tlibrary then --we have alternate library link put sCompleteDictsArray[pKey]["type"] into slibType put sCompleteDictsArray[pKey]["display name"] into sLibItemName put slibType & comma & sLibItemName & comma & pKey & cr after titems end if if sAssociationsA is not an array then next repeat --in the library mentioned repeat for each element telement in sAssociationsA if tlibrary = telement then --we have a match put sCompleteDictsArray[pKey]["type"] into slibType put sCompleteDictsArray[pKey]["display name"] into sLibItemName put slibType & comma & sLibItemName & comma & pKey & cr after titems end if end repeat end repeat -- titems now lists all associated entries for this library/widget sort lines of titems by item 2 of each sort lines of titems by item 1 of each --item 3 is the index so just go through the list in order getting info from item 3 put empty into headtype repeat for each line theitem in titems put empty into temp2 put empty into temp3 put item 3 of theitem into itemindex put item 1 of theitem into slibType if sCompleteDictsArray[itemindex]["syntax"] is not empty then put sCompleteDictsArray[itemindex]["syntax"] into tSubarray repeat for each element aValue in tSubarray put aValue into temp3 put colorscript(aValue) into temp3 replace "&" with "&" in in temp3 put temp3 & cr after temp2 end repeat delete char - 1 of temp2 put temp2 into sLibsyntax end if put empty into temp2 put sCompleteDictsArray[itemindex]["Summary"] into temp2 put setLinks(temp2) into temp2 put mergMarkdownToXHTML(temp2,true, true, true, false, false, false, false, false) into temp2 put temp2 into sLibSummary if slibType = headtype then put "- - -" into itemtype else put slibType into headtype put tobold(slibType) into itemtype end if --end if put sCompleteDictsArray[itemindex]["display name"] into sLibItemName put sCompleteDictsArray[itemindex]["fname"] into sLibfname put "" & sLibItemName & "" into sLibLink put rStart & itemtype & rMid & sLibLink & rMid & sLibSummary & rMid & sLibsyntax & rEnd & cr after tempPage end repeat if tempPage is empty then return "" put tiStop & tempPage & titend into sumpage --return assembled table return sumpage end composeSummary function checkForCode ptext --look for blocks and run any found through colorscritpt local tholding, t1, t2, tcode put empty into tholding repeat put lineOffset("
", ptext) into t1
      if t1 > 0 then
         put line 1 to t1-1 of ptext after tholding
         delete line 1 to t1-1 of ptext
         put lineoffset("
", ptext) into t2 put line 1 to t2 of ptext into tcode replace "
" with "" in tcode
         replace "
" with "" in tcode put colorscript(tcode) into tcode put "
" & tcode &  "
" into tcode replace "

" with "" in tcode replace "

" with "" in tcode replace "&" with "&" in in tcode put tcode & cr after tholding delete line 1 to t2 of ptext else --we are done here, tack on remainder put ptext after tholding exit repeat end if end repeat return tholding end checkForCode function QuoteBlocks pDBtext --find the blockquote text blocks. --text has been through mergMarkDownToHtml so text blcks will have tags put "
" into tBQStart put "
" into tBQEnd put empty into temp2 repeat with sALine = 1 to the number of lines of pDBtext --step through description and identify blocks to be blockquoted put empty into tx Switch case word 1 of line sALine of pDBtext = "

Note:" put tBQStart & cr after temp2 put true into InBlock put char 18 to -1 line sAline of pDBtext into tx put tobold("Note:") & tx & cr after temp2 break case word 1 of line sALine of pDBtext = "

Tip:" put tBQStart & cr after temp2 put true into InBlock put char 17 to -1 line sAline of pDBtext into tx put tobold("Tip:") & tx & cr after temp2 break case word 1 of line sALine of pDBtext = "

Important:" put tBQStart & cr after temp2 put true into InBlock put char 23 to -1 line sAline of pDBtext into tx put tobold("Important:") & tx & cr after temp2 break case word 1 of line sALine of pDBtext = "

Warning:" put tBQStart & cr after temp2 put true into InBlock put char 21 to -1 line sAline of pDBtext into tx put tobold("Warning:") & tx & cr after temp2 break case word 1 of line sALine of pDBtext = "

Warning:" put tBQStart & cr after temp2 put true into InBlock put char 13 to -1 line sAline of pDBtext into tx put toitalic(tobold("Warning:")) & tx & cr after temp2 break case word 1 of line sALine of pDBtext = "

Cross-platform" put tBQStart & cr after temp2 put true into InBlock put char 33 to -1 line sAline of pDBtext into tx put tobold("Cross-platform note:") & tx & cr after temp2 break case (line sALine of pDBtext = "
") OR (line sALine of pDBtext = "") --blank close blockquote if InBlock then put tBQEnd & cr after temp2 put false into InBlock else put "
"&cr after temp2 end if break default --normal line just add it put line sAline of pDBtext & cr after temp2 end Switch end repeat return temp2 end QuoteBlocks function embolden ptext local tpre,tmid,tend,tdone --set the text of any quoted words to bold --need to ensure links are not effected so two passes, --one for space-quote and one for quote-space -- first pass put " ""e into sq put offset(quote,ptext) into tfquote if tfquote = 0 then return ptext --nothing to do, send it back put offset(quote,ptext,tfquote+1) into tNquote if tfquote = tNquote then return ptext--only 1?? put tfquote+tNquote+1 into tsquote put char 1 to tfquote-1 of ptext into tpre put char tfquote+1 to tsquote-1 of ptext into tmid put char tsquote+1 to -1 of ptext into tend if (char tfquote-1 of ptext = "=") OR (char tNquote+1 of ptext = ">") then --this is a link, just ignore put tpre & tmid & tend into tdone else --this is ok put tpre & tobold(tmid) & tend into tdone end if return embolden(tdone) end embolden function setLinks pTextToLink local tData, tWhichDict, tKeyWord, tType, tHTML, tOldDelim, tText, tText2, tSectionEnd, tSubOffset local tOffset, tSkip, tOffset2, tBegin, tEnd, tUnpaired, tEntry, tLt, tGt, tBeginType, tEndType, tPipe local tNewLength, tOldLength --modified to be called as required. if sKeywordArray is not an array then extractKeyWords put numTochar(31) into tSectionEnd put "LCS" into tWhichDict --because we are usung a variable rather than a field we do not want to mix <> from dictionary with html tags. -- put sCollect into tData --put "<" into tLt; put ">" into tGt put numtoNativeChar(1) into tLt; put numtoNativeChar(2) into tGt --put sCollect into tData put pTextToLink into tData --some entries use ">" at the start of a line to denote something special --this is a real pain and needs to be removed replace cr&"> " with cr in tData replace "<" with tLt in tData replace ">" with tGt in tData put word 1 tData into tEntry replace numToChar(31) with "" in tEntry put 0 into tSkip repeat -- find "<" put Offset(tLt, tData, tSkip) into tOffset if tOffset = 0 then exit repeat put tOffset + tSkip into tBegin -- find ">" put Offset(tGt, tData, tBegin) + tBegin into tEnd put char tBegin to tEnd of tData into tText replace cr with "" in tText -- some have returns due to hardwrapping put tEnd into tSkip -- find "<" before above ">" i.e. an unmatched pair, most likely not a markup put offset(tLt, tData, tBegin) into tOffset2 if tOffset2 <> 0 And tOffset2 + tBegin < tEnd then put tBegin + tOffset into tSkip next repeat end if put length(tText) into tOldLength put "" into tKeyWord put "" into tType -- find markups with "|" pipe of type or if tText contains "|" then put offset("(", tText) into tSubOffset if tSubOffset <> 0 then -- contains "(" like in put tSubOffset into tBeginType put offset(")", tText) into tSubOffset put tSubOffset into tEndType put char 2 to tBeginType - 1 of tText into tKeyWord -- check against keywordArray, if not then bail out, LCB formats differently if sKeywordArray[tKeyWord] <> 1 then put tEnd into tSkip next repeat end if put char tBeginType + 1 to tEndType - 1 of tText into tType put offset ("|", tText) into tPipe put char tPipe + 1 to the number of chars of tText - 1 of tText into tText put length(tText) into tNewLength put tText into char tBegin to tEnd of tData -- keep tData in sync with field put tText into char tBegin to tEnd of sCollect if sKeywordArray[tKeyWord] = 1 then -- check it is a valid entry --construct link --test2 put char 1 to tBegin -1 of tData into ftext put char tBegin + tNewLength to -1 of tData into etext put percentURLFake(tKeyword & "_" & tWhichDict & "_" & tType) & ".html" into tlinkfname put ""&tText&"" into tlink put ftext&tlink&etext into tData end if put tBegin + 1 into tSkip next repeat else -- contains e.g. put offset ("|", tText) into tPipe put char 2 to tPipe - 1 of tText into tKeyWord -- check against keywordArray, if not then bail out, LCB formats differently if sKeywordArray[tKeyWord] <> 1 then put tEnd into tSkip next repeat end if --get type - this format is not used for multipl entries hence lookuip will be unique if tKeyWord is among the lines of tMultis then if tKeyWord is among the lines of tglossmultis then put "glossary" into tType else next repeat end if else # condition put tnametypes[tKeyWord] into tType end if # condition put char tPipe + 1 to the number of chars of tText - 1 of tText into tText put length(tText) into tNewLength put tText into char tBegin to tEnd of tData -- keep tData in sync with field put tText into char tBegin to tEnd of sCollect if sKeywordArray[tKeyWord] = 1 then -- check it is a valid entry --construct link --test2 put char 1 to tBegin -1 of tData into ftext put char tBegin + tNewLength to -1 of tData into etext put percentURLFake(tKeyword & "_" & tWhichDict & "_" & tType) & ".html" into tlinkfname put ""&tText&"" into tlink put ftext&tlink&etext into tData end if put tBegin + 1 into tSkip next repeat end if end if -- find markUps of type or if tText contains "(" then put offset("(", tText) into tSubOffset if tSubOffset <> 0 then -- contains "(" like in put tSubOffset into tBeginType put offset(")", tText) into tSubOffset put tSubOffset into tEndType put char 2 to tBeginType - 1 of tText into tKeyWord -- check against keywordArray, if not then bail out, LCB formats differently if sKeywordArray[tKeyWord] <> 1 then put tEnd into tSkip next repeat end if put char tBeginType + 1 to tEndType - 1 of tText into tType put tKeyWord into tText put length(tText) into tNewLength put tText into char tBegin to tEnd of tData -- keep tData in sync with field put tText into char tBegin to tEnd of sCollect if sKeywordArray[tKeyWord] = 1 then -- check it is a valid entry --construct link --test2 put char 1 to tBegin -1 of tData into ftext put char tBegin + tNewLength to -1 of tData into etext put percentURLFake(tKeyword & "_" & tWhichDict & "_" & tType) & ".html" into tlinkfname put ""&tKeyword&"" into tlink put ftext&tlink&etext into tData end if put tBegin + 1 into tSkip next repeat end if else -- like in put char 2 to - 2 of tText into tKeyWord put tKeyWord into tText put length(tText) into tNewLength if tNewLength = 0 then next repeat -- case "<>" as in not equal -> pass it if tText is among the items of "<=,>=" then next repeat put tText into char tBegin to tEnd of tData -- keep tData in sync with field put tText into char tBegin to tEnd of sCollect if tText = tEntry then --construct bold --test2 put char 1 to tBegin -1 of tData into ftext put char tBegin + tNewLength to -1 of tData into etext put ""&tText&"" into tlink put ftext&tlink&etext into tData put tBegin + 1 into tSkip next repeat else if sKeywordArray[tText] = 1 then -- check it is a valid entry --construct link --test2 --get type - this format is not used for multipl entries hence lookuip will be unique if tKeyWord is among the lines of tMultis then if tKeyWord is among the lines of tglossmultis then put "glossary" into tType else next repeat end if else # condition put tnametypes[tKeyWord] into tType end if # condition put char 1 to tBegin -1 of tData into ftext put char tBegin + tNewLength to -1 of tData into etext put percentURLFake(tKeyword & "_" & tWhichDict & "_" & tType) & ".html" into tlinkfname put ""&tKeyword&"" into tlink put ftext&tlink&etext into tData else --construct bold --test2 put char 1 to tBegin -1 of tData into ftext put char tBegin + tNewLength to -1 of tData into etext put ""&tText&"" into tlink put ftext&tlink&etext into tData end if put tBegin + 1 into tSkip next repeat end if end if end repeat --put tData into sCollect return tData end setLinks private function replaceHTML pHTML local tIntro put char 1 to offset(">", pHTML) of pHTML into tIntro -- remove repetitive start replace tIntro with "" in pHTML put tIntro before pHTML -- reinstate start at begin replace "

" with " " in pHTML -- remove line breaks put "

" into char - 5 to - 1 of pHTML -- close with line breaks return pHTML end replaceHTML ########################### on utilities -- utility scripts end utilities function DoBlocks pDBtext -- pDBtext = text block to process local tHTML, tDescriptionBegin, tBQStart, tBQEnd local ttempcollect,tx local headword -- set up placeholders andlocal variables put "
" into tBQStart put "
" into tBQEnd put "" into temp2 put false into InBlock put false into InPre --first identify any blockquote like lines put empty into tholding /* need to rework the block code. getting lost somehow. 1 find start 2. move begin to start -1 to buffer 3 find end of block 4 format block 5 move block to buffer 6 delete up to end of block from text to search 7 once complete move buffer to text to search */ repeat put lineOffset("

*Note:*", pDBtext) into t1 if t1 > 0 then put line 1 to t1-1 of pDBtext after tholding delete line 1 to t1-1 of pDBtext put lineOffset("

", pDBtext) into t2 put line 1 of pDBtext into thead put char 12 to -1 of thead into trest put "

" & tobold("Note:") & trest into thead put line 2 to t2 of pDBtext into tbq put tBQStart & thead & cr & tbq & tBQEnd & cr after tholding delete line 1 to t2 of pDBtext else --we are done here, tack on remainder put pDBtext after tholding put true into tholdfull exit repeat end if end repeat if tholdfull then --we have processed and filled the buffer, time to exchange it. put tholding into pDBtext put false into tholdfull put empty into tholding end if repeat put lineOffset("

*Tip:*", pDBtext) into t1 if t1 > 0 then put line 1 to t1-1 of pDBtext after tholding delete line 1 to t1-1 of pDBtext put lineOffset("

", pDBtext) into t2 put line 1 of pDBtext into thead put char 11 to -1 of thead into trest put "

" & tobold("Tip:") & trest into thead put line 2 to t2 of pDBtext into tbq put tBQStart & thead & cr & tbq & tBQEnd & cr after tholding delete line 1 to t2 of pDBtext else --we are done here, tack on remainder put pDBtext after tholding put true into tholdfull exit repeat end if end repeat if tholdfull then --we have processed and filled the buffer, time to exchange it. put tholding into pDBtext put false into tholdfull put empty into tholding end if repeat put lineOffset("

*Important:*", pDBtext) into t1 if t1 > 0 then put line 1 to t1-1 of pDBtext after tholding delete line 1 to t1-1 of pDBtext put lineOffset("

", pDBtext) into t2 put line 1 of pDBtext into thead put char 17 to -1 of thead into trest put "

" & tobold("Important:") & trest into thead put line 2 to t2 of pDBtext into tbq put tBQStart & thead & cr & tbq & tBQEnd & cr after tholding delete line 1 to t2 of pDBtext else --we are done here, tack on remainder put pDBtext after tholding put true into tholdfull exit repeat end if end repeat if tholdfull then --we have processed and filled the buffer, time to exchange it. put tholding into pDBtext put false into tholdfull put empty into tholding end if repeat put lineOffset("

*Warning:*", pDBtext) into t1 if t1 > 0 then put line 1 to t1-1 of pDBtext after tholding delete line 1 to t1-1 of pDBtext put lineOffset("

", pDBtext) into t2 put line 1 of pDBtext into thead put char 15 to -1 of thead into trest put "

" & tobold("Warning:") & trest into thead put line 2 to t2 of pDBtext into tbq put tBQStart & thead & cr & tbq & tBQEnd & cr after tholding delete line 1 to t2 of pDBtext else --we are done here, tack on remainder put pDBtext after tholding put true into tholdfull exit repeat end if end repeat if tholdfull then --we have processed and filled the buffer, time to exchange it. put tholding into pDBtext put false into tholdfull put empty into tholding end if repeat put lineOffset("

**Warning:**", pDBtext) into t1 if t1 > 0 then put line 1 to t1-1 of pDBtext after tholding delete line 1 to t1-1 of pDBtext put lineOffset("

", pDBtext) into t2 put line 1 of pDBtext into thead put char 17 to -1 of thead into trest put "

" & tobold("Warning:") & trest into thead put line 2 to t2 of pDBtext into tbq put tBQStart & thead & cr & tbq & tBQEnd & cr after tholding delete line 1 to t2 of pDBtext else --we are done here, tack on remainder put pDBtext after tholding put true into tholdfull exit repeat end if end repeat if tholdfull then --we have processed and filled the buffer, time to exchange it. put tholding into pDBtext put false into tholdfull put empty into tholding end if repeat put lineOffset("

*Cross-platform:*", pDBtext) into t1 if t1 > 0 then put line 1 to t1-1 of pDBtext after tholding delete line 1 to t1-1 of pDBtext put lineOffset("

", pDBtext) into t2 put line 1 of pDBtext into thead put char 27 to -1 of thead into trest put "

" & tobold("Cross-platform:") & trest into thead put line 2 to t2 of pDBtext into tbq put tBQStart & thead & cr & tbq & tBQEnd & cr after tholding delete line 1 to t2 of pDBtext else --we are done here, tack on remainder put pDBtext after tholding put true into tholdfull exit repeat end if end repeat if tholdfull then --we have processed and filled the buffer, time to exchange it. put tholding into pDBtext put false into tholdfull put empty into tholding end if --return "blocked text" put empty into temp2 --apply some styling conventions -- words in between double asterisks like **On Linux systems** (convert to "`" replace "**" with "`" in pDBtext -- Now catch ```, "``", "`" used in LCB to hilite script elements and -- as these are not used for anything else convert them all to single ` replace "```" with "``" in pDBtext replace "``" with "`" in pDBtext put 0 into tOffset put 0 into tBegin put 0 into tSkipChars put 0 into tSkip2 put "`" into ttick put "" into temp1 put "" into temp2 put "" into temp3 repeat put Offset( ttick, pDBtext, tSkipChars) into tOffset if tOffset <> 0 then put tOffset + tSkipChars into tBegin put "" into tEnd put tBegin into tSkip2 put offset(ttick,pDBtext,tSkip2) into tOff2 if tOff2 <> 0 then put tOff2 + tSkip2 into tEnd put char 1 to tbegin -1 of pDBtext into temp1 put char tbegin +1 to tEnd-1 of pDBtext into temp2 put char tEnd+1 to -1 of pDBtext into temp3 put temp1 & tobold(temp2) & temp3 into pDBtext else exit repeat end if else exit repeat end if end repeat -- end catch ```,``,`,** --now bold "word:" repeat with x = 1 to the number of lines in pDBtext if the last char of (word 1 of line x of pDBtext) = ":" then put ""& word 1 of line x of pDBtext & "" into word 1 of line x of pDBtext end if end repeat return pDBtext end DoBlocks function addbr ptext --adds a
to the end of each line in pText put the number of lines in ptext into tIndex repeat with x = 1 to tIndex put "
" & cr after line x of ptext end repeat return pText end addbr function toboldcolons ptext put offset(":",ptext) into tcolon if tcolon <>0 then put char 1 to tcolon of ptext into tbold put char tcolon +1 to -1 of ptext into trest put ""& tbold &"" into t1 return t1&trest else return ptext end if end toboldcolons function colorscript ptoken --use SE utils to colorise syntax --ptoken is the syntax to colorise -- color field -> fld "fToColor" local thtml put ptoken into fld "fToColor" _internal script colorize char 1 to (the number of chars in field "fToColor") of field "fToColor" --dispatch "revSEColorizeField" to stack "revSEUtilities" with the long id of field "fToColor" of this stack --now need to convert the html to use css put the htmltext of fld "fToColor" into thtml --from the IDE replace "" with "" in thtml replace "" with "" in thtml replace "" with "" in thtml replace "" with "" in thtml replace "" with "" in thtml replace "" with "" in thtml replace "" with "" in thtml replace "" with "" in thtml --return colorised text return thtml end colorscript function capitalise ptext put toLower(ptext) into ptext put toUpper(char 1 of ptext) into char 1 of ptext repeat with n = 2 to the number of words of ptext put word n of ptext into tWord put toUpper(char 1 of word n of ptext) into char 1 of word n of ptext end repeat return ptext end capitalise function percentURL ptext if char 1 of ptext = "." then put "_" into char 1 of ptext --replace " " with "%20" in ptext replace quote with "%22" in ptext --replace "#" with "%23" in ptext replace "%" with "%25" in ptext replace "-" with "%2D" in ptext replace "," with "%2C" in ptext replace "+" with "%2B" in ptext --replace "`" with "%60" in ptext replace "$" with "%24" in ptext replace "&" with "%26" in ptext replace "(" with "%28" in ptext replace ")" with "%29" in ptext replace "*" with "%2A" in ptext replace ";" with "%3B" in ptext replace "/" with "%2F" in ptext replace "@" with "%40" in ptext replace "[" with "%5B" in ptext replace "]" with "%5D" in ptext replace ":" with "%3A" in ptext replace ";" with "%3B" in ptext replace "=" with "%3D" in ptext replace "/" with "%2F" in ptext replace "\" with "%5C" in ptext replace ">" with "%3E" in ptext replace "<" with "%3C" in ptext replace "^" with "%5E" in ptext return ptext end percentURL function percentURLFake ptext --need to ensure filenames remain as they are when included in a href if char 1 of ptext = "." then put "_" into char 1 of ptext replace " " with "_" in ptext replace quote with "_22" in ptext replace "#" with "_23" in ptext replace "%" with "_25" in ptext replace "-" with "_2D" in ptext replace "," with "_2C" in ptext replace "+" with "_2B" in ptext replace "`" with "_60" in ptext replace "$" with "_24" in ptext replace "&" with "_26" in ptext replace "(" with "_28" in ptext replace ")" with "_29" in ptext replace "*" with "_2A" in ptext replace ":" with "_3A" in ptext replace ";" with "_3B" in ptext replace "/" with "_2F" in ptext replace "@" with "_40" in ptext replace "[" with "_5B" in ptext replace "]" with "_5D" in ptext replace "=" with "_3D" in ptext replace "/" with "_2F" in ptext replace "\" with "_5C" in ptext replace ">" with "_3E" in ptext replace "<" with "_3C" in ptext replace "^" with "_5E" in ptext return ptext end percentURLFake function tobold ptext return ""&ptext&"" end tobold function toitalic ptext return ""&ptext&"" end toitalic function toh1 ptext return "

"&ptext&"

" end toh1 function toh2 ptext return "

"&ptext&"

" end toh2 on testme getdict repeat for each key kindex in sCompleteDictsArray put sCompleteDictsArray[kindex]["Display Name"] into dsidx[1] --need to correct for <> if dsidx[1] is among the words of problemNames then switch dsidx[1] case dsidx[1]=">" put ">" into dsidx[1] break case dsidx[1]=">=" put ">=" into dsidx[1] break case dsidx[1]="<" put ">" into dsidx[1] break case dsidx[1]="<=" put ">=" into dsidx[1] break case dsidx[1]="<>" put "<>" into dsidx[1] break end switch end if put capitalise(sCompleteDictsArray[kindex]["type"]) into dsidx[2] put sCompleteDictsArray[kindex]["fname"] into dsidx[3] put "INSERT OR IGNORE INTO searchIndex(name, type, path) VALUES (:1, :2, :3);" into tSQL revExecuteSQL tSQid,tSQL,"dsidx" end repeat end testme ########################### ### get guides #### ### As of LC 9.01 we now have another source for documentation - the widget package itself. ### This will require a more complicated arrangment as each widget has its own image ### folder and thus can possibly duplicate image names. on getExtGuides --(thanks Ali) put revIDEExtensionDocsData() into tExtensionDocsDataA /* tExtensionDocsDataA is an index based array where each element is an array with the following keys. folder source_file source_type name title author The structure of folder with docs is: /docs/guide ->guide.md /docs/guide/images - > image files simplest solution is to prefix image folder with associated array index and modify each .md file. --replace "images/" with key&"images/" in xx.md */ local tFolder repeat for each key ExtKey in tExtensionDocsDataA local tGuideFile put tExtensionDocsDataA[ExtKey] into tExtensionData put tExtensionData["folder"] into tFolder put "/docs/guide" after tFolder put tFolder & slash & "guide.md" into tGuideFile if there is not a file tGuideFile then -- we have no guide for this extension next repeat end if --ok we have a guide file. --copy image folde to new image folder put files(tFolder & "/images") into temp put ExtKey & "images" into newImagef create folder (defDocuments & "/" & newImagef) repeat for each line fline in temp put url ("binfile:"& tFolder & "/images" & "/" &fline) into URL ("binfile:" & defDocuments & "/" & newImagef & "/" & fline) put the result into ttemp end repeat --load the guide file put textdecode(URL ("binfile:"& tGuideFile), "UTF8") into theguide --change image refs put "(" & ExtKey & "images/" into newImage replace "(images/" with newImage in theguide --adjust table markdown to be more friendly put fixtable(theguide) into theguide --make html file put mergMarkdownToXHTML(theguide, True, True, True, True, True, True, True, false) into theHTML put processhtml(theHTML) into theHTML --fix html and fill array --get title put tExtensionData["title"] into tTitle --get group put "Extensions" into tGroup --top and tail HTML and inject stylesheet ref put htmltop1&tTitle&htmlTop2&cr before theHTML put cr & htmlBottom after theHTML --write the array entries put tExtensionData["name"]&".html"into guideArray[tTitle]["fname"] put tGroup into guideArray[tTitle]["group"] put theHTML into guideArray[tTitle]["content"] --write the file put theHTML into URL ("binfile:" & guideArray[tTitle]["fname"]) end repeat end getExtGuides function fixtable themarkdown --the markdown in the guides for tables is flawed put 1 into tTableoffset repeat put lineoffset("|  ",themarkdown, tTableoffset) into tTableSt --only catches tables without headers if tTableSt <> 0 then --count columns put line tTableSt+tTableoffset of themarkdown into tHeader put 0 into toff put 0 into tcols repeat with x = 1 to 100 put offset("|",tHeader,toff) into tpipe if tpipe <> 0 then add 1 to tcols add tpipe to toff else exit repeat end if end repeat --construct replacement line put empty into tReplace repeat with x = 1 to tcols put "|---" after tReplace end repeat put char 1 to -4 of tReplace into tReplace --put line (tTableSt+tTableoffset+1) of themarkdown put tReplace into line (tTableSt+tTableoffset+1) of themarkdown add tTableSt to tTableoffset else exit repeat end if end repeat return themarkdown end fixtable function processhtml temptext local tlink1 local tlink2 put "" into tlink2 --put top stuff away put lineoffset("

",temptext) into lnum put line 1 to lnum of temptext & cr into tbuffer delete line 1 to lnum of temptext --process remainder repeat --locate heading --put lineoffset("

",temptext) into lnum put lineoffset("" into thead1 put "" into thead2 put thead1 & tlink1 & tEntryName & tlink2 & theading & thead2 & cr into temp put temp after tbuffer delete line 1 of temptext end repeat --all done, put it back return tbuffer end processhtml on getGuides local theguide local tIndex local theHTML local temp local tgroupLine, ttitleLine local tbuffer, lnum,temptext --copy over image files put files(revIDESpecialFolderPath("IDE")&"/Documentation/guides/images") into temp repeat for each line fline in temp put url ("binfile:"& (revIDESpecialFolderPath("IDE")&"/Documentation/guides/images")&"/"&fline) into URL ("binfile:"& "images/" & fline) end repeat put files(revIDESpecialFolderPath("IDE")&"/Documentation/guides") into temp --remove the YAML file filter lines of temp without "guide-order.yml" --process each guide file put 1 into tIndex repeat for each line fline in temp put textdecode(URL ("binfile:"& (revIDESpecialFolderPath("IDE")&"/Documentation/guides")&"/"&fline), "UTF8") into theguide --get just the file name put char 1 to -4 of fline into thisfname --adjust table markdown to be more friendly put fixtable(theguide) into theguide --make html file put mergMarkdownToXHTML(theguide, True, True, True, True, True, True, True, false) into theHTML put processhtml(theHTML) into theHTML --fix release notes reference if fline="Release Notes.md" then --make specific entry put "Release_Notes"&".html" into guideArray["Release Notes"]["fname"] put "Other" into guideArray["Release Notes"]["group"] put theHTML into guideArray["Release Notes"]["content"] else --correctly formatted file --get title put lineoffset("

",theHTML) into ttitleLine put line ttitleLine of theHTML into tTitle put offset("

",tTitle) into tOpenH1 put offset("

",tTitle) into tCloseH1 put char tOpenH1+4 to tCloseH1-1 of tTitle into tTitle --get group put lineoffset("group: ",theHTML) into tgroupLine put line tgroupLine of theHTML into tGroup put offset(": ",tGroup) into tgroupStart put offset("

",tGroup) into tgroupEnd put char tgroupStart+2 to tgroupEnd-1 of tGroup into tGroup delete line 1 to tgroupLine+1 of theHTML --top and tail HTML and inject stylesheet ref put htmltop1&tTitle&htmlTop2&cr before theHTML put cr & htmlBottom after theHTML replace "%" with "_" in thisfname put percentURLFake(thisfname)&".html" into guideArray[tTitle]["fname"] put tGroup into guideArray[tTitle]["group"] put theHTML into guideArray[tTitle]["content"] end if add 1 to tIndex end repeat --make index file put the keys of guideArray into tfkeys sort lines of tfkeys ascending put htmlTop1&"LiveCode Documentation"&htmltop2& cr into tIndexPage put the version into tVersion put toh1("LiveCode Documentation")&cr after tIndexPage Put "

This documentation set has been generated against version "& tobold(tVersion) &" of Livecode.

"&cr after tIndexPage put "

The dictionaries for both LiveCode Script (LCS) and LiveCode Builder LCB) have been combined.

"&cr after tIndexPage put "

To examine the LCB entries only, look at entries in the MODULES section.

"&cr after tIndexPage put toh2("Introduction")&cr after tIndexPage put "
    " &cr after tIndexPage repeat for each line thisline in tfkeys if guideArray[thisline]["group"] = "Introduction" then put "
  • "&thisline&"
  • "& cr after tIndexPage end if end repeat put "
" &cr after tIndexPage put toh2("Basic")&cr after tIndexPage put "
    " &cr after tIndexPage repeat for each line thisline in tfkeys if guideArray[thisline]["group"] = "Basic" then put "
  • "&thisline&"
  • "& cr after tIndexPage end if end repeat put "
" &cr after tIndexPage put toh2("Intermediate")&cr after tIndexPage put "
    " &cr after tIndexPage repeat for each line thisline in tfkeys if guideArray[thisline]["group"] = "Intermediate" then put "
  • "&thisline&"
  • "& cr after tIndexPage end if end repeat put "
" &cr after tIndexPage put toh2("IDE")&cr after tIndexPage put "
    " &cr after tIndexPage repeat for each line thisline in tfkeys if guideArray[thisline]["group"] = "ide" then put "
  • "&thisline&"
  • "& cr after tIndexPage end if end repeat put "
" &cr after tIndexPage put toh2("Deployment")&cr after tIndexPage put "
    " &cr after tIndexPage repeat for each line thisline in tfkeys if guideArray[thisline]["group"] = "Deployment" then put "
  • "&thisline&"
  • "& cr after tIndexPage end if end repeat put "
" &cr after tIndexPage put toh2("Advanced")&cr after tIndexPage put "
    " &cr after tIndexPage repeat for each line thisline in tfkeys if guideArray[thisline]["group"] = "Advanced" then put "
  • "&thisline&"
  • "& cr after tIndexPage end if end repeat put "
" &cr after tIndexPage put toh2("Reference")&cr after tIndexPage put "
    " &cr after tIndexPage repeat for each line thisline in tfkeys if guideArray[thisline]["group"] = "Reference" then put "
  • "&thisline&"
  • "& cr after tIndexPage end if end repeat put "
" &cr after tIndexPage put toh2("Extension")&cr after tIndexPage put "
    " &cr after tIndexPage repeat for each line thisline in tfkeys if guideArray[thisline]["group"] = "Extensions" then put "
  • "&thisline&"
  • "& cr after tIndexPage end if end repeat put "
" &cr after tIndexPage put toh2("Other")&cr after tIndexPage put "
    " &cr after tIndexPage repeat for each line thisline in tfkeys if guideArray[thisline]["group"] = "Other" then put "
  • "&thisline&"
  • "& cr after tIndexPage end if end repeat put "
" &cr after tIndexPage put htmlbottom after tIndexPage put tIndexPage into url("file:index.html") --write out the guide files repeat for each key gkey in guideArray put textencode(guideArray[gkey]["content"],"utf8") into url ("file:"& guideArray[gkey]["fname"]) end repeat end getGuides global tDataA private on ideDocsEnsureDatabase pLocation if there is not a file (pLocation & slash & "api.sqlite") then put url ("binfile:" & revIDESpecialFolderPath("API") & slash & "api.sqlite") into \ url ("binfile:" & pLocation & slash & "api.sqlite") end if end ideDocsEnsureDatabase local sConnectionsA command ideDocsInitialize pDistributed If pDistributed is true and revEnvironmentIsInstalled() then ideThrow "can't write to installed IDE" return empty end if local tConnection, tLocation, tKey if pDistributed is true then put "ide" into tKey put revIDESpecialFolderPath("API") into tLocation else put "cache" into tKey put revIDESpecialFolderPath("documentation cache") into tLocation ideDocsEnsureDatabase tLocation end if put sConnectionsA[tKey] into tConnection if tConnection is among the items of revOpenDatabases() then return tConnection end if dispatch "revDocsOpenAPIDatabase" to stack "revDocsParser" with tLocation put the result into tConnection if tConnection is not a number then ideThrow "unable to open database", tConnection end if put tConnection into sConnectionsA[tKey] return tConnection end ideDocsInitialize function __fetchDocsData pLibraryName, pEntryName, pType # Ensure we have a connection local tConnection try ideDocsInitialize put the result into tConnection catch tError return tError end try local tRecordSet, tDataSet, tParamCount put "SELECT * FROM dictionary_data" into tSQL # Execute the query, keeping the record set ID. put revQueryDatabase(tConnection, tSql) into tRecordSet if the result is not a number then return "entry" && pEntryName && "not found" & return & the result end if # Get the docs data from the record set local tCount, tMoreRecords, tData, tLibrary put true into tMoreRecords put revDatabaseColumnNames(tRecordSet) into dnames repeat while tMoreRecords get revDatabaseColumnNamed(tRecordSet, "entry_data", "tData") get revDatabaseColumnNamed(tRecordSet, "library_name", "tLibrary") get revDatabaseColumnNamed(tRecordSet, "entry_name", "entry_name") add 1 to tCount put tData into tDataSet[tCount]["data"] put tLibrary into tDataSet[tCount]["library"] put entry_name into tDataSet[tCount]["entry_name"] --if tData is not empty then put tData into tDataSet[tCount]["data"] --end if revMoveToNextRecord tRecordSet put the result into tMoreRecords end repeat --put tcount # Close the record set revCloseCursor tRecordSet return tDataSet end __fetchDocsData on getNewDict put __fetchDocsData() into tDataA local tDecodedDataA repeat for each key tCount in tDataA put arrayDecode(tDataA[tCount]["data"]) into sCompleteDictsArray[tCount] put tDataA[tCount]["library"] into sCompleteDictsArray[tCount]["library"] put tDataA[tCount]["entry_name"] into sCompleteDictsArray[tCount]["entry_name"] end repeat put the keys of sCompleteDictsArray into tempkey put the number of lines in tempkey into tempnum --workaround docs errors -- to be removed once errors are fixed. fixdocs --create filename entry and array --filename to include indicator of Type put "Still getting dictionary entries..." into fld "prog" set the itemDelimiter to "." --make a dictionary entry according to the associations repeat for each key anEntry in sCompleteDictsArray put sCompleteDictsArray[anEntry]["associations"][1] into tAssociation if tAssociation is not an array then -- it is empty, happens for lot of LCS entries and Header of com. and community. entries put sCompleteDictsArray[anEntry]["display Name"] into tKeyWord if tKeyWord = "datagrid" then -- datagrid header entry has no association put tKeyword into sCompleteDictsArray[anEntry]["Dict"] next repeat end if -- this is for entries without associaton then the keyword helps again it is assumed to be a header entry if tKeyWord begins with "com." or tKeyWord begins with "community." then if item - 2 of tKeyWord = "livecode" then -- LCB associations are sub packets of LCB in the form of com.livecode.math put "LCB" into sCompleteDictsArray[anEntry]["Dict"] else -- community widgets have author as item -2 of address e.g. community.livecode.elanor.calendar -- IDE widgets/libraries have kind as item - 2 e.g com.livecode.widget.treeview, com.livecode.library.json put item -2 to - 1 of tKeyWord into sCompleteDictsArray[anEntry]["Dict"] end if next repeat end if end if if tAssociation begins with "com." or tAssociation begins with "community." then if item - 2 of tAssociation = "livecode" then put "LCB" into sCompleteDictsArray[anEntry]["Dict"] else put item - 2 to - 1 of tAssociation into sCompleteDictsArray[anEntry]["Dict"] put 1 into tLongIDDictA[tAssociation] end if next repeat else if tAssociation is "Datagrid" then put "DataGrid" into sCompleteDictsArray[anEntry]["Dict"] next repeat else -- for empty tAssociation or the asscociations of LCS put "LCS" into sCompleteDictsArray[anEntry]["Dict"] next repeat end if end if if tAssociation = "widget" then put "LCB" into sCompleteDictsArray[anEntry]["Dict"] end if end repeat repeat for each key anEntry in sCompleteDictsArray put sCompleteDictsArray[anEntry]["Type"] into ttype replace " " with "_" in ttype put ttype into tnametypes[sCompleteDictsArray[anEntry]["display name"]] put percentURLFake(sCompleteDictsArray[anEntry]["Display Name"]&"_"&sCompleteDictsArray[anEntry]["Dict"]&"_"&ttype&".html") into sCompleteDictsArray[anEntry]["fname"] put sCompleteDictsArray[anEntry]["fname"] into sFileNames[sCompleteDictsArray[anEntry]["Display Name"]] end repeat --need to get a list of multiple keyword entries to ensure default to Glossry put "" into tMultiArray put "" into tMultis --breakpoint repeat for each key anEntry in sCompleteDictsArray if sCompleteDictsArray[anEntry]["Dict"] = "LCS" then add 1 to tMultiArray[sCompleteDictsArray[anEntry]["Display Name"]] end if end repeat repeat for each key anEntry in tMultiArray if tMultiArray[anEntry] > 1 then put anEntry & cr after tMultis end if end repeat if line -1 of tMultis is empty then delete line -1 of tMultis put lineoffset ("Result",tMultis) into tR if tr <> 0 then delete line tr of tMultis sort tMultis ascending put empty into tglossmultis repeat for each key anEntry in sCompleteDictsArray if (sCompleteDictsArray[anEntry]["Dict"] = "LCS") AND (sCompleteDictsArray[anEntry]["type"] = "glossary") then put sCompleteDictsArray[anEntry]["Display Name"] & cr after tglossmultis end if end repeat sort tglossmultis ascending if line -1 of tMultis is empty then delete line -1 of tglossmultis end getNewDict j| Make DocSet U(Message),unicode U(Message),unicode W(Message),unicode U (Message) U(Message),unicode W (Message) U(Text),unicode UHelvetica,unicode U (Styled Text) U(Styled Text),unicode U (Message)0U(Message),unicode cDfolder/Users/jehale/Desktop cREVGeneral  breakpointsbreakpointstatesdebugEntryHandler M,getGuidesscripteditorselection26451breakpointconditionsscripteditorvscroll(debugParameters scalefactor? cRevOnline id845cREVGeometryCache stackID, @: cREVGeometryCacheIDs  1505618009955 1505143559514 1506997106602' 1505266973461 1505266990935 1506328120113& 1505618009957 1507260195320, 1505268099658 1505618009959 1505618009958 1506326073630$ 1505618009960 1505266981350 1505618009961 1505618009956 1505618009962!cREVGeometrycache totalorder  cREVGeneral scripteditorvscrollscripteditorselection0!$&', @Y cREVGeometryCache order @[ cREVGeometryCache order     @[  cREVGeneral scripteditorvscrollscripteditorselection0cREVGeometryCacheIDs  1505266848911 1505402473392 1505266848910 1505402473391 1505402473390 1505402410001"cREVGeometrycache totalorder "( @y cREVGeometryCacheIDs  1506997922379) 1506998359834+cREVGeometrycache totalorder )+  Label Field |  cREVGeneral  revUniqueID09uBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse This stack will read in the current documentation (Guides, Dictionary entries and Release Notes) and produce a docset suitable for use in Dash, a MacOS and iOS documentation and snippet manager. ' ' The resulting "LiveCode.docset" will be placed on your Desktop by default. This can then be added to the MacOS version of Dash by double clicking on it and to the iOS version via iTunes file transfer. ' ' *Non MacOS readers of Dash docsets include: 'T ' ?Windows: Velocity <‪http://velocity.silverlakesoftware.com/> '( '(R ' 4Linux (and Windows): Zeal <‪http://zealdocs.org/> '8 '8, ' RAndroid: LovelyDocs <‪https://apkmonk.com/app/com.lovelyhq.android.lovelydocs/> ', ',t ' Both the plist and the style sheet used for the docset can be edited before you generate it. Please only alter if you know what you are doing! ' ' =To generate a docset just click on the button "Make Docset!". 'z ' :You will be alerted once the docset creation is completed. 'tButtonep-- Sent when the mouse is released after clicking -- pMouseButton specifies which mouse button was pressed on mouseUp pMouseButton mainloop end mouseUp  Make Docset!  cREVGeneral scripteditorvscrollscripteditorselection142 revUniqueID@9uB  Label Field@  cREVGeneral  revUniqueIDUuBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse 3All code for the generation is in the stack script. 'f ' ;Inspired by the "Tiny Dictionary" stack by Bernd Niggemann '" #" '@ #V 't (thanks Bernd). ' ' @Please report any problems or suggested improvements back to me. ' ' James Hale # james@thehales.id.au #( Field Pyd z  cREVGeneral  revUniqueIDP9uBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse  Version 2.9 ' icon@2x.png @d _PNG  IHDR szzgAMA a cHRMz&u0`:pQ<iTXtXML:com.adobe.xmp 1 1 2 ؀aIDATX WKA3KX_AT);Dx:vK%y(Fm޼ߛ7(OǩX``\f=x8@`)\G)bV.;0O{0suJE3c tqhYFS~:8NlU`GVυ}8TCZSGu*Jv~̢ց٨"Gƶ4p];S N)6gua9ܶRONVaM3K Nדs4^Y^?PM@^}oY6JcEo BɫA<W^|6\xQ ΜB֜sMe[B񶈼$\$}(;!<ݰwK]ղ@f~'uͻUé~2[ <]2 UP3!Z㐾z20Uo| Q "}l[b;#+C@5I sY "r]L-8trJtOώ}8}MyҐ<z) lsً.} `lxA}:Hs5Mzǻ5Y2B[u  D637dӲ FtB?H$x²?X"s4+pH$Pbi) ueڒ,n'pg,^^T7_IENDB`  cREVGeneral  revUniqueID`9uB  Label Field     cREVGeneral  revUniqueIDp+uBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse plist for Dash 'lpew&on mouseUp pButtonNumber if the label of me = "Lock plist field" then set the locktext of fld "plist" to true set the label of me to "Unlock plist field" else set the locktext of fld "plist" to false set the label of me to "Lock plist field" end if end mouseUp 9Unlock plist field  cREVGeneral scripteditorvscrollscripteditorselection0 revUniqueID+uB plist)pIon linkClicked pLinkedTextOfChunk put pLinkedTextOfChunk end linkClicked +{{ cellFormattingfalse cREVGeneral scripteditorvscrolltablefalse revUniqueID+uB cRevTable  cellFormatfalsemaxColumnCountcellEditfalse  & 'L f '  '*  '  CFBundleIdentifier '<  livecode '4  CFBundleName '0  LiveCode '4 DocSetPlatformFamily '@  livecode '4  isDashDocset '0  ' # dashIndexFilePath 'F " index.html 'D  DashDocSetFamily '>  dashtoc '8  '  ' `,yButtonew/on mouseUp pButtonNumber go card 1 end mouseUp Return to main screen  cREVGeneral scripteditorvscroll  Label Field     cREVGeneral  revUniqueID0=uBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse CSS used for HTML files '.  css)pIon linkClicked pLinkedTextOfChunk put pLinkedTextOfChunk end linkClicked +{ cellFormattingfalse cREVGeneral scripteditorvscrolltablefalse revUniqueID@=uB cRevTable  cellFormatfalsemaxColumnCountcellEditfalse  /*! ' + * Bootstrap Docs (http://getbootstrap.com) 'V $ * Copyright 2011-2014 Twitter, Inc. 'H L * Licensed under the Creative Commons Attribution 3.0 Unported License. For ' < * details, see http://creativecommons.org/licenses/by/3.0/. 'x  * ' + * Modified for LiveCode docs as HTML files 'V  */ '  ' ' ' body { '  padding: 10px 15px; '* > font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; '|  font-size: 14px; '$  line-height: 20px; '(  color: #333333; '"  background: #ffffff; ', } '  ' a, a:visited { '  color: #0088cc; '"  text-decoration: none; '0 } '  ' a:hover { '  color: #005580; '"  text-decoration: underline; ': } '  ' p { margin: 0 0 20px; } '. small { font-size: 85%; } '2 strong { font-weight: bold; } ': em { font-style: italic; } '4  ' h1,h2,h3,h4,h5,h6 { '&  margin: 10px 0; '"  font-family: inherit; '.  font-weight: bold; '(  line-height: 20px; '(  color: inherit; '" % text-rendering: optimizelegibility; 'J } '  ' h1,h2,h3 { line-height: 40px; } '> h1 { font-size: 38px; } '. h2 { font-size: 32px; } '. h3 { font-size: 24px; } '. h4 { font-size: 18px; } '. h5 { font-size: 14px; } '. h6 { font-size: 14px; } '.  ' ul,ol { ' padding: 0; '  margin: 0 0 10px 25px; '0 } '  ' ul ul, ' ul ol, ' ol ol, ' ol ul { '  margin-bottom: 0; '& } '  ' li { line-height: 20px; } '2  ' hr { '  margin: 20px 0; '" border: 0; ' border-top: 1px solid #eeeeee; '@ # border-bottom: 1px solid #ffffff; 'F } '  ' blockquote { '  padding: 0 0 0 15px; ',  margin: 0 0 20px; '& ! border-left: 5px solid #eeeeee; 'B  font-size: inherit; '* } '  ' img { '@  max-width: 90%; '@"  align-items: center; '@* } '@  ' code, ' pre { '  padding: 0 3px 2px; '* I font-family: Courier,Monaco, Menlo, Consolas, "Courier New", monospace; '  font-size: 12px; '$  color: #333333; '"  -webkit-border-radius: 3px; ':  -moz-border-radius: 3px; ':  border-radius: 3px; ': } '  ' code { '  padding: 2px 4px; '&  color: #d14; '  white-space: nowrap; ',  background-color: #f7f7f9; '8  border: 1px solid #e1e1e8; '8 } '  ' pre { '  display: block; '"  padding: 9.5px; '"  margin: 0 0 10px; '&  font-size: 13px; '$  line-height: 20px; '(  word-break: break-all; '0  word-wrap: break-word; '0  white-space: pre; '&  white-space: pre-wrap; '0  background-color: #f5f5f5; '8  border: 1px solid #ccc; '2 ( border: 1px solid rgba(0, 0, 0, 0.15); 'P  -webkit-border-radius: 4px; ':  -moz-border-radius: 4px; ':  border-radius: 4px; ': } '  ' pre code { ' padding: 0; '  color: inherit; '"  white-space: pre; '&  white-space: pre-wrap; '0 background-color: transparent; '@ border: 0; ' } ' ' span.normal { '  color: #000000 '  } ' ' span.command { '  color: #7F7F00 ' '@  } '  ' span.property { '  color: #007F7F ' '@ } '  ' span.comment { '  color: #007F00 ' '@ } ' ' span.function { '  color: #7F007F ' '@ } ' ' span.keyword { '  color: #7F007F ' @ } '  ' table { '  width: 100%; '  margin-bottom: 20px; ',  border: 0px solid #dddddd; '8  border-collapse: collapse; '8  border-left: 0; '"  -webkit-border-radius: 4px; ':  -moz-border-radius: 4px; ':  border-radius: 4px; ': } '  ' table th, ' table td { '  padding: 8px; '  line-height: 20px; '(  text-align: left; '&  vertical-align: top; ', border-top: 0px solid #dddddd; '@ ! border-left: 0px solid #dddddd; 'B } ' ' table.inner { '  width: 100%; '  margin-bottom: 20px; ',  border: 2px solid #dddddd; '8  border-collapse: collapse; '8  border-left: 0; '"  -webkit-border-radius: 4px; ':  -moz-border-radius: 4px; ':  border-radius: 4px; ': } '  ' table.inner th { '  padding: 8px; '  line-height: 20px; '(  text-align: left; '&  vertical-align: top; ',  background-color: #f5f5f5; '8 border-top: 2px solid #dddddd; '@ ! border-left: 2px solid #dddddd; 'B } ' table.inner td { '  padding: 8px; '  line-height: 20px; '(  text-align: left; '&  vertical-align: top; ', border-top: 2px solid #dddddd; '@ ! border-left: 2px solid #dddddd; 'B } '  ' table th { font-weight: bold; } '> *table thead th { vertical-align: bottom; } 'T  ' *table thead:first-child tr:first-child th, 'T +table thead:first-child tr:first-child td { 'V  border-top: 0; ' } ' ' `,y{ ltewon mouseUp pButtonNumber if the label of me = "Lock CSS field" then set the locktext of fld "css" to true set the label of me to "Unlock CSS field" else set the locktext of fld "css" to false set the label of me to "Lock CSS field" end if end mouseUp 9Unlock CSS field  cREVGeneral scripteditorvscrollscripteditorselection0 revUniqueIDP=uB  Buttonew/on mouseUp pButtonNumber go card 1 end mouseUp Return to main screen  cREVGeneral scripteditorvscroll revUniqueIDCuB  Label Field _d  cREVGeneral  revUniqueIDຬuBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse '  Label Field     cREVGeneral  revUniqueIDHUuBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse Release Notes 'Buttonew/on mouseUp pButtonNumber go card 1 end mouseUp Return to main screen  cREVGeneral scripteditorvscroll revUniqueIDHUuB Buttonew2on mouseUp pButtonNumber go card 2 end mouseUp R Edit plist  cREVGeneral scripteditorvscrollscripteditorselection0 revUniqueIDp9uB Buttonew2on mouseUp pButtonNumber go card 3 end mouseUp REdit css  cREVGeneral  revUniqueIDPsuBscripteditorvscrollscripteditorselection0 Buttonew2on mouseUp pButtonNumber go card 4 end mouseUp rk Release notes  cREVGeneral  revUniqueID`uuBscripteditorvscrollscripteditorselection37 Buttonewcon mouseUp pButtonNumber answer folder "Please choose a location for the docset creation." if it is empty then put "~/Desktop" into fld "dpath" set the defaultfolder to the desktop folder else set the defaultfolder to it put it into fld "dpath" end if set the cDfolder of this stack to the defaultfolder end mouseUp zJChange  cREVGeneral  revUniqueIDpwuBscripteditorvscroll dpath@+ cellFormattingfalse cREVGeneral  revUniqueID9uBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse  /Users/jehale/Desktop '* Field Px   cREVGeneral  revUniqueIDuBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse  Location to place docset: '2 Field)h,{ y cellFormattingfalse cREVGeneral  revUniqueIDuBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse  Version 2.9 @ B• Script colorization returns to the Syntax and Example sections @ ' Version 2.8 @ =• Now includes the "Extension" guides introduced in LC 9.01 @v ' Version 2.7 @ • Adjusted guide conversion to display all headers in left panel. Previously only level 2 headers were included, but this left access to many sections within the guides difficult. This means there is effectively a table of contents based on all header text within the document. Unifortunately due to non existant standards for writing the guides, many extra and redundant entries are presented. @ ' Version 2.61 @ • Left a breakpoont set (oops) @< ' Version 2.6 @ +• Adjust LC version to catch the 9 series @R ' Version 2.5 @ U• Adjust internal cross ref to account for change of widget libray type to "module" @ ' Version 2.4 @ $• Fixed keyword index for database @D ' Version 2.3 @ l•Adjust script to summarise once more all library and widget associations under their respective entries. @ g•Note that under the widget entries, some properties/mesages are present due to the docs being wrong! @ ' Version 2.2 @ H•Include a summary table of entries associated with each object entry. @ ' Version 2.1 @ 2•New dictionary handlers for LC8.2+ and LC9Dp10+ @` 8•Include the "library" name associated with the entry. @l ' Version 2.0.1 @ "• Reinstate code block detection @@ "• Reinstate blockquote detection @@ (• correct version check to allow 8.2 + @L ' Version 2.0 @ 9• Complete reworking of extraction and formatting code @n ( Now works directly on dictionary array @P K• All library and Widget entries now include a summary list of associated @  dictionary entries @( 0• All Datagrid entries listed under "Datagrid" @\ H* Removed links in descriptions where multiple entries were possible and @  correct one was ambiguous. @$ ' $ ' Version 1.9 @ • Account for colon in name @6 '• Workaround for some errors in docs. @J ' Version 1.8 @ ;• Script colorization in the Syntax and Example sections. @r • Tidied up some formatting. @8 I• Links to terms and other entries now limited to Summary, Changes, @ " Description and Related sections @D ' Version 1.7 @ • Thanks to a suggestion from Monte Goulding in answer to a query about inserted line breaks in the ldoc files I have thrown out most of the V1.6 coding and substituting it with Monte's mergMarkdownToHtml external. @ /Works a treat and will probably be more robust. @^ ' Version 1.6 @ }• Reworked formatting scripts to to handle description block as well as description blocks in Parameter and Value sections. @ D• Description blocks now handle correctly formatted code snippets. @ C• Description blocks now format lists (up to 2 levels) correctly. @ K• Reworked Examples section formatting to correctly group blocks of code. @ • Added "Tags" values @* ' Version 1.5 @ 6• fixed pesky "Related" entries, and tidied them up. @h ' Version 1.4 @ /• format for description section now correct. @Z ;* correct keyword lookup where multiple exists works again. @v I Note - dependent on a type being included in text as in @ * Logo copyright info added. @8 ' Version 1.3 @ ,• Remove spurious heading from LCB entries @T G• Ensure entries with same name (but different domains) do not write @  over each other. @& • correct broken Guide links @8 ' Version 1.2 @ ' KNote: Currently Dash does not recognise "glossary" nor "Control Structure"  as an entry type. $ GThese entries are currently shown under the "Variables" entry in Dash.  .I have written to ask these types be included. \ ' ?• Bug fix on dictionary links appearing in description texts. @z F• Adjusted filenaming convention to correctly handle $ & [ and other @ J characters that require encoding but that does not interfere with hrefs. @ 1• Special case for <>,<,>,<=,>= in sqlite index @^ M• Modified interface, added release notes, moved plist and css to own pages @ )• Add ability to set location of docset @N $• Now deletes any previous docsets @D * Progress indication. @, 0• Really correctly corrected embarassing typo! @\ ' Version 1.1 '  • LC icons added ' '• Table of contents for guides added. ' J 9 They will appear in the left pane when viewing a guide. ' r • Embarassing typo corrected ' 8 ' Version 1.0 '  •Initial release ' ' '  `-y} prog  !   cREVGeneral  revUniqueID9uBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse ' Field)   cREVGeneral  revUniqueIDuBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse  +LiveCode logo copyright LiveCode Ltd. 'V!icon.png @PNG  IHDRagAMA a cHRMz&u0`:pQ<iTXtXML:com.adobe.xmp 1 1 2 ؀IDAT8S?,QKEKMmҰ`:aHb( # "0J$Bbhs'D S-%hmy{w\w}Xxcg nM;ѬrP!߁Od诚{5(aP+_-v'=vݾH=̫QJ\5^l0~7^|[p4/3r#~d(5ݟZQ/fU@qQCn3/E}} yHk9t6U<=^3{밈85 SBd&vk#b`CmD*+,K<ӈ eGnH:.vrp5bfw!BAZ j Qو .*K2iBk}e;sfxV$[6 Iծ)AgO\'IENDB`  cREVGeneral  revUniqueID9uB"icon.png @% }PNG  IHDRagAMA a cHRMz&u0`:pQ<iTXtXML:com.adobe.xmp 1 1 2 ؀IDAT8S?,QKEKMmҰ`:aHb( # "0J$Bbhs'D S-%hmy{w\w}Xxcg nM;ѬrP!߁Od诚{5(aP+_-v'=vݾH=̫QJ\5^l0~7^|[p4/3r#~d(5ݟZQ/fU@qQCn3/E}} yHk9t6U<=^3{밈85 SBd&vk#b`CmD*+,K<ӈ eGnH:.vrp5bfw!BAZ j Qو .*K2iBk}e;sfxV$[6 Iծ)AgO\'IENDB`  cREVGeneral  revUniqueIDAuB $fToColor!`] cellFormattingfalse cREVGeneral  revUniqueID}uBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse  'include "/home/mark/www/scripts/foo.lc" 'N% `] &tindex(@hv:  cREVGeneral  revUniqueIDpuBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse  ' 'Field P ;  cREVGeneral  revUniqueIDzouBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse  LC 8.15 or higher required '4 )Field@ER< cellFormattingfalse cREVGeneral  revUniqueID6uBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse (STOP %@  ' ' ' |This stack requires LC 8.15 of later to run as access to the documentation functions were not available in earlier versions. ' ' ' ' ^Simply download a copy of the Community version of the latest release of LC to run this stack. '+Buttonep-- Sent when the mouse is released after clicking -- pMouseButton specifies which mouse button was pressed on mouseUp pMouseButton quit end mouseUp RQuit  cREVGeneral scripteditorvscrollscripteditorselection135 revUniqueIDquB ,fkey!`zd]  cREVGeneral  revUniqueIDVuBtablefalse cRevTable  cellFormatfalsemaxColumnCountcellEditfalse  1763 '
TypeNameSummarySyntax