MarkDown / WYSIWYG Hybrid Editor Solutions ?

This is a screenshot of application called Mark Text which I’ve been trying out for authoring the text of blog entries.

The text is exported as HTML to the clipboard. I’ve supplemented the app with some external Applescript apps on my Desktop for injecting extra HTML into some the blog entries by grabbing the HTML from the clipboard, parsing it and returning it to the clipboard.

I had thought about trying to emulate this app using Xojo as I could easily duplicate the Applescripts as Xojo code instead, but I am not sure it would be worth it.

The main WYSIWYG editor allows you enter MarkDown which it instantly transformed into rendered HTML. For example; entering a hyphen and space instantly creates a rendered list, which is faster to then type than having to enter type raw MarkDown to complete the list as you are just entering mostly content. You can toggle to the Source code Mode if you want to see and edit the raw MarkDown. Files are saved as MarkDown with a .md extension.

I’ve haven’t seen anything like this offered for Xojo. What have seen are editors which make you type in MarkDown and provide a preview of the rendered HTML and raw HTML. The above hybrid editor is much faster.

The left menu of MarkDown also allows you to load a main folder in the left sidebar and display its subfolders and any md files inside. If you physically delete on the the files and folders in the Finder the sidebar updates within a second. I am concerned how taxing this would for Xojo to do as wouldn’t that mean running code inside a timer to loop through the main folder? If you had a lot of files and folders in the main folder that might slow down your app.

Mark Text does not yet list subfolders by name (its to be fixed in 0.17.0 whereas the current version is 0.15.0). This was one of the unwanted behaviors of the app I had hoped to fit by completing a Xojo version of the app. It lists subfolders in the exact same order as Xojo does when using the index values of subfolders inside a loop. It appears Mark Text is being authored using Electron.

Well, if you need a Xojo compatible Markdown parser there are few to choose from.

MarkdownKit
Markdown Parser for Xojo
Markdown Class for Xojo
And of course MarkdownDocumentMBS

My apologies if there are others that I missed. These are the ones that sprang to mind.

Good luck if you go ahead with your project. Looks like a good idea.

I had previously tried the first three demos.

I recall the first two having a editing field to enter markdown which was then rendered live in a preview window.

The third had a editing field in which you entered markdown and then needed to press a button to render the markdown. All the links in that post appear dead and the product is was no longer listed on the developer’s home page. I was only able to find the demo by editing this url from the post

link text

to this to see the parent directory on the server:

link text

None of these three appear to be WYSIWYG editors that allows you to also enter Markdown.

In these editors you would need to enter a hyphen and space for each item within a one level list. In Mark Down you just enter the initial hyphen and space to start a list which is then written using WYSIWYG. That is faster as you only typing content after the initial opening hyphen and space.

Instead of typing > and space for each line of a blockquote you just do that once to start constructing an actual blockquote in then type the blockquote’s content in WYSIWYG mode.

I did not see any type of demo for the MBS Markdown product.

Here I types a single >

As soon as I add a space it turns into a rendered blockquote that I directly edit. No need to type any more > and spaces any longer, just the content.

Hi @Charles Greyson

I’m using my class, Markdown Parser for Xojo, in a daily basis to write both AprendeXojo’s blog posts and documentation, and also the blog posts published under the Xojo Blog.

As you mention, Markdown Parser for Xojo, allows you to write using Markdown syntax rendering the WYSIWYG output and generating the HTML, but not otherwise: it doesn’t generates the Markdown syntax from RTF or HTML styled text, for example.

Of course, I’m always open to feature requests to my products… so if you find something that can be improved or implemented to better suit your needs, please let me know!

Javier

[quote=467553:Javier Menndez]Hi @Charles Greyson

I'm using my class, Markdown Parser for Xojo, in a daily basis to write both AprendeXojo's blog posts and documentation, and also the blog posts published under the Xojo Blog.

