Page 1 of 6

[Module] MarkDown Gadget (all OS)

Posted: Tue Dec 31, 2019 5:42 pm
by Thorsten1867
MarkDown Gadget & Requester - Module (all OS / 64Bit / DPI)

Display or convert text in MarkDown syntax
  • Markdown - Gadget to display text in markdown syntax
  • Export the gadget content to HTML or PDF
  • Convert text in MarkDown to HTML or PDF
  • Message-Requester with support of the Markdown-Syntax
  • Help Windowto display help files based on Markdown syntax
Image _____ Image

The module supports:
  • Basic Syntax (Headings / Emphasis / Lists / Links / Images /...)
  • Tables
  • Task Lists/ Definition Lists
  • Emphasis/ Strikethroughs / Underlining
  • Keystrokes
  • Abbreviations (with explanation)
  • Footnotes
  • Superscript & Subscript
  • Emojis
  • Notes
  • Table of Contents/ Glossar
  • Keywords (for help window)

Code: Select all

; MarkDown::UsedImages()         - determines all images used in the markdown text
; MarkDown::InsertAsPDF()        - Insert converted markdown text into PDF
; MarkDown::InsertAsHTML()       - Insert converted markdown text into HTML
; MarkDown::SetPath()            - set path for images without path name

; ----- Gadget (#Enable_Gadget)-----

; MarkDown::AttachPopupMenu()
; MarkDown::Clear()              - similar to 'ClearGadgetItems()'
; MarkDown::Convert()            - convert markdown to HTML or PDF (without gadget)
; MarkDown::EventValue()         - returns links
; MarkDown::Export()             - export to HTML or PDF 
; MarkDown::Gadget()             - new MarkDown gadget
; MarkDown::GetData()            - similar to 'GetGadgetData()'
; MarkDown::GetText()            - similar to 'GetGadgetText()' [#MarkDown/#HTML]
; MarkDown::GetID()              - similar to 'GetGadgetData()', but string
; MarkDown::GotoHeading()        - goto heading with this ID
; MarkDown::Hide()               - similar to 'HideGadget()'
; MarkDown::SetAutoResizeFlags() - [#MoveX|#MoveY|#Width|#Height]
; MarkDown::SetAttribute()       - similar to 'SetGadgetAttribute()'
; MarkDown::SetColor()           - similar to 'SetGadgetColor()'
; MarkDown::SetData()            - similar to 'SetGadgetData()'
; MarkDown::SetFont()            - similar to 'SetGadgetFont()'
; MarkDown::SetID()              - similar to 'SetGadgetData()', but string
; MarkDown::SetMargins()         - defines the margins
; MarkDown::SetPath()            - Set the path to the Markdown file, for relative path names
; MarkDown::SetText()            - similar to 'SetGadgetText()'
; MarkDown::UseImage()           - uses an already loaded image

; ----- Requester (#Enable_Requester) -----

; MarkDown::Requester()

; ----- Help Window (#Enable_HelpWindow) -----

; MarkDown::Help()
; MarkDown::ChangeHelpTopic()
; MarkDown::EventLabel()
Download: MarkDownModule.pbi

Re: [Module] MarkDown Gadget (all OS)

Posted: Wed Jan 01, 2020 11:19 am
by Kwai chang caine
Works nice here :D
2004 and never heard talking about this language :shock:
Yesterday "*..ofx" a format for bank account, today "*.md" this light format....
Nearly all the day i can learn a "new" format od numerous years old :oops:
Thanks for sharing and to have taught me the existence of this old extension 8)

Re: [Module] MarkDown Gadget (all OS)

Posted: Wed Jan 01, 2020 11:34 am
by Thorsten1867
In reasonable note apps (such as Joplin) MarkDown is standard.
But only now I realized what MarkDown can do (extended syntax).

Gesendet von meinem Aquaris X2 mit Tapatalk

Re: [Module] MarkDown Gadget (all OS)

Posted: Wed Jan 01, 2020 2:24 pm
by Thorsten1867
Update:
  • Added: SuperScript & SubScript
  • Added: Emojis

Re: [Module] MarkDown Gadget (all OS)

Posted: Wed Jan 01, 2020 3:34 pm
by blueb
Happy New Years Thorsten :D

Found a small error.. Program does not return properly after pressing the 'HTML' (Button) button...

Code: Select all

            Case #Button4
             CompilerIf Defined(PDF, #PB_Module) ; added
               MarkDown::Export(#MarkDown, MarkDown::#HTML, "Export.htm", "PDF")
               RunProgram("Export.htm")
             CompilerEndIf ; added
          EndSelect
Best wishes for the new decade.

Re: [Module] MarkDown Gadget (all OS)

Posted: Wed Jan 01, 2020 5:57 pm
by Thorsten1867
That doesn't really make sense. HTML does not need the PDF module.

Re: [Module] MarkDown Gadget (all OS)

Posted: Thu Jan 02, 2020 2:47 pm
by blueb
Thorsten1867 wrote:That doesn't really make sense. HTML does not need the PDF module.
Ahhh...
I see what's going on now...

The example program does not re-gain focus after pressing one of the buttons, the program runs and hides behind the PureBasic IDE (which is still running)

If I only minimize the PDF or the WEB page (Chrome in my case), I cannot view the running EXE.

But...If I kill Chrome or the PDF program, everything displays correctly.


The confusing part... there is no icon on my taskbar that shows the running program, so I assumed the program did not exit properly.

Re: [Module] MarkDown Gadget (all OS)

Posted: Thu Jan 02, 2020 3:31 pm
by HeX0R
You need to get rid of the #PB_Window_Tool flag, then you will see it again in the task bar.

Re: [Module] MarkDown Gadget (all OS)

Posted: Thu Jan 02, 2020 10:14 pm
by Thorsten1867
Update:
  • Added: Definition List
  • Added: Code Blocks / Fenced Code Blocks

Re: [Module] MarkDown Gadget (all OS)

Posted: Tue Jan 07, 2020 6:34 pm
by Thorsten1867
After I found a specification for MarkDown, I completely rewrote the parser to achieve the greatest possible compatibility.
  • Added: Reference link
  • Added: Highlight
  • Added: new emojis ( :bookMark: / :date: / :mail: / :memo: / :pencil: / :phone: )

Re: [Module] MarkDown Gadget (all OS)

Posted: Mon Jan 20, 2020 2:27 pm
by Thorsten1867
To realize all features, I had to change the internal structure of the parser completely.
  • Inline emphasis for lists, tables, footnotes, ...
  • Abbreviations "*[HTML]: Hypertext Markup Language"
  • Keystrokes "[[Ctrl]] [[C]]"

Re: [Module] MarkDown Gadget (all OS)

Posted: Mon Jan 20, 2020 6:03 pm
by Thorsten1867
Update:
  • Emphasis (bold/italic) for links, autolinks, strikethrough and highlight
  • PDF task list with images for checkboxes

Re: [Module] MarkDown Gadget (all OS)

Posted: Thu Jan 23, 2020 2:58 pm
by Thorsten1867
Markdown - Editor

As a supplement to the module and as an application example a Markdown - Editor.
(Most formatting is available as a pop-up menu.)

Image

Re: [Module] MarkDown Gadget (all OS)

Posted: Thu Jan 30, 2020 9:47 am
by Thorsten1867
Update: Bugfixes & Improvements for tables

Re: [Module] MarkDown Gadget (all OS)

Posted: Thu Jan 30, 2020 11:04 am
by Fred
This is a very nice module !