• Markdown to HTML in Forth

    From Brad Eckert@21:1/5 to All on Thu Aug 31 07:42:38 2023
    Hi All,

    I'm pretty sure HTML has been generated by Forth documentation tools before (like MPE's DocGen), but is there any public code for processing Markdown?

    I want a tool that translates a wiki-like syntax to HTML page(s). I will probably end up writing one, but I would like to see what's out there to get some ideas.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jurgen Pitaske@21:1/5 to Marcel Hendrix on Thu Aug 31 12:00:14 2023
    On Thursday, 31 August 2023 at 19:24:40 UTC+1, Marcel Hendrix wrote:
    On Thursday, August 31, 2023 at 4:42:41 PM UTC+2, Brad Eckert wrote:
    Hi All,

    I'm pretty sure HTML has been generated by Forth documentation tools before (like MPE's DocGen), but is there any public code for processing Markdown?

    I want a tool that translates a wiki-like syntax to HTML page(s). I will probably end up writing one, but I would like to see what's out there to get some ideas.
    FFL, e.g., XIS and XOS ?

    -marcel

    I am amazed, that FORTH keeps out of the world how it works.
    But it is better that there are about 100 personal Forths
    which do not keep interested what the world needs ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marcel Hendrix@21:1/5 to Brad Eckert on Thu Aug 31 11:24:38 2023
    On Thursday, August 31, 2023 at 4:42:41 PM UTC+2, Brad Eckert wrote:
    Hi All,

    I'm pretty sure HTML has been generated by Forth documentation tools before (like MPE's DocGen), but is there any public code for processing Markdown?

    I want a tool that translates a wiki-like syntax to HTML page(s). I will probably end up writing one, but I would like to see what's out there to get some ideas.

    FFL, e.g., XIS and XOS ?

    -marcel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hans Bezemer@21:1/5 to Brad Eckert on Thu Aug 31 14:41:09 2023
    On Thursday, August 31, 2023 at 4:42:41 PM UTC+2, Brad Eckert wrote:
    Hi All,

    I'm pretty sure HTML has been generated by Forth documentation tools before (like MPE's DocGen), but is there any public code for processing Markdown?

    I want a tool that translates a wiki-like syntax to HTML page(s). I will probably end up writing one, but I would like to see what's out there to get some ideas.

    I made a tool that converts tables to XLS, FODS, HTML, JSON, KSP, Wiki and a couple of more - and I made a few libs that write RTF, LaTeX and HTML within Forth, but never markup to HTML. Basic stuff couldn'tbe that hard with those libs, though.

    Analyse the start of a line, set a variable and dispatch. BTW, the HTML lib supports style sheets as well.

    Hans Bezemer

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ron AARON@21:1/5 to Hans Bezemer on Fri Sep 1 07:34:06 2023
    On 01/09/2023 0:41, Hans Bezemer wrote:
    On Thursday, August 31, 2023 at 4:42:41 PM UTC+2, Brad Eckert wrote:
    Hi All,

    I'm pretty sure HTML has been generated by Forth documentation tools before (like MPE's DocGen), but is there any public code for processing Markdown?

    I want a tool that translates a wiki-like syntax to HTML page(s). I will probably end up writing one, but I would like to see what's out there to get some ideas.

    I made a tool that converts tables to XLS, FODS, HTML, JSON, KSP, Wiki and a couple of more - and I made a few libs that write RTF, LaTeX and HTML within Forth, but never markup to HTML. Basic stuff couldn'tbe that hard with those libs, though.

    Analyse the start of a line, set a variable and dispatch. BTW, the HTML lib supports style sheets as well.

    Hans Bezemer

    I was going to reply that 8th has a built-in Markdown parser and that I
    use it to produce the HTML (and PDF) documentation, but the OP wants
    public code.

    OP: take a look at the "md4c" library, which is what 8th uses internally
    for Markdown processing.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From S Jack@21:1/5 to Brad Eckert on Fri Sep 1 12:23:12 2023
    On Thursday, August 31, 2023 at 9:42:41 AM UTC-5, Brad Eckert wrote:
    Hi All,

    I'm pretty sure HTML has been generated by Forth documentation tools before (like MPE's DocGen), but is there any public code for processing Markdown?

    I want a tool that translates a wiki-like syntax to HTML page(s). I will probably end up writing one, but I would like to see what's out there to get some ideas.

    The only tool needed for HTML and Markdown: plain text editor
    --
    me

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to hwfwguy@gmail.com on Sat Sep 2 10:59:26 2023
    In article <c1a48a52-abda-4c61-a10e-8579d2e4504en@googlegroups.com>,
    Brad Eckert <hwfwguy@gmail.com> wrote:
    Hi All,

    I'm pretty sure HTML has been generated by Forth documentation tools
    before (like MPE's DocGen), but is there any public code for processing >Markdown?

    I want a tool that translates a wiki-like syntax to HTML page(s). I will >probably end up writing one, but I would like to see what's out there to
    get some ideas.

    I have written a kind of regular expression transformation.
    Each time a problem of this kind comes up, I use this.
    --
    Don't praise the day before the evening. One swallow doesn't make spring.
    You must not say "hey" before you have crossed the bridge. Don't sell the
    hide of the bear until you shot it. Better one bird in the hand than ten in
    the air. First gain is a cat spinning. - the Wise from Antrim -

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kerr-Mudd, John@21:1/5 to S Jack on Sat Sep 2 10:19:19 2023
    On Fri, 1 Sep 2023 12:23:12 -0700 (PDT)
    S Jack <sdwjack69@gmail.com> wrote:

    On Thursday, August 31, 2023 at 9:42:41 AM UTC-5, Brad Eckert wrote:
    Hi All,

    I'm pretty sure HTML has been generated by Forth documentation tools before (like MPE's DocGen), but is there any public code for processing Markdown?

    I want a tool that translates a wiki-like syntax to HTML page(s). I will probably end up writing one, but I would like to see what's out there to get some ideas.

    The only tool needed for HTML and Markdown: plain text editor

    Tried looking at a modern webpage? It's a long way from just simple
    Markup tags now.

    --
    Bah, and indeed Humbug.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@21:1/5 to John on Sat Sep 2 03:35:34 2023
    Kerr-Mudd, John schrieb am Samstag, 2. September 2023 um 11:19:21 UTC+2:
    On Fri, 1 Sep 2023 12:23:12 -0700 (PDT)
    S Jack <sdwj...@gmail.com> wrote:

    On Thursday, August 31, 2023 at 9:42:41 AM UTC-5, Brad Eckert wrote:
    Hi All,

    I'm pretty sure HTML has been generated by Forth documentation tools before (like MPE's DocGen), but is there any public code for processing Markdown?

    I want a tool that translates a wiki-like syntax to HTML page(s). I will probably end up writing one, but I would like to see what's out there to get some ideas.

    The only tool needed for HTML and Markdown: plain text editor
    Tried looking at a modern webpage? It's a long way from just simple
    Markup tags now.

    Add to this that wiki markup has a lot more to offer than HTML.
    See for yourself: https://learn.microsoft.com/en-us/azure/devops/project/wiki/wiki-markdown-guidance?view=azure-devops

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Pelc@21:1/5 to Brad Eckert on Sat Sep 2 15:24:54 2023
    On 31 Aug 2023 at 16:42:38 CEST, "Brad Eckert" <hwfwguy@gmail.com> wrote:

    I'm pretty sure HTML has been generated by Forth documentation tools before (like MPE's DocGen), but is there any public code for processing Markdown?

    MPE's DocGen now supports Markdown.

    Stephen

    --
    Stephen Pelc, stephen@vfxforth.com
    MicroProcessor Engineering, Ltd. - More Real, Less Time
    133 Hill Lane, Southampton SO15 5AF, England
    tel: +44 (0)78 0390 3612, +34 649 662 974
    http://www.mpeforth.com - free VFX Forth downloads

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Brad Eckert@21:1/5 to minforth on Sat Sep 2 10:02:35 2023
    On Saturday, September 2, 2023 at 3:35:36 AM UTC-7, minforth wrote:
    Kerr-Mudd, John schrieb am Samstag, 2. September 2023 um 11:19:21 UTC+2:
    On Fri, 1 Sep 2023 12:23:12 -0700 (PDT)
    S Jack <sdwj...@gmail.com> wrote:

    On Thursday, August 31, 2023 at 9:42:41 AM UTC-5, Brad Eckert wrote:
    Hi All,

    I'm pretty sure HTML has been generated by Forth documentation tools before (like MPE's DocGen), but is there any public code for processing Markdown?

    I want a tool that translates a wiki-like syntax to HTML page(s). I will probably end up writing one, but I would like to see what's out there to get some ideas.

    The only tool needed for HTML and Markdown: plain text editor
    Tried looking at a modern webpage? It's a long way from just simple
    Markup tags now.
    Add to this that wiki markup has a lot more to offer than HTML.
    See for yourself: https://learn.microsoft.com/en-us/azure/devops/project/wiki/wiki-markdown-guidance?view=azure-devops

    It just keeps getting better. Mermaid syntax. Since they will keep adding stuff, I suppose trying to keep up would be a fool's errand. This fool has other things to do.

    It seems that my requirement is more along the lines of parsing anchor tags out of either Markdown or HTML to populate a data structure and then generating an HTML representation of that complete with links.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bob Armstrong@21:1/5 to Brad Eckert on Sat Sep 2 12:24:40 2023
    https://cosy.com/ , evolving from APL & K , has strong vocabulary for any such transliterations . For instance , I flesh out naked URLs in my https://cosy.com/DailyBlog.html with this word :

    : Blog>HTML ( text -- html )
    lfVM s" <br>" $ ' cL 'R lfMV ` http tokcut >a>
    1 _cut { .+ wsf? 0cut } 'm flip >a> dsc >a
    s/" <a target=\"_blank\" href=\"" a@ ' cL 'R ` "> ' cL 'L a> ' cL 'd ` </a> ' cL 'L
    a> 1th ,L flip ,/ a> dsc $ cL lfMV ;

    One particularly useful word for such things is :

    : braket ( str strs -- str ) 2p> 0 _at swap cL R@ 1 _at cL 2P> ;
    | Prefixes and suffixes str with 2 item strs . Examples :
    | s" 2 item" s" <i>" s" </i>" ,L braket
    | s" <i>2 item</i>"
    | s" /4thCoSy/CoSy/Furniture.f " s" | " enc braket
    | s" | /4thCoSy/CoSy/Furniture.f | "
    | i( 5 6 5 )i 4 _i braket
    | 4 5 6 5 4
    )

    A similar sort of task is converting account downloads to CoSy lists .
    : csv>lst ( csv d0,d1 -- lst ) 2p> dsc VM dae R@ 1 _at ['] VM 'L 2P> ;
    | Splits string first on d0 then each on d1 .

    | --

    On Thursday, August 31, 2023 at 8:42:41 AM UTC-6, Brad Eckert wrote:
    Hi All,

    I'm pretty sure HTML has been generated by Forth documentation tools before (like MPE's DocGen), but is there any public code for processing Markdown?

    I want a tool that translates a wiki-like syntax to HTML page(s). I will probably end up writing one, but I would like to see what's out there to get some ideas.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From S Jack@21:1/5 to Brad Eckert on Sat Sep 2 16:00:27 2023
    On Saturday, September 2, 2023 at 12:02:37 PM UTC-5, Brad Eckert wrote:
    On Saturday, September 2, 2023 at 3:35:36 AM UTC-7, minforth wrote:
    Kerr-Mudd, John schrieb am Samstag, 2. September 2023 um 11:19:21 UTC+2:
    On Fri, 1 Sep 2023 12:23:12 -0700 (PDT)
    S Jack <sdwj...@gmail.com> wrote:

    On Thursday, August 31, 2023 at 9:42:41 AM UTC-5, Brad Eckert wrote:
    It just keeps getting better. Mermaid syntax. Since they will keep adding stuff, I suppose trying to keep up would be a fool's errand. This fool has other things to do.

    What was nice in the old days, Firefox provided a default user style
    sheet. Set it up the way you want things. Strip out the bs in the
    marked up document copy content into a template using the default
    css and have something useful. Don't expect to do that these days.

    If the web page is composed mainly of markup, then usually stripping
    out tags is no big deal using a Bash script and the *nix text
    utilities. But some authors will screw up their html so bad that it's
    not worth it. Also browsers may have options to strip the tags for
    you, but the ones I've tried don't work all that well; much hand
    tweaking still needed. But worst, these days many web pages are made
    up of very little markup and use JavaScript to generate most of the
    content. Don't be surprised to see a page with no content and showing
    only a single tag <KOO />. Strip it and have nothing.
    --
    me

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)