As you mention, Markdown Parser for Xojo, allows you to write using Markdown syntax rendering the WYSIWYG output and generating the HTML, but not otherwise: it doesn't generates the Markdown syntax from RTF or HTML styled text, for example.

Of course, I'm always open to feature requests to my products… so if you find something that can be improved or implemented to better suit your needs, please let me know!

Javier[/quote]

That was one the demos I tried which uses the traditional MarkDown parsing.

I am looking to edit & move a lot content to a blog in order to monetize it via advertising. Before I do that I need to determine the fastest way to accomplish this by studying the ergonomics of the matter (i.e., doing “X” saves “X” amount of time per post).

Mark Text is project by volunteers using what appears to be Electron.

link text

Its a WYSIWYG editor that allows you to type Markdown directly into the WYSIWYG editor. The Markdown is instantly rendered as styled text. If want to view or edit the underlying Markdown you can toggle to the Source Code Mode (Option + Command + S).

The current Xojo options I’ve tried would require you to construct a one level list by typing:

  • Item One
  • Item Two
  • Item Three
  • Item Four
  • Item Five

In Mark Text you just enter the first hyphen and as soon as you add a space it rendered as an actual list and you simply type your content thereafter. In this small example that saves having to enter a hyphen and space for lines 2 through 5 - a saving of 8 keystrokes.

Similarly the current Xojo options would require a blockquote be constructed using a > + a space on each line.

Text
Text
Text
Text
Text

In Mark Text you just type a > and once you enter a space its rendered as a blockquote into which you can enter your content rather than wasting strokes on additional Markdown.

There are also additional WYSIWYG menus:

Files are stored as Markdown with a .md extension.

[quote]The current Xojo options I’ve tried would require you to construct a one level list by typing:

• Item One
• Item Two
• Item Three
• Item Four
• Item Five[/quote]

Not in Markdown Parser for Xojo. You can write a one level list by typing (hyphen, space, whatever):

[code]- one

  • two
  • three[/code]

or:

[code]+ one

  • two
  • three[/code]

In Markdown Parser for Xojo you write a quote typing the > character.

About files writing; remember that the mentioned Xojo options (including Markdown Parser for Xojo) are classes! That means that is up to you to write the resulting files as you want: “.md” files from the source text… or HTML files from the “rendered” output in the case of Markdown Parser for Xojo.

Even Markdown Parser for Xojo includes the source code, so it’s up to you if you want to customise or expand its behaviour the way you want!

I mean, you can’t compare a complete app (Mark Text or many, many others dealing with Markdown syntax) against just Markdown classes. In fact, you can build your own “Mark Text” app using any of these classes… in fact, the little demo app provided with Markdown Parser for Xojo is a barebones or starting point to create a more complete or specialised app you can use to suit your needs :slight_smile:

For example, these are two screenshots of the app I developed and use every day (100% Xojo code)… working with Markdown Parser for Xojo. Of course, my app can write the files as “.md”, “.html” (among others):


[quote]Not in Markdown Parser for Xojo. You can write a one level list by typing (hyphen, space, whatever):

[code]- one

  • two
  • three[/code]

or:

[code]+ one

  • two
  • three[/code]

In Markdown Parser for Xojo you write a quote typing the > character.
[/quote]

Sorry there is typo in my previous reply. The following was rendered by this forum as a actual bulleted list as opposed to MarkDown.

[code]

  • Item One
  • Item Two
  • Item Three
  • Item Four
  • Item Five[/code]

In a WYSIWYG MarkDown editor such as Mark Text all you need to do is type the first hyphen and space to create a list and then you enter your content in the list that is created. With any of the current Xojo MarkDown classes or plugins you need to type a hyphen and space for each item in the list, which is exponentially slower.

In the current Markdown Xojo classes you need to type a > and space for each line in your blockquote

> Some text
> More text
> Even more text
> A little more text

In a WYSIWYG MarkDown editor all you need to do is type the first > and space and a blockquote is created into which you type your content, which is much faster.

