; Takes an array and returns it in a markdown flavored list ; If the list is a retun, then, there is no variable name... Func ArrayToList($Array, $Return) $String = "" $i = 0 do $String &= "* " $String &= $Array[$i] & " " If $Return Then If $Array[$i + 2] == "" or $Array[$i + 2] == " " Then $String &= @CRLF Else $String &= " " & $Array[$i + 1] & " " & $Array[$i + 2] & @CRLF EndIf Else $String &= $Array[$i + 1] If $Array[$i + 2] == "" or $Array[$i + 2] == " " Then $String &= @CRLF Else $String &= " : " & $Array[$i + 2] & @CRLF EndIf EndIf $i += 3 Until $i >= UBound($Array) Return $String EndFunc Func WriteModule($Block, $Group) Local $ModuleName = ParseForOneTag($Block, "@module") DirCreate(@ScriptDir & "\TEMP") Local $Output = FileOpen(@ScriptDir & "\TEMP\" & $Group & "." & $ModuleName & ".md", $FO_OVERWRITE) Local $Data = "" Local $DataPos = 1 FileWrite($Log, @CRLF&@TAB&"Writing "&$Group & "." & $ModuleName & ".md" &@CRLF) FileWrite($Log, "Writing Module "&$ModuleName&@CRLF) ; Add title of Module FileWrite($Output, "# " & $Group & "." & $ModuleName & " Module" & @CRLF) ; Copy the short description While StringRight($Data, 1) <> @CRLF And StringRight($Data, 1) <> @CR If StringRight($Data, 7) == "@module" Then ; If there is no comment in the module block Return $Output EndIf $Data &= StringMid($Block, $DataPos, 1) $DataPos += 1 WEnd $Data = StringTrimRight($Data, 1) $Block = StringTrimLeft($Block, $DataPos) FileWrite($Output, $Data & @CRLF) ; copy the long description $DataPos = 1 $Data = "" $Omit = False While StringRight($Data, 7) <> "@module" $Data &= StringMid($Block, $DataPos, 1) $DataPos += 1 WEnd $Data = StringTrimRight($Data, 8) FileWrite($Output, $Data & @CRLF) Return $Output EndFunc Func WriteType($Block, $ModuleName, $Output) Local $TypeName = ParseForOneTag($Block, "@type") Local $ParentClass = GetData($TypeName, "parent") Local $Fields = ParseForTags($Block, "@field") FileWrite($Log, "Writing Type "&$TypeName&@CRLF) ; Add title of Type FileWrite($Output, "## " & $TypeName & " Class" & @CRLF) ; Add hierearchy info if necessary. Some cool ASCII drawing is going on ! If $ParentClass <> "ROOT" Then FileWrite($Output, "
" & @CRLF) FileWrite($Output, "Inheritance : The " & $TypeName & " Class inherits from the following parents :" & @CRLF) Local $Hierarchy = GetParents($TypeName) Local $String = "" Local $TabBuffer = @TAB $String &= $Hierarchy[0]&@CRLF For $i=1 to UBound($Hierarchy)-1 $String &= $TabBuffer&"`-- "&$Hierarchy[$i]&@CRLF $TabBuffer &= @TAB Next FileWrite($Output, $String) FileWrite($Output, "" & @CRLF) Else FileWrite($Output, "
" & @CRLF) FileWrite($Output, "The " & $TypeName & " class does not inherit" & @CRLF) FileWrite($Output, "" & @CRLF) EndIf ; Copy the long description Local $DataPos = 1 Local $Data = "" Local $Omit = False While StringRight($Data, 1) <> @CR ; We discard the first line $Data &= StringMid($Block, $DataPos, 1) $DataPos += 1 WEnd ; If there is a tag in the first line, there is no description if StringInStr($Data, "@type") == 0 and StringInStr($Data, "@extends") == 0 and StringInStr($Data, "@field") == 0 Then $Data = "" $DataPos += 1 While StringRight($Data, 5) <> "@type" $Data &= StringMid($Block, $DataPos, 1) $DataPos += 1 WEnd $Data = StringTrimRight($Data, 5) FileWrite($Output, $Data & @CRLF) EndIf ; Add the Attributes If IsArray($Fields) Then FileWrite($Output, "