REVO5500 Â LiveCode Docs Editor @ ¨ ÂÉ ÀGfunction libDocumentationOldFormat pData, pFileToDirectory, pLinkLookup
--libReplaceLinks rData, pFileToDirectory, pLinkLookup
//if offset ("2520", rData) > 0 or offset ("2364", rData) > 0then
//breakpoint
//end if
if offset ("", pData) > 0 then
// do the glossary specific stuff
else
// do the dictionary specific stuff
put libUpdateSyntaxExamples(pData) into pData
put libUpdateObjects(pData) into pData
put libUpdateReferences(pData) into pData
put libUpdateClassification(pData) into pData
put libUpdateHistory(pData) into pData
put libUpdatePlatforms(pData) into pData
put libUpdateClasses(pData) into pData
put libUpdateSecurity(pData) into pData
put libUpdateExampleExamples(pData) into pData
put libUpdateParameters(pData) into pData
put libUpdateDescription(pData) into pData
put libRemoveObsolete(pData) into pData
put libUpdateGeneral(pData) into pData
end if
return pData
end libDocumentationOldFormat
function libUpdateSyntaxExamples pData
// updates the notation
local tTextToReplace, tReplaceWith, tTextStart, tTextEnd
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToReplace
if tTextToReplace is empty then
breakpoint
else
put tTextToReplace into tReplaceWith
replace "" with "
" in tReplaceWith
replace "
" with "
" in tReplaceWith
replace "
" with "
" in tReplaceWith
replace "
" with "" in tReplaceWith
replace tTextToReplace with tReplaceWith in pData
end if
return pData
end libUpdateSyntaxExamples
function libUpdateObjects pData
// updates the ... notation
local tTextToReplace, tReplaceWith, tTextStart, tTextEnd
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToReplace
if tTextToReplace is empty then
breakpoint
else
put "--text--" into tReplaceWith
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "card,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "stack,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "group,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "field,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "button,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "graphic,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "scrollbar,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "player,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "image,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "iosBrowser,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "iosScroller,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "iosPlayer,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "iosTextInput,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "AndroidScroller,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "AndroidBrowser,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "AndroidPlayer,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "androidTextInput,--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--text--" with "androidMultiline,--text--" in tReplaceWith
end if
replace ",--text--" with "" in tReplaceWith
replace "--text--" with "" in tReplaceWith
replace tTextToReplace with tReplaceWith in pData
end if
return pData
end libUpdateObjects
function libUpdateReferences pData
// updates the notation
replace "" with "" in pData
replace "" with "" in pData
return pData
end libUpdateReferences
function libUpdateClassification pData
// updates the notation
replace "" with "" in pData
replace "" with "" in pData
return pData
end libUpdateClassification
function libUpdateHistory pData
// updates the notation
replace "" with "" in pData
replace "" with "" in pData
return pData
end libUpdateHistory
function libUpdatePlatforms pData
// updates the ... notation
replace "" with "" in pData
replace "" with "" in pData
replace "" with "" in pData
replace "" with "" in pData
replace "" with "" in pData
replace "" with "" in pData
replace "" with "" in pData
return pData
end libUpdatePlatforms
function libUpdateClasses pData
// updates the ... notation
local tTextToReplace, tReplaceWith, tTextStart, tTextEnd
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToReplace
if tTextToReplace is empty then
breakpoint
else
put "--and----text--" into tReplaceWith
if offset ("", tTextToReplace) > 0 then
replace "--and--" with", " in tReplaceWith
replace "--text--" with "--and--Desktop--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--and--" with", " in tReplaceWith
replace "--text--" with "--and--Server--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--and--" with", " in tReplaceWith
replace "--text--" with "--and--Web--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--and--" with", " in tReplaceWith
replace "--text--" with "--and--Mobile--text--" in tReplaceWith
end if
replace ", , " with "" in tReplaceWith
replace "--and----text--" with "" in tReplaceWith
replace "--text--" with "" in tReplaceWith
replace ", --and--" with "" in tReplaceWith
replace "--and--" with " and " in tReplaceWith
replace tTextToReplace with tReplaceWith in pData
end if
return pData
end libUpdateClasses
function libUpdateExampleExamples pData
// updates the notation
local tTextToReplace, tReplaceWith, tTextStart, tTextEnd, tCurrentExampleToReplace, tCurrentExampleToReplaceWith, tDoubleLineSpace, tExampleFound, tFirstExample
put true into tFirstExample
put true into tExampleFound
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToReplace
if tTextToReplace is empty then
breakpoint
else
if offset ("
", tTextToReplace) > 0 then
put true into tDoubleLineSpace
else
put false into tDoubleLineSpace
end if
put tTextToReplace into tReplaceWith
repeat while true
put libGetTextLocation (tReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentExampleToReplace
if tCurrentExampleToReplace is empty then
exit repeat
end if
put tCurrentExampleToReplace into tCurrentExampleToReplaceWith
if tDoubleLineSpace is true and tFirstExample is false then
replace "" with "
" in tCurrentExampleToReplaceWith
else
replace "" with "
" in tCurrentExampleToReplaceWith
end if
replace "
" with "
" in tCurrentExampleToReplaceWith
replace tCurrentExampleToReplace with tCurrentExampleToReplaceWith in tReplaceWith
if tFirstExample is true then
put false into tFirstExample
end if
end repeat
replace "" with "" in tReplaceWith
replace "" with "" in tReplaceWith
replace "
" with "
" in tReplaceWith
replace "
" with "" in tReplaceWith
replace tTextToReplace with tReplaceWith in pData
end if
return pData
end libUpdateExampleExamples
function libUpdateParametersA pData
// updates the
//
//
//
//
//
//
//
//
//
local tTextToReplace , tTextToReplaceWith, tCurrentParameterToReplace, tCurrentParameterToReplaceWith, tCurrentParameterNameToReplace, tCurrentParameterNameToReplaceWith
local tCurrentParameterDescriptionToReplace, tCurrentParameterDescriptionToReplaceWith, tCurrentParameterOptionsToReplace, tCurrentParameterOptionsToReplaceWith
local tCurrentParameterOptionsOptionToReplace, tCurrentParameterOptionsOptionToReplaceWith
local tCurrentParameterOptionsOptionItemToReplace, tCurrentParameterOptionsOptionItemToReplaceWith
local tCurrentParameterOptionsOptionDescriptionToReplace, tCurrentParameterOptionsOptionDescriptionToReplaceWith
local tCurrentParameterOptionsOptionValuesToReplace, tCurrentParameterOptionsOptionValuesToReplaceWith
local tCurrentParameterOptionsOptionValuesValueToReplace, tCurrentParameterOptionsOptionValuesValueToReplaceWith
local tCurrentParameterOptionsOptionValuesValueNameToReplace, tCurrentParameterOptionsOptionValuesValueNameToReplaceWith
local tCurrentParameterOptionsOptionValuesValueDescriptionToReplace, tCurrentParameterOptionsOptionValuesValueDescriptionToReplaceWith
local tTextStart, tTextEnd, tStrip, tOptionsTitle, tOptionsTitleWith
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToReplace
if the number of lines in tTextToReplace <= 2 and the number of characters in tTextToReplace < 30 then
replace tTextToReplace with "" in pData
else
put tTextToReplace into tTextToReplaceWith
// HANDLE THE PARAMETERS
repeat while true
put libGetTextLocation (tTextToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterToReplace
if tCurrentParameterToReplace is empty then
exit repeat
end if
put tCurrentParameterToReplace into tCurrentParameterToReplaceWith
put libGetTextLocation (tCurrentParameterToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterNameToReplace
if tCurrentParameterNameToReplace is not empty then
put tCurrentParameterNameToReplace into tCurrentParameterNameToReplaceWith
replace "" with "" in tCurrentParameterNameToReplaceWith
replace "" with "<#S#><#S#>" in tCurrentParameterNameToReplaceWith
replace tCurrentParameterNameToReplace with tCurrentParameterNameToReplaceWith in tCurrentParameterToReplaceWith
end if
put libGetTextLocation (tCurrentParameterToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterDescriptionToReplace
if tCurrentParameterDescriptionToReplace is not empty then
put tCurrentParameterDescriptionToReplace into tCurrentParameterDescriptionToReplaceWith
replace "" with "<#E#><#E#> - " in tCurrentParameterDescriptionToReplaceWith
replace "" with "" in tCurrentParameterDescriptionToReplaceWith
replace tCurrentParameterDescriptionToReplace with tCurrentParameterDescriptionToReplaceWith in tCurrentParameterToReplaceWith
end if
// HANDLE OPTIONS
repeat while true
put libGetTextLocation (tCurrentParameterToReplaceWith, "", tTextStart, tTextEnd) into tCurrentParameterOptionsToReplace
if tCurrentParameterOptionsToReplace is empty then
exit repeat
end if
put tCurrentParameterOptionsToReplace into tCurrentParameterOptionsToReplaceWith
// HANDLE THE OPTIONS TITLE
put libGetTextLocation (tCurrentParameterOptionsToReplaceWith, "title=" & quote, quote & ">", tTextStart, tTextEnd) into tOptionsTitle
put tOptionsTitle into tOptionsTitleWith
replace "title=" & quote with "
" in tOptionsTitleWith
replace quote & ">" with "
" in tOptionsTitleWith
replace tOptionsTitle with tOptionsTitleWith in tCurrentParameterOptionsToReplaceWith
repeat while true
put libGetTextLocation (tCurrentParameterOptionsToReplaceWith, "", tTextStart, tTextEnd) into tCurrentParameterOptionsOptionToReplace
if tCurrentParameterOptionsOptionToReplace is empty then
exit repeat
end if
put tCurrentParameterOptionsOptionToReplace into tCurrentParameterOptionsOptionToReplaceWith
put libGetTextLocation (tCurrentParameterOptionsOptionToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterOptionsOptionItemToReplace
if tCurrentParameterOptionsOptionItemToReplace is not empty then
put tCurrentParameterOptionsOptionItemToReplace into tCurrentParameterOptionsOptionItemToReplaceWith
replace "" with "
* " in tCurrentParameterOptionsOptionItemToReplaceWith
replace "
" with "<#S#><#S#>" in tCurrentParameterOptionsOptionItemToReplaceWith
replace tCurrentParameterOptionsOptionItemToReplace with tCurrentParameterOptionsOptionItemToReplaceWith in tCurrentParameterOptionsOptionToReplaceWith
end if
put libGetTextLocation (tCurrentParameterOptionsOptionToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterOptionsOptionDescriptionToReplace
if tCurrentParameterOptionsOptionDescriptionToReplace is not empty then
put tCurrentParameterOptionsOptionDescriptionToReplace into tCurrentParameterOptionsOptionDescriptionToReplaceWith
replace "" with "<#E#><#E#> - " in tCurrentParameterOptionsOptionDescriptionToReplaceWith
replace "" with "" in tCurrentParameterOptionsOptionDescriptionToReplaceWith
replace tCurrentParameterOptionsOptionDescriptionToReplace with tCurrentParameterOptionsOptionDescriptionToReplaceWith in tCurrentParameterOptionsOptionToReplaceWith
end if
// HANDLE VALUES
put libGetTextLocation (tCurrentParameterOptionsOptionToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterOptionsOptionValuesToReplace
if tCurrentParameterOptionsOptionValuesToReplace is not empty then
put tCurrentParameterOptionsOptionValuesToReplace into tCurrentParameterOptionsOptionValuesToReplaceWith
repeat while true
put libGetTextLocation (tCurrentParameterOptionsOptionValuesToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterOptionsOptionValuesValueToReplace
if tCurrentParameterOptionsOptionValuesValueToReplace is empty then
exit repeat
end if
put tCurrentParameterOptionsOptionValuesValueToReplace into tCurrentParameterOptionsOptionValuesValueToReplaceWith
put libGetTextLocation (tCurrentParameterOptionsOptionValuesValueToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterOptionsOptionValuesValueNameToReplace
if offset ("", tCurrentParameterOptionsOptionValuesValueToReplaceWith) > 0
then
replace "" with "" in tCurrentParameterOptionsOptionValuesValueToReplaceWith
if tCurrentParameterOptionsOptionValuesValueNameToReplace is not empty then
put tCurrentParameterOptionsOptionValuesValueNameToReplace into tCurrentParameterOptionsOptionValuesValueNameToReplaceWith
replace "" with "
* " in tCurrentParameterOptionsOptionValuesValueNameToReplaceWith
replace "
" with "" in tCurrentParameterOptionsOptionValuesValueNameToReplaceWith
replace tCurrentParameterOptionsOptionValuesValueNameToReplace with tCurrentParameterOptionsOptionValuesValueNameToReplaceWith in tCurrentParameterOptionsOptionValuesValueToReplaceWith
end if
else
if tCurrentParameterOptionsOptionValuesValueNameToReplace is not empty then
put tCurrentParameterOptionsOptionValuesValueNameToReplace into tCurrentParameterOptionsOptionValuesValueNameToReplaceWith
replace "" with "
* " in tCurrentParameterOptionsOptionValuesValueNameToReplaceWith
replace "
" with "<#S#><#S#>" in tCurrentParameterOptionsOptionValuesValueNameToReplaceWith
replace tCurrentParameterOptionsOptionValuesValueNameToReplace with tCurrentParameterOptionsOptionValuesValueNameToReplaceWith in tCurrentParameterOptionsOptionValuesValueToReplaceWith
end if
put libGetTextLocation (tCurrentParameterOptionsOptionValuesValueToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterOptionsOptionValuesValueDescriptionToReplace
if tCurrentParameterOptionsOptionValuesValueDescriptionToReplace is not empty then
put tCurrentParameterOptionsOptionValuesValueDescriptionToReplace into tCurrentParameterOptionsOptionValuesValueDescriptionToReplaceWith
replace "" with "<#E#><#E#> - " in tCurrentParameterOptionsOptionValuesValueDescriptionToReplaceWith
replace "" with "" in tCurrentParameterOptionsOptionValuesValueDescriptionToReplaceWith
replace tCurrentParameterOptionsOptionValuesValueDescriptionToReplace with tCurrentParameterOptionsOptionValuesValueDescriptionToReplaceWith in tCurrentParameterOptionsOptionValuesValueToReplaceWith
end if
end if
replace "" with "
" in tCurrentParameterOptionsOptionValuesValueToReplaceWith
replace "
" with "" in tCurrentParameterOptionsOptionValuesValueToReplaceWith
replace tCurrentParameterOptionsOptionValuesValueToReplace with tCurrentParameterOptionsOptionValuesValueToReplaceWith in tCurrentParameterOptionsOptionValuesToReplaceWith
end repeat
replace "" with "
" in tCurrentParameterOptionsOptionValuesToReplaceWith
replace "
" with "" in tCurrentParameterOptionsOptionValuesToReplaceWith
replace tCurrentParameterOptionsOptionValuesToReplace with tCurrentParameterOptionsOptionValuesToReplaceWith in tCurrentParameterOptionsToReplaceWith
end if
replace "" with "" in tCurrentParameterOptionsOptionToReplaceWith
replace tCurrentParameterOptionsOptionToReplace with tCurrentParameterOptionsOptionToReplaceWith in tCurrentParameterOptionsToReplaceWith
end repeat
replace "" in tCurrentParameterOptionsToReplaceWith
replace "" with "" in tCurrentParameterOptionsToReplaceWith
replace tCurrentParameterOptionsToReplace with tCurrentParameterOptionsToReplaceWith in tCurrentParameterToReplaceWith
end repeat
replace "" with "
" in tCurrentParameterToReplaceWith
replace "
" with "" in tCurrentParameterToReplaceWith
replace tCurrentParameterToReplace with tCurrentParameterToReplaceWith in tTextToReplaceWith
end repeat
replace "" with "
" in tTextToReplaceWith
replace "
" with "" in tTextToReplaceWith
// STRIP OUT ALL MARKED BREAKS
repeat while true
put libGetTextLocation (tTextToReplaceWith, "<#S#><#S#>", "<#E#><#E#>", tTextStart, tTextEnd) into tStrip
if tStrip is empty then
exit repeat
end if
replace tStrip with "" in tTextToReplaceWith
end repeat
// STRIP OUT THE tags
replace tTextToReplace with tTextToReplaceWith in pData
end if
return pData
end libUpdateParametersA
function libUpdateParameters pData
// updates the
//
//
//
//
//
//
//
//
//
local tTextToReplace , tTextToReplaceWith, tCurrentParameterToReplace, tCurrentParameterToReplaceWith, tCurrentParameterNameToReplace, tCurrentParameterNameToReplaceWith
local tCurrentParameterDescriptionToReplace, tCurrentParameterDescriptionToReplaceWith, tCurrentParameterOptionsToReplace, tCurrentParameterOptionsToReplaceWith
local tCurrentParameterOptionsOptionToReplace, tCurrentParameterOptionsOptionToReplaceWith
local tCurrentParameterOptionsOptionItemToReplace, tCurrentParameterOptionsOptionItemToReplaceWith
local tCurrentParameterOptionsOptionDescriptionToReplace, tCurrentParameterOptionsOptionDescriptionToReplaceWith
local tCurrentParameterOptionsOptionValuesToReplace, tCurrentParameterOptionsOptionValuesToReplaceWith
local tCurrentParameterOptionsOptionValuesValueToReplace, tCurrentParameterOptionsOptionValuesValueToReplaceWith
local tCurrentParameterOptionsOptionValuesValueNameToReplace, tCurrentParameterOptionsOptionValuesValueNameToReplaceWith
local tCurrentParameterOptionsOptionValuesValueDescriptionToReplace, tCurrentParameterOptionsOptionValuesValueDescriptionToReplaceWith
local tTextStart, tTextEnd, tStrip, tOptionsTitle, tOptionsTitleWith
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToReplace
if the number of lines in tTextToReplace <= 2 and the number of characters in tTextToReplace < 30 then
if tTextToReplace is not empty then
replace tTextToReplace with "" in pData
end if
else
put tTextToReplace into tTextToReplaceWith
// HANDLE THE PARAMETERS
repeat while true
put libGetTextLocation (tTextToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterToReplace
if tCurrentParameterToReplace is empty then
exit repeat
end if
put tCurrentParameterToReplace into tCurrentParameterToReplaceWith
put libGetTextLocation (tCurrentParameterToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterNameToReplace
if tCurrentParameterNameToReplace is not empty then
put tCurrentParameterNameToReplace into tCurrentParameterNameToReplaceWith
replace "" with "" in tCurrentParameterNameToReplaceWith
replace "" with "<#S#><#S#>" in tCurrentParameterNameToReplaceWith
replace tCurrentParameterNameToReplace with tCurrentParameterNameToReplaceWith in tCurrentParameterToReplaceWith
end if
put libGetTextLocation (tCurrentParameterToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterDescriptionToReplace
if tCurrentParameterDescriptionToReplace is not empty then
put tCurrentParameterDescriptionToReplace into tCurrentParameterDescriptionToReplaceWith
replace "" with "<#E#><#E#> - " in tCurrentParameterDescriptionToReplaceWith
replace "" with "" in tCurrentParameterDescriptionToReplaceWith
replace tCurrentParameterDescriptionToReplace with tCurrentParameterDescriptionToReplaceWith in tCurrentParameterToReplaceWith
end if
// HANDLE OPTIONS
repeat while true
put libGetTextLocation (tCurrentParameterToReplaceWith, "", tTextStart, tTextEnd) into tCurrentParameterOptionsToReplace
if tCurrentParameterOptionsToReplace is empty then
exit repeat
end if
put tCurrentParameterOptionsToReplace into tCurrentParameterOptionsToReplaceWith
// HANDLE THE OPTIONS TITLE
put libGetTextLocation (tCurrentParameterOptionsToReplaceWith, "title=" & quote, quote & ">", tTextStart, tTextEnd) into tOptionsTitle
put tOptionsTitle into tOptionsTitleWith
if tOptionsTitleWith is not ("title=""e"e&">") and tOptionsTitleWith is not empty then
replace "title=" & quote with ("
") in tOptionsTitleWith
replace quote & ">" with "
" in tOptionsTitleWith
replace tOptionsTitle with tOptionsTitleWith in tCurrentParameterOptionsToReplaceWith
else
replace tOptionsTitle with "
" in tCurrentParameterOptionsToReplaceWith
end if
repeat while true
put libGetTextLocation (tCurrentParameterOptionsToReplaceWith, "", tTextStart, tTextEnd) into tCurrentParameterOptionsOptionToReplace
if tCurrentParameterOptionsOptionToReplace is empty then
exit repeat
end if
put tCurrentParameterOptionsOptionToReplace into tCurrentParameterOptionsOptionToReplaceWith
put libGetTextLocation (tCurrentParameterOptionsOptionToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterOptionsOptionItemToReplace
if tCurrentParameterOptionsOptionItemToReplace is not empty then
put tCurrentParameterOptionsOptionItemToReplace into tCurrentParameterOptionsOptionItemToReplaceWith
replace "" with "
" in tCurrentParameterOptionsOptionItemToReplaceWith
replace "
" with "<#S#><#S#>" in tCurrentParameterOptionsOptionItemToReplaceWith
replace tCurrentParameterOptionsOptionItemToReplace with tCurrentParameterOptionsOptionItemToReplaceWith in tCurrentParameterOptionsOptionToReplaceWith
end if
put libGetTextLocation (tCurrentParameterOptionsOptionToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterOptionsOptionDescriptionToReplace
if tCurrentParameterOptionsOptionDescriptionToReplace is not empty then
put tCurrentParameterOptionsOptionDescriptionToReplace into tCurrentParameterOptionsOptionDescriptionToReplaceWith
replace "" with "<#E#><#E#> - " in tCurrentParameterOptionsOptionDescriptionToReplaceWith
replace "" with "" in tCurrentParameterOptionsOptionDescriptionToReplaceWith
replace tCurrentParameterOptionsOptionDescriptionToReplace with tCurrentParameterOptionsOptionDescriptionToReplaceWith in tCurrentParameterOptionsOptionToReplaceWith
else
if offset ("", tCurrentParameterOptionsOptionToReplaceWith) > 0 then
replace "" with "<#E#><#E#>" in tCurrentParameterOptionsOptionToReplaceWith
end if
end if
// HANDLE VALUES
put libGetTextLocation (tCurrentParameterOptionsOptionToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterOptionsOptionValuesToReplace
if tCurrentParameterOptionsOptionValuesToReplace is not empty then
put tCurrentParameterOptionsOptionValuesToReplace into tCurrentParameterOptionsOptionValuesToReplaceWith
repeat while true
put libGetTextLocation (tCurrentParameterOptionsOptionValuesToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterOptionsOptionValuesValueToReplace
if tCurrentParameterOptionsOptionValuesValueToReplace is empty then
exit repeat
end if
put tCurrentParameterOptionsOptionValuesValueToReplace into tCurrentParameterOptionsOptionValuesValueToReplaceWith
put libGetTextLocation (tCurrentParameterOptionsOptionValuesValueToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterOptionsOptionValuesValueNameToReplace
if offset ("", tCurrentParameterOptionsOptionValuesValueToReplaceWith) > 0
then
replace "" with "" in tCurrentParameterOptionsOptionValuesValueToReplaceWith
if tCurrentParameterOptionsOptionValuesValueNameToReplace is not empty then
put tCurrentParameterOptionsOptionValuesValueNameToReplace into tCurrentParameterOptionsOptionValuesValueNameToReplaceWith
replace "" with "" in tCurrentParameterOptionsOptionValuesValueNameToReplaceWith
replace "" with "" in tCurrentParameterOptionsOptionValuesValueNameToReplaceWith
replace tCurrentParameterOptionsOptionValuesValueNameToReplace with tCurrentParameterOptionsOptionValuesValueNameToReplaceWith in tCurrentParameterOptionsOptionValuesValueToReplaceWith
end if
else
if tCurrentParameterOptionsOptionValuesValueNameToReplace is not empty then
put tCurrentParameterOptionsOptionValuesValueNameToReplace into tCurrentParameterOptionsOptionValuesValueNameToReplaceWith
replace "" with "" in tCurrentParameterOptionsOptionValuesValueNameToReplaceWith
replace "" with "<#S#><#S#>" in tCurrentParameterOptionsOptionValuesValueNameToReplaceWith
replace tCurrentParameterOptionsOptionValuesValueNameToReplace with tCurrentParameterOptionsOptionValuesValueNameToReplaceWith in tCurrentParameterOptionsOptionValuesValueToReplaceWith
end if
put libGetTextLocation (tCurrentParameterOptionsOptionValuesValueToReplaceWith, "", "", tTextStart, tTextEnd) into tCurrentParameterOptionsOptionValuesValueDescriptionToReplace
if tCurrentParameterOptionsOptionValuesValueDescriptionToReplace is not empty then
put tCurrentParameterOptionsOptionValuesValueDescriptionToReplace into tCurrentParameterOptionsOptionValuesValueDescriptionToReplaceWith
replace "" with "<#E#><#E#> - " in tCurrentParameterOptionsOptionValuesValueDescriptionToReplaceWith
replace "" with "" in tCurrentParameterOptionsOptionValuesValueDescriptionToReplaceWith
replace tCurrentParameterOptionsOptionValuesValueDescriptionToReplace with tCurrentParameterOptionsOptionValuesValueDescriptionToReplaceWith in tCurrentParameterOptionsOptionValuesValueToReplaceWith
end if
end if
replace "" with "
" in tCurrentParameterOptionsOptionValuesValueToReplaceWith
replace "
" with "" in tCurrentParameterOptionsOptionValuesValueToReplaceWith
replace tCurrentParameterOptionsOptionValuesValueToReplace with tCurrentParameterOptionsOptionValuesValueToReplaceWith in tCurrentParameterOptionsOptionValuesToReplaceWith
end repeat
replace "" with "
" in tCurrentParameterOptionsOptionValuesToReplaceWith
replace "
" with "
" in tCurrentParameterOptionsOptionValuesToReplaceWith
replace tCurrentParameterOptionsOptionValuesToReplace with tCurrentParameterOptionsOptionValuesToReplaceWith in tCurrentParameterOptionsToReplaceWith
end if
replace "" with "
" in tCurrentParameterOptionsOptionToReplaceWith
replace tCurrentParameterOptionsOptionToReplace with tCurrentParameterOptionsOptionToReplaceWith in tCurrentParameterOptionsToReplaceWith
end repeat
replace "" with "" in tCurrentParameterOptionsToReplaceWith
replace tCurrentParameterOptionsToReplace with tCurrentParameterOptionsToReplaceWith in tCurrentParameterToReplaceWith
end repeat
replace "" with "
" in tCurrentParameterToReplaceWith
replace "
" with "" in tCurrentParameterToReplaceWith
replace tCurrentParameterToReplace with tCurrentParameterToReplaceWith in tTextToReplaceWith
end repeat
replace "" with "
Parameters:
" in tTextToReplaceWith
replace "" with "" in tTextToReplaceWith
// STRIP OUT ALL MARKED BREAKS
repeat while true
put libGetTextLocation (tTextToReplaceWith, "<#S#><#S#>", "<#E#><#E#>", tTextStart, tTextEnd) into tStrip
if tStrip is empty then
exit repeat
end if
replace tStrip with "" in tTextToReplaceWith
end repeat
// STRIP OUT THE tags
replace tTextToReplace with tTextToReplaceWith in pData
end if
replace " " with "" in pData
return pData
end libUpdateParameters
function libUpdateDescription pData
local tTemp
// strip the overview, parameters, value and comments tags out of the description tags
local tTextToReplace, tTextToReplaceSub, tReplaceWith, tTextStart, tTextEnd, tTextStartSub, tTextEndSub, tPTagRequired
put false into tPTagRequired
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToReplace
if tTextToReplace is empty then
breakpoint
else
put tTextToReplace into tReplaceWith
// process the overview tags
put libGetTextLocation (tReplaceWith, "", "", tTextStartSub, tTextEndSub) into tTextToReplaceSub
if tTextToReplaceSub is not empty then
put the number of characters in tTextToReplaceSub into tTemp
if the number of lines in tTextToReplaceSub <= 2 and the number of characters in tTextToReplaceSub < 26 then
replace tTextToReplaceSub with "" in tReplaceWith
else
replace "" with "
" in tReplaceWith
replace "
" with "" in tReplaceWith
put true into tPTagRequired
end if
end if
// process the parameter tags
/*
put libGetTextLocation (tReplaceWith, "", "", tTextStartSub, tTextEndSub) into tTextToReplaceSub
if tTextToReplaceSub is not empty then
put the number of characters in tTextToReplaceSub into tTemp
if the number of lines in tTextToReplaceSub <= 2 and the number of characters in tTextToReplaceSub < 30 then
replace tTextToReplaceSub with "" in tReplaceWith
else
if tPTagRequired is true then
replace "" with "
Parameters:
" in tReplaceWith
else
replace "" with "
Parameters:
" in tReplaceWith
put true into tPTagRequired
end if
replace "
" with "
" in tReplaceWith
replace "" with "
" in tReplaceWith
replace "
" with "" in tReplaceWith
end if
end if
*/
// process the value tags
put libGetTextLocation (tReplaceWith, "", "", tTextStartSub, tTextEndSub) into tTextToReplaceSub
if tTextToReplaceSub is not empty then
put the number of characters in tTextToReplaceSub into tTemp
if the number of lines in tTextToReplaceSub <= 2 and the number of characters in tTextToReplaceSub < 20 then
replace tTextToReplaceSub with "" in tReplaceWith
else
if tPTagRequired is true then
replace "" with "
Value:
" in tReplaceWith
else
replace "" with "
Value:
" in tReplaceWith
put true into tPTagRequired
end if
replace "
" with "
" in tReplaceWith
end if
end if
// process the comments tags
put libGetTextLocation (tReplaceWith, "", "", tTextStartSub, tTextEndSub) into tTextToReplaceSub
if tTextToReplaceSub is not empty then
put the number of characters in tTextToReplaceSub into tTemp
if the number of lines in tTextToReplaceSub <= 2 and the number of characters in tTextToReplaceSub < 26 then
replace tTextToReplaceSub with "" in tReplaceWith
else
if tPTagRequired is true then
replace "" with "
Comments:
" in tReplaceWith
else
replace "" with "
Comments:
" in tReplaceWith
put true into tPTagRequired
end if
replace "
" with "
" in tReplaceWith
end if
end if
replace tTextToReplace with tReplaceWith in pData
end if
return pData
end libUpdateDescription
function libRemoveObsolete pData
// removes XML tags that contain no data
// this is needed to suppress referring headings
local tTextToReplace, tReplaceWith, tTextStart, tTextEnd
replace "" with "" in pData
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToReplace
if the number of lines in tTextToReplace is 2 then
replace tTextToReplace with "" in pData
end if
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToReplace
if the number of lines in tTextToReplace is 2 then
replace tTextToReplace with "" in pData
end if
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToReplace
if the number of lines in tTextToReplace is 2 then
replace tTextToReplace with "" in pData
end if
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToReplace
if the number of lines in tTextToReplace is 2 then
replace tTextToReplace with "" in pData
end if
return pData
end libRemoveObsolete
--function libUpdateGeneral pData
-- // updates the notation
-- // updates the notation
-- // updates the notation
-- // updates the notation
-- // updates the notation
-- // updates the notation
-- replace "" with "" in pData
-- replace "" with "" in pData
-- replace "" with "" in pData
-- replace "" with "" in pData
-- replace "" with "" in pData
-- replace "" with "" in pData
-- replace "" with "" in pData
-- replace "" with "" in pData
-- replace "" with "" in pData
-- replace "" with "" in pData
-- replace "" with "" in pData
-- replace "" with "" in pData
-- return pData
--end libUpdateGeneral
function libUpdateGeneral pData
local tTextStart, tTextEnd, tTextToUpdate
// updates the notation
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToUpdate
if tTextToUpdate is not empty then
replace "" with "Warning: " in pData
replace "" with "" in pData
end if
// updates the notation
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToUpdate
if tTextToUpdate is not empty then
replace "" with "Note: " in pData
replace "" with "" in pData
end if
// updates the notation
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToUpdate
if tTextToUpdate is not empty then
replace "" with "Cross-platform note: " in pData
replace "" with "" in pData
end if
// updates the notation
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToUpdate
if tTextToUpdate is not empty then
replace "" with " Caution! " in pData
replace "" with "" in pData
end if
// updates the notation
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToUpdate
if tTextToUpdate is not empty then
replace "" with " Cross-platform caution! " in pData
replace "" with "" in pData
end if
// updates the notation
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToUpdate
if tTextToUpdate is not empty then
replace "" with "Changes: " in pData
replace "" with "" in pData
end if
// updates the notation
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToUpdate
if tTextToUpdate is not empty then
replace "" with "Tip: " in pData
replace "" with "" in pData
end if
// updates the notation
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToUpdate
if tTextToUpdate is not empty then
replace "" with "Important! " in pData
replace "" with "" in pData
end if
// strip out caution images
replace " " with "" in pData
replace "" with "" in pData
// strip out tip images
replace " " with "" in pData
replace "" with "" in pData
// strip out cross-platform note images
replace " " with "" in pData
replace "" with "" in pData
// strip out important and gotcha images
replace " " with "" in pData
replace "" with "" in pData
// strip out cross-platform note images
replace " " with "" in pData
replace "" with "" in pData
return pData
end libUpdateGeneral
private function libGetTextLocation, pData, pStartToken, pEndToken, @rStart, @rEnd
local tTextFound
put empty into tTextFound
put offset (pStartToken, pData) into rStart
put offset (pEndToken, pData) into rEnd
if rStart > rEnd then
exit libGetTextLocation
breakpoint
end if
if rStart is not 0 and rEnd is not 0 then
put rEnd + the length of pEndToken - 1 into rEnd
put char rStart to rEnd of pData into tTextFound
end if
return tTextFound
end libGetTextLocation
function libUpdateSecurity pData
// updates the ... notation
local tTextToReplace, tReplaceWith, tTextStart, tTextEnd, tTempReplaceWith
put libGetTextLocation (pData, "", "", tTextStart, tTextEnd) into tTextToReplace
if tTextToReplace is empty then
breakpoint
else
put "--and----text--" into tReplaceWith
if offset ("", tTextToReplace) > 0 then
replace "--and--" with", " in tReplaceWith
replace "--text--" with "--and--Disk--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--and--" with", " in tReplaceWith
replace "--text--" with "--and--Disk--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--and--" with", " in tReplaceWith
replace "--text--" with "--and--Network--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--and--" with", " in tReplaceWith
replace "--text--" with "--and--Process--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--and--" with", " in tReplaceWith
replace "--text--" with "--and--RegistryRead--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--and--" with", " in tReplaceWith
replace "--text--" with "--and--RegistryWrite--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--and--" with", " in tReplaceWith
replace "--text--" with "--and--Stack--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--and--" with", " in tReplaceWith
replace "--text--" with "--and--Printing--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--and--" with", " in tReplaceWith
replace "--text--" with "--and--Privacy--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--and--" with", " in tReplaceWith
replace "--text--" with "--and--AppleScript--text--" in tReplaceWith
end if
if offset ("", tTextToReplace) > 0 then
replace "--and--" with", " in tReplaceWith
replace "--text--" with "--and--DoAlternate--text--" in tReplaceWith
end if
replace ", , " with "" in tReplaceWith
replace "--and----text--" with "" in tReplaceWith
replace "--text--" with "" in tReplaceWith
replace ", --and--" with "" in tReplaceWith
replace "--and--" with " and " in tReplaceWith
replace tTextToReplace with tReplaceWith in pData
end if
return pData
end libUpdateSecurity
LiveCode Docs Editor ÿÿÿÿ W Segoe UI U Segoe UI cREVGeometryCache stackID 1218 cREVGeneral breakpointconditions scripteditorvscroll 1713breakpoints scripteditorselection 3217breakpointstates stackfileversion 2.7AlreadyHidden false ê
card id 1002 PÑZlocal sTreeID
on preopencard
clearfields
end preopencard
on loadXML
local tXMLFile, tXMLData
put field "file" into tXMLFile
put url ("file:" & tXMLFile) into tXMLData
put tXMLData into field "xml source text" of group "xml source"
## Show the dictionary display
put revCreateXMLTree(tXMLData, false, true, false) into sTreeID
if sTreeID is not a number then
breakpoint
end if
end loadXML
on processXML
local tTree, tDescriptionStart, tDescriptionNames, tChildNames
put getTreeID() into tTree
displayFormattedTagContents "/doc/legacy_id","legacy_id"
displayFormattedTagContents "/doc/name","name"
displayFormattedTagContents "/doc/type","type"
## Basics
displayFormattedTagList "/doc/syntax", "example", "syntax"
displayFormattedTagList "/doc/synonyms", "synonym", "synonyms"
displayFormattedTagContents "/doc/summary", "summary"
--displayFormattedTagList "/doc/examples", "example", "examples"
displayExamplesList "/doc/examples", "example"
## History
displayFormattedTagContents "/doc/history/introduced", "introduced", true
displayFormattedTagList "/doc/history", "changed", "changed"
displayFormattedTagContents "/doc/history/deprecated", "deprecated", true
displayFormattedTagContents "/doc/history/removed", "removed", true
displayFormattedTagContents "/doc/history/experimental", "experimental", true
displayFormattedTagContents "/doc/history/nonexperimental", "nonexperimental", true
## Properties
displayTagListOptions "/doc/objects", "objects"
displayTagListOptions "/doc/platforms", "supported_platforms"
displayTagListOptions "/doc/classes", "classes"
displayTagListOptions "/doc/security", "security_settings"
## Classifications
displayFormattedTagList "/doc/classification", "category", "categories"
displayTagListOptions2 "/doc/classification", "concept", "concepts"
## References
displayFormattedTagList "/doc/references", "function", "functions"
displayFormattedTagList "/doc/references", "command", "commands"
displayFormattedTagList "/doc/references", "lesson", "lessons"
displayFormattedTagList "/doc/references", "link", "links"
displayFormattedTagList "/doc/references", "keyword", "keywords"
displayFormattedTagList "/doc/references", "message", "messages"
displayFormattedTagList "/doc/references", "property", "properties"
displayFormattedTagList "/doc/references", "operator", "operators"
displayFormattedTagList "/doc/references", "control_st", "control_sts"
## Description
## Is this an old or new description format
put revXMLChildNames(tTree,"/doc/description",comma,,true) into tDescriptionNames
if tDescriptionNames contains "overview" or tDescriptionNames contains "value" or tDescriptionNames contains "comments" then
## New format
## Overview
displayFormattedTagContents "/doc/description/overview", "overview"
## Parameters
put revXMLChildNames(tTree,"/doc/description/parameters",comma,,true) into tChildNames
if tChildNames is empty then
put empty into field "parameters"
else
-- repeat for each item tChild in tChildNames
-- if tChild contains "parameter" then
-- put revXMLChildContents(tTree,"/doc/description/parameters/" & tChild,":" ,comma, false, -1) into tParameterContents
-- split tParameterContents by comma and ":"
-- put tParameterContents["name"] & tab & tParameterContents["description"] & return after tParameters
-- end if
-- end repeat
-- delete the last char of tParameters
-- put tParameters into field "parameters"
--displayFormattedTagContents "/doc/description/parameters", "parameters"
displayPartialXML "/doc/description/parameters", "parameter", "parameters"
end if
## Value
displayFormattedTagContents "/doc/description/value", "value"
## Comments
displayFormattedTagContents "/doc/description/comments", "comments"
else
## Old style description
displayFormattedTagContents "/doc/description", "description"
end if
end processXML
function buildXML
local tXMLData, tFunctions, tCommands, tLessons, tLinks, tProperties, tOperators, tKeywords, tMessages, tControlStructures
put "" & return after tXMLData
put tab & getFormattedTagValue("legacy_id") & return after tXMLData
put tab & getFormattedTagValue("name") & return after tXMLData
put tab & getFormattedTagValue("type") & return after tXMLData
put return after tXMLData
## Basics
put tab & "" & return after tXMLData
put getTagList("example","syntax") after tXMLData
put tab & "" & return after tXMLData
put return after tXMLData
put tab & "" & return after tXMLData
put getTagList("synonym","synonyms") after tXMLData
put tab & "" & return after tXMLData
put return after tXMLData
put tab & getFormattedTagValue("summary") & return after tXMLData
put return after tXMLData
put tab & "" & return after tXMLData
put getExampleTagList("example","examples") after tXMLData
put tab & "" & return after tXMLData
## History
put return after tXMLData
put tab & "" & return after tXMLData
put tab & tab & getTagValueWithAttributes("introduced","version") & return after tXMLData
put tab & tab & getTagValueWithAttributes("deprecated","version") & return after tXMLData
put tab & tab & getTagValueWithAttributes("removed","version") & return after tXMLData
put tab & tab & getTagListWithAttributes("changed","changed","version") & return after tXMLData
put tab & tab & getTagValueWithAttributes("experimental","version") & return after tXMLData
put tab & tab & getTagValueWithAttributes("nonexperimental","version") & return after tXMLData
put tab & "" & return after tXMLData
put return after tXMLData
## Properties
put tab & "" & return after tXMLData
put getTagList(,"objects") after tXMLData
put tab & "" & return after tXMLData
put return after tXMLData
put tab & "" & return after tXMLData
put getTagList(,"supported_platforms") after tXMLData
put tab & "" & return after tXMLData
put return after tXMLData
put tab & "" & return after tXMLData
put getTagList(,"classes") after tXMLData
put tab & "" & return after tXMLData
put return after tXMLData
put tab & "" & return after tXMLData
put getTagList(,"security_settings") after tXMLData
put tab & "" & return after tXMLData
put return after tXMLData
## Classifications
put return after tXMLData
put tab & "" & return after tXMLData
put getTagList("category","categories") after tXMLData
put getTagList("concept","concepts") after tXMLData
put tab & "" & return after tXMLData
put return after tXMLData
## References
put tab & "" & return after tXMLData
put getTagListWithAttributes("function","functions","tag") into tFunctions
put getTagListWithAttributes("command","commands","tag") into tCommands
put getTagListWithAttributes("lesson","lessons","tag") into tLessons
put getTagListWithAttributes("link","links","tag") into tLinks
put getTagListWithAttributes("property","properties","tag") into tProperties
put getTagListWithAttributes("operator","operators","tag") into tOperators
put getTagListWithAttributes("keyword","keywords","tag") into tKeywords
put getTagListWithAttributes("message","messages","tag") into tMessages
put getTagListWithAttributes("control_st","control_sts","tag") into tControlStructures
if tFunctions is not empty then put tabFormat(tFunctions,2) & return after tXMLData
if tCommands is not empty then put tabFormat(tCommands,2) & return after tXMLData
if tLessons is not empty then put tabFormat(tLessons,2) & return after tXMLData
if tLinks is not empty then put tabFormat(tLinks,2) & return after tXMLData
if tProperties is not empty then put tabFormat(tProperties,2) & return after tXMLData
if tOperators is not empty then put tabFormat(tOperators,2) & return after tXMLData
if tKeywords is not empty then put tabFormat(tKeywords,2) & return after tXMLData
if tMessages is not empty then put tabFormat(tMessages,2) & return after tXMLData
if tControlStructures is not empty then put tabFormat(tControlStructures,2) & return after tXMLData
put tab & "" & return after tXMLData
put return after tXMLData
## Description
if field "description" is empty then
## New Style
put tab & "" & return after tXMLData
put tab & getFormattedTagValue("overview") & return after tXMLData
put return after tXMLData
//put tab & tab & "" & return after tXMLData
//put getTagList("parameter","parameters") after tXMLData
//put tab & tab & "" & return after tXMLData
put tab & tab & "" & return after tXMLData
put field "parameters" after tXMLData
put tab & tab & "" & return after tXMLData
--## For now use old form for parameters
--put tab & getFormattedTagValue("parameters") & return after tXMLData
put return after tXMLData
put tab & getFormattedTagValue("value") & return after tXMLData
put tab & getFormattedTagValue("comments") & return after tXMLData
put tab & "" & return after tXMLData
else
## Old style
put tab & getFormattedTagValue("description") & return after tXMLData
end if
put ""after tXMLData
return tXMLData
end buildXML
function buildOldXML
local tXML
put buildXML() into tXML
put libDocumentationOldFormat(tXML) into tXML
return tXML
end buildOldXML
function buildOldXML1
local tXMLData, tFunctions, tCommands, tLessons, tLinks, tKeywords, tHilitedLines, tHTMLText
put "" & return after tXMLData
put tab & getTagValue("name","name") & return after tXMLData
put tab & getTagValue("type","type") & return after tXMLData
put tab & getTagValue("syntax","syntax") & return after tXMLData
put tab & "" & getTagListOld(,"objects") & "" & return after tXMLData
put tab & "" & getTagListOld(,"synonyms") & "" & return after tXMLData
put tab & "" & getTagListOld("category","categories") & "" & return after tXMLData
put tab & "" & return after tXMLData
put getTagListOld("docRef","functions") into tFunctions
put getTagListOld("docRef","commands") into tCommands
put getTagListOld("docRef","lessons") into tLessons
put getTagListOld("docRef","links") into tLinks
put getTagListOld("docRef","keywords") into tKeywords
if tFunctions is not empty then put tFunctions & return after tXMLData
if tCommands is not empty then put tCommands & return after tXMLData
if tLessons is not empty then put tLessons & return after tXMLData
if tLinks is not empty then put tLinks & return after tXMLData
if tKeywords is not empty then put tKeywords & return after tXMLData
put tab & "" & return after tXMLData
put getOldTagValueWithAttributes("introduced","version") & return after tXMLData
put getOldTagValueWithAttributes("deprecated","version") & return after tXMLData
put getOldTagValueWithAttributes("removed","version") & return after tXMLData
put getOldTagValueWithAttributes("changed","version") & return after tXMLData
## Platforms
put the hilitedLines of field "supported_platforms" into tHilitedLines
repeat for each item tLineNum in tHilitedLines
put "<" & line tLineNum of field "supported_platforms" & "support=" & quote & "true" & quote & "/>" & return after tXMLData
end repeat
put "" & return after tXMLData
put getOldTagValue("summary","summary") & return after tXMLData
put getTagValue("example","examples") & return after tXMLData
## Description
if field "description" is empty then
-- put"
" & field ("overview") & "
" after tXMLData
-- put "
" & field "parameters" & "
" after tXMLData
-- put "
" & field "value" & "
" after tXMLData
-- put "
" & field "comments" & "
" after tXMLData
put"
" & field ("overview") after tXMLData
put "
Parameters:
" & the htmlText of field "parameters" & "
" after tXMLData
put "
Value:
" & the htmlText of field "value" & "
" after tXMLData
put "
Comments:
" & the htmlText of field "comments" & "
" after tXMLData
put "" after tXMLData
else
--put"
" & the htmltext of field ("description") & "
" after tXMLData
## Need the htmlText without a refs
put the htmltext of field ("description") into tHTMLText
replace "<" with return & "<" in tHTMLText
replace ">" with ">" & return in tHTMLText
replace return & return with return in tHTMLText
repeat with a = 1 to the number of lines in tHTMLText
if char 1 to 7 of line a of tHTMLText is "" & return) with ">" in tHTMLText
put"" & tHTMLText & "" after tXMLData
end if
put ""after tXMLData
return tXMLData
end buildOldXML1
## Display Functions
on displayFormattedTagContents pNodePath, pTag
local tTree, tNodeExists, tAttributes, tContents, tChildTags, x, tWordCount, tTextStyleList, tTagContents
put sTreeID into tTree
put revXMLNodeContents(tTree, pNodePath) into tNodeExists
if tNodeExists contains "xmlerr" then
set the htmlText of field pTag to empty
exit displayFormattedTagContents
end if
## First get the attributes
put revXMLAttributes(tTree,pNodePath,comma,return) into tAttributes
repeat for each line tAttribute in tAttributes
put item 2 of tAttribute & tab into tContents
end repeat
put revXMLChildNames(tTree,pNodePath,comma,,true, true) into tChildTags
put 0 into x
put 0 into tWordCount
put empty into tTextStyleList
if tChildTags is not empty then
repeat for each item tFormattingTag in tChildTags
if tFormattingTag is empty then
add 1 to x
put revXMLNodeContents(tTree, pNodePath & "/[" & x & "]") into tTagContents
replace "." with ". " in tTagContents
put tTagContents after tContents
else
put pNodePath & "/" & tFormattingTag into tNodePath
put revXMLAttributes(tTree,pNodePath,comma,return) into tAttributes
put getTagFormatting(tFormattingTag, tNodePath, tTagText) into tTagContents
--replace "." with ". " in tTagContents
put tTagContents after tContents
end if
end repeat
if the last char of tChildTags is comma then
add 1 to x
put revXMLNodeContents(tTree, pNodePath & "/[" & x & "]") into tTagContents
replace "." with ". " in tTagContents
put tTagContents after tContents
end if
else
put revXMLNodeContents(tTree, pNodePath) after tContents
end if
set the htmlText of field pTag to tContents
-- ## Tag content styling
-- put revXMLChildContents(tTree, pNodePath, tab ,return, true, -1) into tFormattingContents
-- if tChildTags is not empty then
-- repeat for each item tFormattingTag in tChildTags
-- put pNodePath & "/" & tFormattingTag into tNodePath
-- put tFormattingTag & tab & revXMLChildNames(tTree, tNodePath, comma ,, true,true) & return after tAllFormattingContents
-- end repeat
-- end if
-- put 0 into tWordCount
-- repeat for each line tLine in tAllFormattingContents
-- set the itemDel to tab
-- put item 1 of tLine into tChildTag
-- put item 2 of tLine into tContentsList
-- set the itemDel to comma
-- put pNodePath & "/" & tChildTag into tNodePath
-- repeat for each item tTag in tContentsList
-- put tNodePath & "/" & tTag into tNodeTagPath
-- put revXMLNodeContents(tTree, tNodeTagPath) into tTagContents
-- put revXMLAttributes(tTree,tNodeTagPath,":",comma) into tTagAttributes
-- if tTagContents is not empty and tTagContents is not space and tTagContents is not "." then
-- put tTagContents & return after msg
-- put tWordCount+1 & tab after tWordTagList
-- add the number of words of tTagContents to tWordCount
-- put tWordCount & tab & tTag & tab & tTagAttributes & tab & tTagContents & return after tWordTagList
-- end if
-- end repeat
-- end repeat
-- repeat for each line tTextStyle in tWordTagList
-- set the itemDel to tab
-- put item 1 of tTextStyle into tStartWord
-- put item 2 of tTextStyle into tEndWord
-- put item 3 of tTextStyle into tStyle
-- put item 4 of tTextStyle into tTag
-- set the itemDel to "["
-- delete item -1 of tStyle
-- if tTag is not empty then
-- delete char 1 to 4 of tTag
-- put " tag=" & quote & tTag & quote after tStyle
-- end if
-- if char 2 to -2 of tStyle is not a number and the length of tStyle is not 1 then
-- set the linkText of word tStartWord to tEndWord of field pTag to tStyle
-- end if
-- end repeat
end displayFormattedTagContents
function getFormattedTagList pNodePath, pTag
put sTreeID into tTree
put revXMLChildContents(tTree, pNodePath, tab ,return, true, -1) into tFormattingContents
put revXMLChildNames(tTree, pNodePath, return,,true) into tChildNames
end getFormattedTagList
function getFormattedTagContents pNodePath, pTag, pShowAttributes
put sTreeID into tTree
put revXMLChildContents(tTree, pNodePath, "/" ,return, false, 2) into tChildContents
put revXMLChildNames(tTree,pNodePath,comma,,true, true) into tChildTags
if tChildTags is not empty then
repeat for each item tFormattingTag in tChildTags
put pNodePath & "/" & tFormattingTag into tNodePath
put getTagFormatting(tFormattingTag, tNodePath) after tContents
end repeat
if the last char of tChildTags is comma then
add 1 to x
put revXMLNodeContents(tTree, pNodePath & "/[" & x & "]") into tNodeContents
## Allow < and > symbols in the html text
replace "<" with "<" in tNodeContents
replace ">" with ">" in tNodeContents
put tNodeContents after tContents
end if
else
put revXMLNodeContents(tTree, pNodePath) into tNodeContents
## Allow < and > symbols in the html text
replace "<" with "<" in tNodeContents
replace ">" with ">" in tNodeContents
put tNodeContents after tContents
end if
## EJB Testing
if pTag is "p" then
if char 1 to 3 of tContents is not "
" and char -4 to -1 of tContents is not "
" then
put "
" before tContents
put "
" after tContents
end if
end if
-- if the number of lines in tContents is 1 then
-- if char 1 to 3 of tContents is "
" and char -4 to -1 of tContents is "
" then
-- delete char -4 to -1 of tContents
-- delete char 1 to 3 of tContents
-- end if
-- end if
return tContents
end getFormattedTagContents
on displayTagListOptions pNodePath, pField
put getTreeID() into tTree
put revXMLChildNames(tTree,pNodePath,return,,false) into tChildNames
put empty into tHilitedLines
if tChildNames is empty then
set the hilitedLines of field pField to empty
else
set the hilitedLines of field pField to empty
repeat for each line tOption in tChildNames
put lineOffset(tOption, the text of field pField) & comma after tHilitedLines
set the itemDel to comma
end repeat
delete the last char of tHilitedLines
set the hilitedLines of field pField to tHilitedLines
end if
end displayTagListOptions
on displayTagListOptions2 pNodePath, pTag, pField
put getTreeID() into tTree
put revXMLChildContents(tTree, pNodePath,":" ,return, true, 0) into tChildContents
put empty into tHilitedLines
if tChildContents is empty then
set the hilitedLines of field pField to empty
else
repeat for each line tChild in tChildContents
set the itemDel to ":"
if char 1 to-4 of item 1 of tChild is pTag then
set the itemDel to ":"
put getFormattedTagContents(pNodePath & "/" & item 1 of tChild, pTag) into tChildValue
put lineOffset(tChildValue, the text of field pField) & comma after tHilitedLines
set the itemDel to comma
end if
set the itemDel to comma
end repeat
delete the last char of tHilitedLines
end if
set the hilitedLines of field pField to tHilitedLines
end displayTagListOptions2
on displayFormattedTagList pNodePath, pTag, pField
put getTreeID() into tTree
put revXMLChildNames(tTree, pNodePath, return, empty, true, true) into tChildNames
if tChildNames is empty then
put empty into field pField
else
repeat for each line tChild in tChildNames
if char 1 to-4 of item 1 of tChild is pTag then
## First get the attributes
put revXMLAttributes(tTree,pNodePath & "/" & tChild,comma,return) into tAttributes
repeat for each line tAttribute in tAttributes
set the itemDel to comma
put item 2 of tAttribute into tTagLabel
## Allow < and > symbols in the html text
replace "<" with "<" in tTagLabel
replace ">" with ">" in tTagLabel
put tTagLabel & tab after tTagContents
end repeat
set the itemDel to ":"
put getFormattedTagContents(pNodePath & "/" & tChild, pTag) into tChildValue
put tChildValue & " " after tTagContents
end if
set the itemDel to comma
end repeat
end if
set the htmltext of field pField to tTagContents
end displayFormattedTagList
on displayExamplesList pNodePath, pTag
put getTreeID() into tTree
put revXMLChildNames(tTree, pNodePath, return, empty, true, true) into tChildNames
if tChildNames is empty then
--put empty into field pField
else
put 0 into tExampleNum
repeat for each line tChild in tChildNames
if char 1 to-4 of item 1 of tChild is pTag then
put empty into tChildValue
add 1 to tExampleNum
end if
put getFormattedTagContents(pNodePath & "/" & tChild, char 1 to -4 of tChild) after tChildValue
if there is a field ("example" && tExampleNum) of group "examples" then
set the htmlText of field ("example" && tExampleNum) of group "examples" to tChildValue
end if
end repeat
end if
--set the htmltext of field pField to tTagContents
end displayExamplesList
on displayPartialXML pNodePath, pTag
put getTreeID() into tTree
put revXMLChildNames(tTree, pNodePath, return, empty, true, true) into tChildNames
set the text of field "parameters" to line 2 to -2 of revXMLText(tTree, pNodePath, true)
--set the htmltext of field pField to tTagContents
end displayPartialXML
function getTagFormatting pTagType, pNodePath
## Commented out for now to try and fix formatting
put revXMLNodeContents(sTreeID, pNodePath) into tNodeContents
replace "<" with "<" in tNodeContents
replace ">" with ">" in tNodeContents
if char 1 to 9 of pTagType is "parameter" then
## Get the tag attribute
put revXMLAttributes(sTreeID,pNodePath,comma,return) into tAttributes
put item 2 of tAttributes into tTagText
put "" & tNodeContents & "" into tFormattedContent
else if char 1 to 8 of pTagType is "function" then
## Get the tag attribute
put revXMLAttributes(sTreeID,pNodePath,comma,return) into tAttributes
put item 2 of tAttributes into tTagText
put "" & tNodeContents & "" into tFormattedContent
else if char 1 to 7 of pTagType is "message" then
## Get the tag attribute
put revXMLAttributes(sTreeID,pNodePath,comma,return) into tAttributes
put item 2 of tAttributes into tTagText
put "" & tNodeContents & "" into tFormattedContent
else if char 1 to 7 of pTagType is "keyword" then
## Get the tag attribute
put revXMLAttributes(sTreeID,pNodePath,comma,return) into tAttributes
put item 2 of tAttributes into tTagText
put "" & tNodeContents & "" into tFormattedContent
else if char 1 to 7 of pTagType is "command" then
## Get the tag attribute
put revXMLAttributes(sTreeID,pNodePath,comma,return) into tAttributes
put item 2 of tAttributes into tTagText
put "" & tNodeContents & "" into tFormattedContent
else if char 1 to 8 of pTagType is "operator" then
## Get the tag attribute
put revXMLAttributes(sTreeID,pNodePath,comma,return) into tAttributes
put item 2 of tAttributes into tTagText
put "" & tNodeContents & "" into tFormattedContent
else if char 1 to 8 of pTagType is "constant" then
## Get the tag attribute
put revXMLAttributes(sTreeID,pNodePath,comma,return) into tAttributes
put item 2 of tAttributes into tTagText
put "" & tNodeContents & "" into tFormattedContent
else if char 1 to 6 of pTagType is "object" then
## Get the tag attribute
put revXMLAttributes(sTreeID,pNodePath,comma,return) into tAttributes
put item 2 of tAttributes into tTagText
put "" & tNodeContents & "" into tFormattedContent
else if char 1 to 10 of pTagType is "control_st" then
## Get the tag attribute
put revXMLAttributes(sTreeID,pNodePath,comma,return) into tAttributes
put item 2 of tAttributes into tTagText
put "" & tNodeContents & "" into tFormattedContent
else if char 1 to 8 of pTagType is "glossary" then
## Get the tag attribute
put revXMLAttributes(sTreeID,pNodePath,comma,return) into tAttributes
put item 2 of tAttributes into tTagText
put "" & tNodeContents & "" into tFormattedContent
else if char 1 to 10 of pTagType is "expression" then
## Get the tag attribute
put revXMLAttributes(sTreeID,pNodePath,comma,return) into tAttributes
put item 2 of tAttributes into tTagText
put "" & tNodeContents & "" into tFormattedContent
else if char 1 to 8 of pTagType is "property" then
## Get the tag attribute
put revXMLAttributes(sTreeID,pNodePath,comma,return) into tAttributes
put item 2 of tAttributes into tTagText
put "" & tNodeContents & "" into tFormattedContent
else if char 1 to 7 of pTagType is "warning" then
put "Warning! " & getFormattedTagContents(pNodePath, pTagType) into tFormattedContent
else if char 1 to 4 of pTagType is "note" then
put "Note: " & getFormattedTagContents(pNodePath, pTagType) into tFormattedContent
else if char 1 to 7 of pTagType is "cp_note" then
put "Cross-platform Note: " & getFormattedTagContents(pNodePath, pTagType) into tFormattedContent
else if char 1 to 6 of pTagType is "change" then
put "Change: " & getFormattedTagContents(pNodePath, pTagType) into tFormattedContent
else if char 1 to 3 of pTagType is "tip" then
put "Tip: " & getFormattedTagContents(pNodePath, pTagType) into tFormattedContent
else if char 1 to 9 of pTagType is "important" then
put "Important! " & getFormattedTagContents(pNodePath, pTagType) into tFormattedContent
else if char 1 to 9 of pTagType is "caution" then
put "Caution! " & getFormattedTagContents(pNodePath, pTagType) into tFormattedContent
else if char 1 to 4 of pTagType is "code" then
--put "" & getFormattedTagContents(pNodePath, pTagType) & "" into tFormattedContent
else if char 1 of pTagType is "p" and char 1 to 9 of pTagType is not "parameter" and char 1 to 8 of pTagType is not "property" then
put "
" into tFormattedContent
else if char 1 of pTagType is "i" then
put "" & tNodeContents & "" into tFormattedContent
else if char 1 of pTagType is "u" then
put revXMLNodeContents(sTreeID, pNodePath) into tNodeContents
replace "<" with "<" in tNodeContents
replace ">" with ">" in tNodeContents
put "" & tNodeContents & "" into tFormattedContent
else if char 1 of pTagType is "b" then
put revXMLNodeContents(sTreeID, pNodePath) into tNodeContents
replace "<" with "<" in tNodeContents
replace ">" with ">" in tNodeContents
put "" & tNodeContents & "" into tFormattedContent
else
--replace "&" with "&" in tNodeContents
replace "<" with "<" in tNodeContents
replace ">" with ">" in tNodeContents
put tNodeContents into tFormattedContent
--put revXMLNodeContents(sTreeID, pNodePath) into tFormattedContent
end if
return tFormattedContent
end getTagFormatting
## Functions to retrieve edited data
function getTagValueWithAttributes pTag, pAttributeList
put "<" & pTag into tTagContents
if pAttributeList is not empty then
repeat with a = 1 to the number of items in pAttributeList
put space & item a of pAttributeList & "=" & quote after tTagContents
set the itemDel to tab
put item a of field pTag & quote after tTagContents
set the itemDel to comma
end repeat
end if
put ">" after tTagContents
set the itemDel to tab
put the last item of field pTag of group "xml editing" after tTagContents
put "" & pTag & ">" after tTagContents
return tTagContents
end getTagValueWithAttributes
function getOldTagValueWithAttributes pTag, pAttributeList
put "<" & pTag into tTagContents
if pAttributeList is not empty then
repeat with a = 1 to the number of items in pAttributeList
put space & item a of pAttributeList & "=" & quote after tTagContents
set the itemDel to tab
put item a of field pTag & quote after tTagContents
set the itemDel to comma
end repeat
end if
put "/>" after tTagContents
return tTagContents
end getOldTagValueWithAttributes
function getFormattedTagValue pTag
put "<" & pTag & ">" into tTagContents
put the htmlText of field pTag of group "xml editing" into tHtmlText
if the last char of tHTMLText is return then delete the last char of tHTMLText
## Repeat any empty lines at the end of the text
repeat until char -7 to -1 of tHTMLText is not ""
delete char -7 to -1 of tHTMLText
if the last char of tHTMLText is return then delete the last char of tHTMLText
end repeat
## Single lines don't need p tags
if the number of lines in tHTMLText is 1 then
if char 1 to 3 of tHTMLText is "
" then
delete char 1 to 3 of tHTMLText
end if
if char - 4 to -1 of tHTMLText is "
" then
delete char -4 to -1 of tHTMLText
end if
end if
replace "<" with return & "<" in tHTMLText
replace ">" with ">" & return in tHTMLText
replace return & return with return in tHTMLText
## If there is more than one paragraph the first para tags are not needed
if line 2 of tHTMLText is "
" then
put empty into line 2 of tHTMLText
put lineOffset("