Never said it was not this way. You are also free to save your files from Mark Text and many other MarkDown editors with whatever extension you want.

None of the current Xojo MarkDown classes or plugins offer WYSIWYG MarkDown.

All offer standard MarkDown editing which is way slower.

A current Markdown document I am working on has a 53 line blockquote from a vintage document. To create this using the current Xojo MarkDown solutions would require you enter a > and space 53 times. With WYSIWYG MarkDown you just type a > and a space once. That already saved you 104 keystrokes.

There is no point in buying any of these Xojo classes or plugins because they do not offer WYSIWYG MarkDown.

Mark Text is not a completed application. It current version is 0.15.0 and its being developed by volunteers. Alphabetical sorting of the files in the sidebar is not even going to appear until 0.17.0 according to their notes.

I have tried at least 20 other MarkDown editors, including commercial products, and there was always something wrong with them such as injecting custom css or tags into the exported HTML.

Yes, but if you would have worked using WYSIWYG MarkDown you would have saved untold hours of work. When I first found MarkDown I assumed the traditional MarkDown editor was the way to go until I searched for alternatives and decided on a WYSIWYG MarkDown as none of the alternatives such as Asciidoctor seem suitable.

The solution then is for someone to create a WYSIWYG MarkDown class or plugin for Xojo.

Unfortunately with the introduction of API 2 the author of such a class or plugin will unlikely make a version for API 1. By the same token I am not going to pay for Xojo again just to use such a class or plugin. Unless someone is going to do that I guess its time to move onto an actual solution as everyday my content sits idle is another day of missed monetization.

Or you could use a text editor (ala Textmate) which does vertical insertion. That would require 1 mouse drag and 2 keystrokes.

EDIT> Superfluous comment removed.

Apple’s TextEdit…

I don’t see the advantage of taking a hand off the keyboard, positioning it on the mouse, making a drag with the mouse and placing your hand back on the mouse in addition to completing two keystrokes verses just two keystrokes. Granted your mouse drag and two keystrokes would be faster than having to enter all the MarkDown by hand.

A way to speed this up even further is to create a series of md templates using the WYSIWYG MarkDown editor with premade items such as lists and bold paragraph list titles. The initial dummy information consisting of single letter is easily removed with the delete key and is faster than building this structure each time.

This is a “TLTLR” template consisting of YAML Matter, two bold paragraphs acting as short introductory list titles, two lists, a bold introductory “Reference” title and its companion list.

Then there is question of outputting the content as HTML as fast as possible, but not including any YAML matter in the HTML.

You could scroll to the first line below the YAML and hit Command + ? to select only the content below the YAML but that is slow. Its easier to hit Command + A from anywhere in the document (aside form the YAML) to select everything. Then use a custom keyboardshort for the menu command “Copy as HTML” to convert the content into HTML and place it on the keyboard.

That leaves the unwanted YAML Matter still in the HTML. I have several Applescripts placed on the Desktop just outside the edge of Mark Text’s window that I can quickly doubleclick to automate additional processes. One grabs the HTML from the clipboard, removes any YAML Matter; injects class names into certain UL tags based upon the content of the preceding bolded paragraph title; injects some custom spans into LI tags and then returns the updated HTML to the clipboard The class names and spans are used for CSS styling.

Exporting from the editor as HTML to a online publishing form has been reduced to these steps. Mark Text is on the left screen and a browser which will be used to publish an article is on the right screen.

  1. Command + A.
  2. Command + Option + H.
  3. Move mouse to right towards browser and pause to doubleclick a applescript.
  4. Continue moving mouse to browser and paste body of post.
  5. Move mouse back to Mark Text & place cursor in YMAL.
  6. Command + A.
  7. Command + C.
  8. Mouse mouse back to browser and paste title.

If a WYSIWYG Editor was available for Xojo then that process could be speeded up even faster as steps 1 to 3 could be combined into a single keyboard shortcut for instance.