[DEVELOPMENT ENVIRONMENT]
* NEW: Some little icons in the project property component tab show the state of each component (stable, not finished, unstable). * NEW: The help comments are now interpreted with a new "Gambas markup syntax" inspired from markdown syntax. People that have written comments in the old syntax will cry... git-svn-id: svn://localhost/gambas/trunk@5117 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
91b5cc2270
commit
a08c8e65f0
8 changed files with 632 additions and 108 deletions
|
@ -322,55 +322,6 @@ msgstr ""
|
|||
msgid "Loading information on component &1..."
|
||||
msgstr ""
|
||||
|
||||
#: CComponentBox.class:221 ComponentItem.class:140 FPropertyComponent.form:73
|
||||
msgid "Experimental"
|
||||
msgstr ""
|
||||
|
||||
#: CComponentBox.class:223 ComponentItem.class:142 FPropertyComponent.form:73
|
||||
msgid "Not finished but stable"
|
||||
msgstr ""
|
||||
|
||||
#: CComponentBox.class:235 ComponentItem.class:145 ProjectItem.class:67
|
||||
msgid "Authors"
|
||||
msgstr ""
|
||||
|
||||
#: CComponentBox.class:242 ComponentItem.class:152 FPropertyComponent.form:106
|
||||
#: LibraryItem.class:63
|
||||
msgid "Requires"
|
||||
msgstr ""
|
||||
|
||||
#: CComponentBox.class:244 ComponentItem.class:154
|
||||
msgid "Excludes"
|
||||
msgstr ""
|
||||
|
||||
#: CComponentBox.class:250 ComponentItem.class:160
|
||||
msgid "Implements"
|
||||
msgstr ""
|
||||
|
||||
#: CComponentBox.class:263 ComponentItem.class:173 LibraryItem.class:61
|
||||
msgid "Provides"
|
||||
msgstr ""
|
||||
|
||||
#: CComponentBox.class:375 ComponentItem.class:241
|
||||
msgid "This component is required by the following library:<p>&1"
|
||||
msgstr ""
|
||||
|
||||
#: CComponentBox.class:377 ComponentItem.class:243
|
||||
msgid "This component is required by the following libraries:<p>&1"
|
||||
msgstr ""
|
||||
|
||||
#: CComponentBox.class:386 ComponentItem.class:252
|
||||
msgid "This component is required by:<p>&1"
|
||||
msgstr ""
|
||||
|
||||
#: CComponentBox.class:387 ComponentItem.class:253
|
||||
msgid "Keep"
|
||||
msgstr ""
|
||||
|
||||
#: CComponentBox.class:387 ComponentItem.class:253 FDebugInfo.form:134
|
||||
msgid "Remove all"
|
||||
msgstr ""
|
||||
|
||||
#: CInsertColor.class:106 FEditor.form:419 FTextEditor.form:348
|
||||
msgid "Insert color"
|
||||
msgstr ""
|
||||
|
@ -479,6 +430,54 @@ msgid ""
|
|||
"the GNU General Public License."
|
||||
msgstr ""
|
||||
|
||||
#: ComponentItem.class:140 FPropertyComponent.form:73
|
||||
msgid "Experimental"
|
||||
msgstr ""
|
||||
|
||||
#: ComponentItem.class:142 FPropertyComponent.form:73
|
||||
msgid "Not finished but stable"
|
||||
msgstr ""
|
||||
|
||||
#: ComponentItem.class:145 ProjectItem.class:67
|
||||
msgid "Authors"
|
||||
msgstr ""
|
||||
|
||||
#: ComponentItem.class:152 FPropertyComponent.form:106 LibraryItem.class:63
|
||||
msgid "Requires"
|
||||
msgstr ""
|
||||
|
||||
#: ComponentItem.class:154
|
||||
msgid "Excludes"
|
||||
msgstr ""
|
||||
|
||||
#: ComponentItem.class:160
|
||||
msgid "Implements"
|
||||
msgstr ""
|
||||
|
||||
#: ComponentItem.class:173 LibraryItem.class:61
|
||||
msgid "Provides"
|
||||
msgstr ""
|
||||
|
||||
#: ComponentItem.class:241
|
||||
msgid "This component is required by the following library:<p>&1"
|
||||
msgstr ""
|
||||
|
||||
#: ComponentItem.class:243
|
||||
msgid "This component is required by the following libraries:<p>&1"
|
||||
msgstr ""
|
||||
|
||||
#: ComponentItem.class:252
|
||||
msgid "This component is required by:<p>&1"
|
||||
msgstr ""
|
||||
|
||||
#: ComponentItem.class:253
|
||||
msgid "Keep"
|
||||
msgstr ""
|
||||
|
||||
#: ComponentItem.class:253 FDebugInfo.form:134
|
||||
msgid "Remove all"
|
||||
msgstr ""
|
||||
|
||||
#: Design.module:159 Project.module:2073
|
||||
msgid "first"
|
||||
msgstr ""
|
||||
|
@ -2598,7 +2597,7 @@ msgstr ""
|
|||
msgid "Show added files"
|
||||
msgstr ""
|
||||
|
||||
#: FMain.form:1355 FProperty.form:23 MHelp.module:574
|
||||
#: FMain.form:1355 FProperty.form:23 MHelp.module:577
|
||||
msgid "Properties"
|
||||
msgstr ""
|
||||
|
||||
|
@ -2702,7 +2701,7 @@ msgstr ""
|
|||
msgid "Create a shortcut on the desktop"
|
||||
msgstr ""
|
||||
|
||||
#: FMakeExecutable.class:18 FPropertyProject.class:1165
|
||||
#: FMakeExecutable.class:18 FPropertyProject.class:1170
|
||||
msgid "Gambas applications"
|
||||
msgstr ""
|
||||
|
||||
|
@ -2880,7 +2879,7 @@ msgstr ""
|
|||
msgid "There is no CHANGELOG entry for this release."
|
||||
msgstr ""
|
||||
|
||||
#: FMakeInstall.class:356 FPropertyProject.class:909 FSave.form:21
|
||||
#: FMakeInstall.class:356 FPropertyProject.class:914 FSave.form:21
|
||||
#: Project.module:3200
|
||||
msgid "Continue"
|
||||
msgstr ""
|
||||
|
@ -3799,43 +3798,43 @@ msgstr ""
|
|||
msgid "Some components are missing: &1"
|
||||
msgstr ""
|
||||
|
||||
#: FPropertyProject.class:535
|
||||
#: FPropertyProject.class:537
|
||||
msgid "These components are incompatible:<br>&1."
|
||||
msgstr ""
|
||||
|
||||
#: FPropertyProject.class:548
|
||||
#: FPropertyProject.class:550
|
||||
msgid "The &1 component needs one of the following components:<br>&2."
|
||||
msgstr ""
|
||||
|
||||
#: FPropertyProject.class:555
|
||||
#: FPropertyProject.class:557
|
||||
msgid "The &1 component needs the &2 component."
|
||||
msgstr ""
|
||||
|
||||
#: FPropertyProject.class:865
|
||||
#: FPropertyProject.class:870
|
||||
msgid "There is no change to commit."
|
||||
msgstr ""
|
||||
|
||||
#: FPropertyProject.class:900
|
||||
#: FPropertyProject.class:905
|
||||
msgid "Unable to update project from repository."
|
||||
msgstr ""
|
||||
|
||||
#: FPropertyProject.class:902
|
||||
#: FPropertyProject.class:907
|
||||
msgid "Project has been updated from repository successfully."
|
||||
msgstr ""
|
||||
|
||||
#: FPropertyProject.class:909
|
||||
#: FPropertyProject.class:914
|
||||
msgid "You are going to cancel your changes!"
|
||||
msgstr ""
|
||||
|
||||
#: FPropertyProject.class:1164
|
||||
#: FPropertyProject.class:1169
|
||||
msgid "Select a Gambas application"
|
||||
msgstr ""
|
||||
|
||||
#: FPropertyProject.class:1175
|
||||
#: FPropertyProject.class:1180
|
||||
msgid "<b>&1</b> is already used as a library."
|
||||
msgstr ""
|
||||
|
||||
#: FPropertyProject.class:1181
|
||||
#: FPropertyProject.class:1186
|
||||
msgid "<b>&1</b> does not export any class."
|
||||
msgstr ""
|
||||
|
||||
|
@ -5583,37 +5582,37 @@ msgstr ""
|
|||
msgid "No help found."
|
||||
msgstr ""
|
||||
|
||||
#: MHelp.module:575
|
||||
#: MHelp.module:578
|
||||
msgid "Variables"
|
||||
msgstr ""
|
||||
|
||||
#: MHelp.module:576
|
||||
#: MHelp.module:579
|
||||
msgid "Methods"
|
||||
msgstr ""
|
||||
|
||||
#: MHelp.module:577
|
||||
#: MHelp.module:580
|
||||
msgid "Events"
|
||||
msgstr ""
|
||||
|
||||
#: MHelp.module:605
|
||||
#: MHelp.module:608
|
||||
msgid ""
|
||||
"This class can be used like an object by creating an hidden instance on "
|
||||
"demand.<br>"
|
||||
msgstr ""
|
||||
|
||||
#: MHelp.module:606
|
||||
#: MHelp.module:609
|
||||
msgid "This class is creatable.<br>"
|
||||
msgstr ""
|
||||
|
||||
#: MHelp.module:629
|
||||
#: MHelp.module:632
|
||||
msgid "This class inherits &1."
|
||||
msgstr ""
|
||||
|
||||
#: MHelp.module:644 MTheme.module:6
|
||||
#: MHelp.module:647 MTheme.module:6
|
||||
msgid "Symbols"
|
||||
msgstr ""
|
||||
|
||||
#: MHelp.module:645
|
||||
#: MHelp.module:648
|
||||
msgid "Constants"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -908,7 +908,7 @@ Public Function GetHelpHTML() As String
|
|||
If Highlight.Types[i] = Highlight.Help Then
|
||||
sLine = Trim(Highlight.Symbols[i])
|
||||
'If sLine Begins "''" Then
|
||||
sHelp = DecodeHelpLine(Trim(Mid$(sLine, 3)))
|
||||
sHelp = Trim(Mid$(sLine, 3))
|
||||
'Endif
|
||||
Endif
|
||||
Endif
|
||||
|
@ -919,8 +919,8 @@ Public Function GetHelpHTML() As String
|
|||
|
||||
For i = iLine - 1 To 0 Step -1
|
||||
sLine = Trim(hEdit.Lines[i].Text)
|
||||
If sLine Begins "''" Then
|
||||
sHelp = DecodeHelpLine(Trim(Mid(sLine, 3))) & "\n" & sHelp
|
||||
If sLine Begins "'' " Then
|
||||
sHelp = RTrim(Mid(sLine, 4)) & "\n" & sHelp
|
||||
Else
|
||||
If Trim(sLine) = "" Then Continue
|
||||
Break
|
||||
|
@ -929,6 +929,11 @@ Public Function GetHelpHTML() As String
|
|||
|
||||
Endif
|
||||
|
||||
' Convert into HTML using the markup syntax
|
||||
Try sHelp = Markup.Convert(sHelp)
|
||||
If Error Then sHelp = "<b>" & Error.Text & "</b>"
|
||||
Print sHelp
|
||||
|
||||
'If Not s Then s = ("No help found.")
|
||||
|
||||
sHTML = File.Load("help/symbol-help.html")
|
||||
|
|
|
@ -310,24 +310,24 @@ Public Sub GetSpecialURL(sSymbol As String) As String
|
|||
|
||||
End
|
||||
|
||||
'' +Description
|
||||
'' ## Description ##
|
||||
'' Initialize a web browser view with the help on a specific symbol.
|
||||
'' +Arguments
|
||||
'' - #hWebView# is the WebView control to initialize.
|
||||
'' - #iType# is the type of the symbol.
|
||||
'' - #sSymbol# is the symbol.
|
||||
'' - #sClass# is the class if the symbol is a member of this class.
|
||||
'' - #sMore# is a suffix that will be added to the URL of the help page.
|
||||
'' - #hEditor# is the source code editor that the symbol comes from.
|
||||
'' +Symbol types
|
||||
'' The #iType# argument can be one of the following constants, defined in the MHelp module:
|
||||
'' - =TYPE_NATIVE= for a native datatype.
|
||||
'' - =TYPE_CLASS= for a class.
|
||||
'' - =TYPE_CONTROL= for a control name.
|
||||
'' - =TYPE_SYMBOL= for a class symbol, a local or a global variable.
|
||||
'' - =TYPE_EVENT= for an event.
|
||||
'' - =TYPE_KEYWORD= for a language keyword.
|
||||
'' - =TYPE_SPECIAL= for a special method.
|
||||
'' ## Arguments ##
|
||||
'' - *hWebView* is the WebView control to initialize.
|
||||
'' - *iType* is the type of the symbol.
|
||||
'' - *sSymbol* is the symbol.
|
||||
'' - *sClass* is the class if the symbol is a member of this class.
|
||||
'' - *sMore* is a suffix that will be added to the URL of the help page.
|
||||
'' - *hEditor* is the source code editor that the symbol comes from.
|
||||
'' ## Symbol types ##
|
||||
'' The *iType* argument can be one of the following constants, defined in the MHelp module:
|
||||
'' - `TYPE_NATIVE` for a native datatype.
|
||||
'' - `TYPE_CLASS` for a class.
|
||||
'' - `TYPE_CONTROL` for a control name.
|
||||
'' - `TYPE_SYMBOL` for a class symbol, a local or a global variable.
|
||||
'' - `TYPE_EVENT` for an event.
|
||||
'' - `TYPE_KEYWORD` for a language keyword.
|
||||
'' - `TYPE_SPECIAL` for a special method.
|
||||
|
||||
Public Sub InitWebViewWith(hWebView As WebView, iType As Integer, sSymbol As String, Optional sClass As String, Optional sMore As String, Optional hEditor As FEditor)
|
||||
|
||||
|
@ -427,24 +427,27 @@ Public Sub InitWebViewWith(hWebView As WebView, iType As Integer, sSymbol As Str
|
|||
|
||||
End
|
||||
|
||||
'' +Description
|
||||
'' Description
|
||||
'' -----------
|
||||
'' Initialize the help browser with the help on a specific symbol, and show it automatically.
|
||||
'' +Arguments
|
||||
'' - #hWebView# is the WebView control to initialize.
|
||||
'' - #iType# is the type of the symbol.
|
||||
'' - #sSymbol# is the symbol.
|
||||
'' - #sClass# is the class if the symbol is a member of this class.
|
||||
'' - #sMore# is a suffix that will be added to the URL of the help page.
|
||||
'' +Symbol types
|
||||
'' Arguments
|
||||
'' ---------
|
||||
'' - *hWebView* is the WebView control to initialize.
|
||||
'' - *iType* is the type of the symbol.
|
||||
'' - *sSymbol* is the symbol.
|
||||
'' - *sClass* is the class if the symbol is a member of this class.
|
||||
'' - *sMore* is a suffix that will be added to the URL of the help page.
|
||||
'' Symbol types
|
||||
'' ------------
|
||||
'' The #iType# argument can be one of the following constants, defined in the MHelp module:
|
||||
'' - =TYPE_NATIVE= for a native datatype.
|
||||
'' - =TYPE_CLASS= for a class.
|
||||
'' - =TYPE_CONTROL= for a control name.
|
||||
'' - =TYPE_SYMBOL= for a class symbol, a local or a global variable.
|
||||
'' - =TYPE_EVENT= for an event.
|
||||
'' - =TYPE_KEYWORD= for a language keyword.
|
||||
'' - =TYPE_SPECIAL= for a special method.
|
||||
'' - =TYPE_COMPONENT= for a component help page.
|
||||
'' - `TYPE_NATIVE` for a native datatype.
|
||||
'' - `TYPE_CLASS` for a class.
|
||||
'' - `TYPE_CONTROL` for a control name.
|
||||
'' - `TYPE_SYMBOL` for a class symbol, a local or a global variable.
|
||||
'' - `TYPE_EVENT` for an event.
|
||||
'' - `TYPE_KEYWORD` for a language keyword.
|
||||
'' - `TYPE_SPECIAL` for a special method.
|
||||
'' - `TYPE_COMPONENT` for a component help page.
|
||||
|
||||
Public Sub ShowHelpBrowserWith(hWebView As WebView, iType As Integer, sSymbol As String, Optional sClass As String, Optional sMore As String)
|
||||
|
||||
|
|
512
app/src/gambas3/.src/Help/Markup.module
Normal file
512
app/src/gambas3/.src/Help/Markup.module
Normal file
|
@ -0,0 +1,512 @@
|
|||
' Gambas module file
|
||||
|
||||
Public Struct MarkupList
|
||||
sType As String
|
||||
iIndent As Integer
|
||||
End Struct
|
||||
|
||||
Private $aMarkup As String[]
|
||||
Private $cLink As Collection
|
||||
Private $aList As MarkupList[]
|
||||
|
||||
Private Sub GetIndent(sLine As String) As Integer
|
||||
|
||||
Return Len(sLine) - Len(LTrim(sLine))
|
||||
|
||||
End
|
||||
|
||||
|
||||
Public Sub Convert(sMarkup As String) As String
|
||||
|
||||
Dim iLine As Integer
|
||||
Dim aLine As String[]
|
||||
Dim aResult As String[]
|
||||
Dim sLine As String
|
||||
Dim sText As String
|
||||
Dim sResult As String
|
||||
Dim I, I2 As Integer
|
||||
Dim iPara As Integer
|
||||
Dim bCode As Boolean
|
||||
Dim iBlockQuote As Integer
|
||||
Dim sCar As String
|
||||
Dim bInsidePar As Boolean
|
||||
Dim bAddPar As Boolean
|
||||
Dim iIndent, iCurrentIndent, iLastIndent As Integer
|
||||
Dim hMarkupList As MarkupList
|
||||
Dim bJustList As Boolean
|
||||
|
||||
$aMarkup = New String[]
|
||||
$cLink = New Collection
|
||||
$aList = New MarkupList[]
|
||||
|
||||
aLine = Split(sMarkup, "\n")
|
||||
aResult = New String[]
|
||||
|
||||
For iLine = 0 To aLine.Max
|
||||
|
||||
sLine = LTrim(aLine[iLine])
|
||||
If Not sLine Then Continue
|
||||
If Left(sLine) <> "[" Then Continue
|
||||
I = InStr(sLine, "]:")
|
||||
If I = 0 Then Continue
|
||||
If I >= 3 Then
|
||||
$cLink[Mid$(sLine, 2, I - 2)] = Trim(Mid$(sLine, I + 2))
|
||||
Endif
|
||||
aLine[iLine] = ""
|
||||
|
||||
Next
|
||||
|
||||
For iLine = 0 To aLine.Max
|
||||
|
||||
sLine = aLine[iLine]
|
||||
|
||||
If $aMarkup.Count Then
|
||||
aResult.Add(ConvertLine(sLine))
|
||||
Continue
|
||||
Endif
|
||||
|
||||
sLine = RTrim(sLine)
|
||||
|
||||
' Lists
|
||||
|
||||
If Trim(sLine) Then
|
||||
|
||||
iIndent = GetIndent(sLine)
|
||||
GoSub CLOSE_LIST
|
||||
|
||||
sLine = Mid$(sLine, iCurrentIndent + 1)
|
||||
|
||||
If sLine Begins "* " Or If sLine Begins "+ " Or If sLine Begins "- " Then
|
||||
hMarkupList = New MarkupList
|
||||
hMarkupList.sType = "ul"
|
||||
hMarkupList.iIndent = iIndent + 1 + GetIndent(Mid$(sLine, 2))
|
||||
$aList.Add(hMarkupList)
|
||||
If aResult.Count And If Trim(aResult[aResult.Max]) = "</ul>" Then
|
||||
aResult.Remove(aResult.Max)
|
||||
Else
|
||||
GoSub CLOSE_PARA
|
||||
aResult.Add(Space$(iCurrentIndent) & "<ul>")
|
||||
Endif
|
||||
iCurrentIndent = hMarkupList.iIndent
|
||||
aResult.Add(Space$(iCurrentIndent) & "<li>")
|
||||
bJustList = True
|
||||
sLine = Mid$(sLine, 3)
|
||||
Endif
|
||||
|
||||
Endif
|
||||
|
||||
If sLine Begins "==" And If sLine = String$(Len(sLine), "=") Then
|
||||
sLine = aResult[aResult.Max]
|
||||
If sLine Not Begins "<h" Then
|
||||
If sLine Begins "<p>" Then
|
||||
sLine = Mid$(sLine, 4)
|
||||
bInsidePar = False
|
||||
Endif
|
||||
GoSub CLOSE_PARA
|
||||
aResult[aResult.Max] = "<h1>" & sLine & "</h1>"
|
||||
Endif
|
||||
Continue
|
||||
Endif
|
||||
|
||||
If sLine Begins "--" And If sLine = String$(Len(sLine), "-") Then
|
||||
sLine = Trim(aResult[aResult.Max])
|
||||
If sLine Then
|
||||
If sLine Not Begins "<h" Then
|
||||
If sLine Begins "<p>" Then
|
||||
sLine = Mid$(sLine, 4)
|
||||
bInsidePar = False
|
||||
Endif
|
||||
GoSub CLOSE_PARA
|
||||
aResult[aResult.Max] = "<h2>" & sLine & "</h2>"
|
||||
Endif
|
||||
Continue
|
||||
Endif
|
||||
Endif
|
||||
|
||||
' Code
|
||||
|
||||
If sLine Begins " " Or If sLine Begins gb.Tab Then
|
||||
|
||||
If Left(sLine) = gb.Tab Then
|
||||
sLine = Mid$(sLine, 2)
|
||||
Else
|
||||
sLine = Mid$(sLine, 5)
|
||||
Endif
|
||||
sLine = Html$(sLine)
|
||||
If Not bCode Then
|
||||
bCode = True
|
||||
sLine = "<pre><code>" & sLine
|
||||
Endif
|
||||
aResult.Add(sLine)
|
||||
Continue
|
||||
|
||||
Endif
|
||||
|
||||
GoSub CLOSE_CODE
|
||||
|
||||
' Blockquote
|
||||
|
||||
I = 0
|
||||
Do
|
||||
If Left(sLine) <> ">" Then Break
|
||||
sCar = Mid$(sLine, 2, 1)
|
||||
If sCar <> " " And If sCar <> gb.Tab Then Break
|
||||
Inc I
|
||||
sLine = LTrim(Mid$(sLine, 3))
|
||||
Loop
|
||||
|
||||
If I > iBlockQuote Then
|
||||
While I > iBlockQuote
|
||||
aResult.Add("<blockquote>")
|
||||
Inc iBlockQuote
|
||||
Wend
|
||||
Else If I < iBlockQuote Then
|
||||
While I < iBlockQuote
|
||||
aResult.Add("</blockquote>")
|
||||
Dec iBlockQuote
|
||||
Wend
|
||||
Endif
|
||||
|
||||
' Horizontal lines
|
||||
|
||||
If Left(sLine) = "*" And If Right(sLine) = "*" Then
|
||||
sText = Replace(sLine, " ", "")
|
||||
If Len(sText) >= 3 And If sText = String$(Len(sText), "*") Then
|
||||
GoSub CLOSE_PARA
|
||||
aResult.Add("<hr />")
|
||||
Continue
|
||||
Endif
|
||||
Endif
|
||||
|
||||
If Left(sLine) = "-" And If Right(sLine) = "-" Then
|
||||
sText = Replace(sLine, " ", "")
|
||||
If Len(sText) >= 3 And If sText = String$(Len(sText), "-") Then
|
||||
GoSub CLOSE_PARA
|
||||
aResult.Add("<hr />")
|
||||
Continue
|
||||
Endif
|
||||
Endif
|
||||
|
||||
' Title
|
||||
|
||||
If Left(sLine) = "#" Then
|
||||
I = InStr(sLine, " ")
|
||||
If I <= 7 Then
|
||||
Dec I
|
||||
If Left(sLine, I) = String$(I, "#") Then
|
||||
sLine = Mid$(sLine, I + 2)
|
||||
While sLine Ends "#"
|
||||
sLine = Left(sLine, -1)
|
||||
Wend
|
||||
sLine = RTrim(sLine)
|
||||
sLine = "<h" & CStr(I) & ">" & ConvertLine(sLine) & "</h" & CStr(I) & ">"
|
||||
GoSub CLOSE_PARA
|
||||
aResult.Add(sLine)
|
||||
Continue
|
||||
Endif
|
||||
Endif
|
||||
Endif
|
||||
|
||||
If Trim(sLine) Then
|
||||
If Not bInsidePar And If LTrim(sLine) Not Begins "<h" Then
|
||||
If Not bJustList Then
|
||||
bAddPar = True
|
||||
Endif
|
||||
Endif
|
||||
Else
|
||||
bJustList = False
|
||||
GoSub CLOSE_PARA
|
||||
Continue
|
||||
Endif
|
||||
|
||||
sLine = ConvertLine(sLine)
|
||||
|
||||
If bAddPar Then
|
||||
sLine = Left(sLine, Len(sLine) - Len(LTrim(sLine))) & "<p>" & LTrim(sLine)
|
||||
bInsidePar = True
|
||||
bAddPar = False
|
||||
Endif
|
||||
|
||||
aResult.Add(sLine)
|
||||
|
||||
Next
|
||||
|
||||
GoSub CLOSE_CODE
|
||||
GoSub CLOSE_BLOCKQUOTE
|
||||
iIndent = 0
|
||||
GoSub CLOSE_LIST
|
||||
'If $aMarkup.Count Then Error.Raise("Missing markup: " & $aMarkup[$aMarkup.Max])
|
||||
|
||||
Return aResult.Join("\n")
|
||||
|
||||
CLOSE_CODE:
|
||||
|
||||
If bCode Then
|
||||
aResult.Add("</code></pre>")
|
||||
bCode = False
|
||||
Endif
|
||||
Return
|
||||
|
||||
CLOSE_BLOCKQUOTE:
|
||||
|
||||
While iBlockQuote
|
||||
aResult.Add("</blockquote>")
|
||||
Dec iBlockQuote
|
||||
Wend
|
||||
Return
|
||||
|
||||
CLOSE_LIST:
|
||||
|
||||
While iIndent < iCurrentIndent
|
||||
GoSub CLOSE_PARA
|
||||
GoSub CLOSE_CODE
|
||||
aResult.Add(Space$(iCurrentIndent) & "</li>")
|
||||
bJustList = False
|
||||
aResult.Add(Space$($aList[$aList.Max].iIndent) & "</" & $aList[$aList.Max].sType & ">")
|
||||
$aList.Remove($aList.Max)
|
||||
If $aList.Count Then
|
||||
iCurrentIndent = $aList[$aList.Max].iIndent
|
||||
Else
|
||||
iCurrentIndent = 0
|
||||
Endif
|
||||
Wend
|
||||
Return
|
||||
|
||||
CLOSE_PARA:
|
||||
|
||||
If bInsidePar Then
|
||||
aResult[aResult.Max] &= "</p>"
|
||||
'aResult.Add("")
|
||||
bInsidePar = False
|
||||
Else If iLine > 0 And If aResult[aResult.Max] Then
|
||||
'aResult.Add("")
|
||||
Endif
|
||||
Return
|
||||
|
||||
'Catch
|
||||
|
||||
' Error.Raise("Line " & CStr(iLine + 1) & ": " & Error.Text)
|
||||
|
||||
End
|
||||
|
||||
|
||||
Private Sub ConvertLine(sLine As String) As String
|
||||
|
||||
Dim sResult As String
|
||||
Dim I As Integer
|
||||
Dim sCar, sNextCar As String
|
||||
Dim I1, I2 As Integer
|
||||
Dim sPattern As String
|
||||
Dim iLine As Integer
|
||||
Dim bCode, bCodeExit As Boolean
|
||||
Dim bEmph As Boolean
|
||||
Dim bStrong As Boolean
|
||||
Dim sText, sTitle, sLink As String
|
||||
|
||||
MAIN_LOOP:
|
||||
|
||||
If I >= Len(sLine) Then
|
||||
If bEmph Then
|
||||
sResult &= "</em>"
|
||||
Else If bStrong Then
|
||||
sResult &= "</strong>"
|
||||
Endif
|
||||
Return sResult
|
||||
Endif
|
||||
|
||||
GoSub NEXT_CAR
|
||||
|
||||
If sCar = "\\" Then
|
||||
GoSub NEXT_CAR
|
||||
sResult &= sCar
|
||||
Goto MAIN_LOOP
|
||||
Endif
|
||||
|
||||
If sCar = "<" Then Goto ENTER_MARKUP
|
||||
|
||||
If $aMarkup.Count = 0 Then
|
||||
|
||||
If sCar = "&" Then Goto ENTER_AMPERSAND
|
||||
|
||||
If sCar = "`" Then Goto ENTER_CODE
|
||||
|
||||
If sCar = "[" Then Goto ENTER_LINK
|
||||
|
||||
Endif
|
||||
|
||||
If sCar = "*" Then Goto ENTER_STAR
|
||||
|
||||
If sCar = ">" Then
|
||||
sCar = ">"
|
||||
Endif
|
||||
|
||||
sResult &= sCar
|
||||
|
||||
Goto MAIN_LOOP
|
||||
|
||||
NEXT_CAR:
|
||||
|
||||
Inc I
|
||||
If I > Len(sLine) Then Error.Raise("Unexpected end of line")
|
||||
sCar = Mid$(sLine, I, 1)
|
||||
Return
|
||||
|
||||
LOOK_CAR:
|
||||
|
||||
sCar = Mid$(sLine, I + 1, 1)
|
||||
Return
|
||||
|
||||
ENTER_MARKUP:
|
||||
|
||||
I1 = I
|
||||
GoSub NEXT_CAR
|
||||
|
||||
If sCar <> "/" And If Not IsLetter(sCar) Then
|
||||
sResult &= "<"
|
||||
Dec I
|
||||
Goto MAIN_LOOP
|
||||
Endif
|
||||
|
||||
Repeat
|
||||
GoSub NEXT_CAR
|
||||
Until sCar = ">"
|
||||
sPattern = Mid$(sLine, I1 + 1, I - I1 - 1)
|
||||
|
||||
'sPattern = LCase(sPattern)
|
||||
|
||||
If Left(sPattern) = "/" Then
|
||||
If $aMarkup.Count = 0 Or If LCase($aMarkup[$aMarkup.Max]) <> LCase(Mid$(sPattern, 2)) Then
|
||||
Error.Raise("Mismatched markup: " & sPattern)
|
||||
Endif
|
||||
sResult &= "<" & sPattern & ">"
|
||||
$aMarkup.Remove($aMarkup.Max)
|
||||
Else
|
||||
sResult &= "<" & sPattern & ">"
|
||||
I1 = InStr(sPattern, " ")
|
||||
If I1 Then sPattern = Left(sPattern, I1 - 1)
|
||||
$aMarkup.Add(sPattern)
|
||||
Endif
|
||||
Goto MAIN_LOOP
|
||||
|
||||
ENTER_AMPERSAND:
|
||||
|
||||
For I1 = I To I + 6
|
||||
sCar = Mid$(sLine, I1, 1)
|
||||
If sCar = ";" Then
|
||||
sResult &= Mid$(sLine, I, I1 - I + 1)
|
||||
I = I1
|
||||
Goto MAIN_LOOP
|
||||
Else If sCar = "\n" Then
|
||||
Break
|
||||
Endif
|
||||
Next
|
||||
sResult &= "&"
|
||||
Goto MAIN_LOOP
|
||||
|
||||
ENTER_CODE:
|
||||
|
||||
sResult &= "<code>"
|
||||
I1 = 1
|
||||
bCode = False
|
||||
bCodeExit = False
|
||||
Do
|
||||
GoSub NEXT_CAR
|
||||
If sCar = "`" Then
|
||||
If Not bCode Then
|
||||
Inc I1
|
||||
Continue
|
||||
Else
|
||||
If Mid$(sLine, I, I1) = String$(I1, "`") Then
|
||||
sResult &= "</code>"
|
||||
I += I1 - 1
|
||||
Break
|
||||
Endif
|
||||
Endif
|
||||
Endif
|
||||
sResult &= Html(sCar)
|
||||
bCode = True
|
||||
Loop
|
||||
Goto MAIN_LOOP
|
||||
|
||||
ENTER_STAR:
|
||||
|
||||
GoSub LOOK_CAR
|
||||
If sCar = "*" Then
|
||||
Inc I
|
||||
Goto ENTER_STRONG
|
||||
Endif
|
||||
|
||||
If bEmph Then
|
||||
sResult &= "</em>"
|
||||
bEmph = False
|
||||
Else If Not bStrong Then
|
||||
sResult &= "<em>"
|
||||
bEmph = True
|
||||
Else
|
||||
sResult &= "*"
|
||||
Endif
|
||||
Goto MAIN_LOOP
|
||||
|
||||
ENTER_STRONG:
|
||||
|
||||
If bStrong Then
|
||||
sResult &= "</strong>"
|
||||
bStrong = False
|
||||
Else If Not bEmph Then
|
||||
sResult &= "<strong>"
|
||||
bStrong = True
|
||||
Else
|
||||
sResult &= "**"
|
||||
Endif
|
||||
Goto MAIN_LOOP
|
||||
|
||||
ENTER_LINK:
|
||||
|
||||
I1 = InStr(sLine, "]", I + 1)
|
||||
If I1 = 0 Then
|
||||
I = Len(sLine)
|
||||
Goto MAIN_LOOP
|
||||
Endif
|
||||
|
||||
sText = Mid$(sLine, I + 1, I1 - I - 1)
|
||||
I = I1
|
||||
I2 = I
|
||||
Do
|
||||
GoSub LOOK_CAR
|
||||
If Not sCar Then Break
|
||||
Inc I
|
||||
If Asc(sCar) > 32 Then Break
|
||||
Loop
|
||||
If sCar = "(" Then
|
||||
I1 = InStr(sLine, ")", I + 1)
|
||||
If I1 > 0 Then
|
||||
sLink = Mid$(sLine, I + 1, I1 - I - 1)
|
||||
I = I1
|
||||
Endif
|
||||
Else If sCar = "[" Then
|
||||
I1 = InStr(sLine, "]", I + 1)
|
||||
If I1 > 0 Then
|
||||
sLink = $cLink[Mid$(sLine, I + 1, I1 - I - 1)]
|
||||
I = I1
|
||||
Endif
|
||||
Else
|
||||
I = I2
|
||||
Endif
|
||||
|
||||
If sLink Then
|
||||
I1 = InStr(sLink, Chr$(34))
|
||||
If I1 And If Right(sLink) = Chr$(34) Then
|
||||
sTitle = Mid$(sLink, I1 + 1, -1)
|
||||
sLink = Trim(Left$(sLink, I1 - 1))
|
||||
Else
|
||||
sTitle = ""
|
||||
sLink = Trim$(sLink)
|
||||
Endif
|
||||
sResult &= "<a href=\"" & Html$(sLink) & "\""
|
||||
If sTitle Then sResult &= " title=\"" & Html$(sTitle) & "\""
|
||||
sResult &= ">" & sText & "</a>"
|
||||
Endif
|
||||
|
||||
Goto MAIN_LOOP
|
||||
|
||||
End
|
|
@ -459,6 +459,8 @@ Public Sub gvwComponent_Data(Row As Integer, Column As Integer)
|
|||
.Picture = Picture["img/16/unfinished.png"]
|
||||
Case CComponent.UNSTABLE
|
||||
.Picture = Picture["img/16/experimental.png"]
|
||||
Case CComponent.STABLE
|
||||
.Picture = Picture["img/16/finished.png"]
|
||||
End Select
|
||||
|
||||
End Select
|
||||
|
@ -586,6 +588,8 @@ Public Sub gvwComponent_Click()
|
|||
Dim hCompItem As ComponentItem
|
||||
Dim sDep As String
|
||||
|
||||
If panAboutComponent.Visible Then AboutComponent
|
||||
|
||||
If gvwComponent.Column <> 0 Then Return
|
||||
|
||||
hCompItem = $cComp[$aComp[gvwComponent.Row]]
|
||||
|
@ -760,7 +764,8 @@ Private Sub AboutComponent()
|
|||
Dim hCompItem As ComponentItem
|
||||
Dim sKey As String
|
||||
|
||||
hCompItem = $cComp[$aComp[gvwComponent.Row]]
|
||||
Try hCompItem = $cComp[$aComp[gvwComponent.Row]]
|
||||
If Not hCompItem Then Return
|
||||
Try sKey = hCompItem.Key
|
||||
If Not sKey Then Return
|
||||
'MHelp.GotoComponent(sKey)
|
||||
|
@ -780,7 +785,7 @@ Public Sub btnHelp_Click()
|
|||
|
||||
AboutComponent
|
||||
panAboutComponent.Show
|
||||
gvwComponent.Current.EnsureVisible
|
||||
Try gvwComponent.Current.EnsureVisible
|
||||
btnHelp.Picture = Picture["icon:/small/down"]
|
||||
|
||||
Endif
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 642 B |
BIN
app/src/gambas3/img/16/finished.png
Normal file
BIN
app/src/gambas3/img/16/finished.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 337 B |
Binary file not shown.
Before Width: | Height: | Size: 406 B After Width: | Height: | Size: 530 B |
Loading…
Reference in a new issue