TWiki With Markdown
"
Markdown
is becoming a pretty much defacto standard for developer markup, and it would be great if TWiki supported this"
I think it is feasible to create a plugin that intercepts the edit and save to translate
TML => Markdown =>
TML. However, the
TML has a much larger feature set, so the question is what to do with that. Once a topic is edited in Markdown, is it locked to Markdown?
--
Contributors:
Peter Thoeny - 2020-10-03
Discussion
I'd like to better understand the use case for Markdown: Is this for creating TWiki topics, for editing existing topics, or for displaying existing Markdown texts in TWiki topics? Or is it for adding to a "Discussion" section like this one? Each of them could be called "supporting" Markdown, but the technical implications are vastly different.
For writing texts, as long as people are using the
WYSIWYG-editor, the format is pretty irrelevant. So it would only make a difference if you edit the "raw" text. There, I understand that for creating content, many people are familiar with Markdown, and would find it easier to start contributing to a wiki. TWiki admins would then need to make sure that their topic templates don't contain "TML-specific" features.
For adding to a discussion (or more general, to a textarea field), Markdown makes sense in my opinion. Authors of topics often want to collect feedback from others who don't want to learn TWiki markup first. Also, comments only have
one author and the text doesn't need to be maintained by others. Finally, for textareas there's no
WYSIWYG support, so people
need to enter raw markup, but textareas in TWiki don't support the full TWiki markup. This tends to surprise even experienced contributors. Also, "formal" stuff like the author's signature in a comment, still happens with TWiki's mechanisms and "just works".
Editing existing (i.e. stored as
TML) topics in Markdown is only possible if that
TML can safely be translated to Markdown. I consider this too fragile unless "the team" agrees to avoid
TML specifics. But then: Why would they have chosen TWiki in the first place?
Displaying existing Markdown in a TWiki also could make sense. The feature is also needed to display Markdown which has been entered in a form field. Existing Markdown to
HTML converters would need to be investigated how well they fit into TWiki's templates (they should not write
HTML headers, for a start). This could also be achieved by a plugin, by just rendering Markdown blocks, or even Markdown attachments, to get them completely out of the way of TWiki's processing.
Maybe the original author can clarify the problems he has with TWiki's existing features?
--
Harald Jörg - 2020-10-03
How about implementing a minimal set of features and play around? One issue here is preference variable setting, which is so fundamental to TWiki. I wonder what's a good way to enhance TWiki::Prefs::Parser::parseText().
--
Hideyo Imazu - 2020-10-05
I just remember that we already have a plugin acting as a framework for this: The
EditSyntaxPlugin allows you to define a set of rules to convert from
TML to another Wiki markup, then back to
TML. At this time just for Mediawiki. I think it is feasible to create a set of rules for Markdown; not sure however to what degree.
--
Peter Thoeny - 2020-10-05
Just to comment, I wouldn't mind seeing Markdown (and Mediawiki) being supported as alternate markup languages in TWiki, even to the extent of being alternate "native languages", and also to allow intermixing those markup languages at either the page (i.e., topic) level (complete pages / topics) in alternate markups) or even intermixed on the same page (topic).
(As an alternate native language, there would be no need to have it converted to / from
TML, but just some kind of indicator as to which markup is being used for a specific region of text.)
But, I would not want to see
TML ever go away, as I am working on an application that uses
TML (and, eventually would allow "automatic") transfer of TWiki pages from my private TWiki(s) (or alternates) to or from various public TWikis.
I have written an
XML file for Kate that syntax hightlights and folds
TML markup. (I am intermittently working on doing the same thing for Scintilla, but not making much progress.)
(Aside: (not really relevant to this discussion, but) I store multiple TWiki-like pages as records (think emails) in mbox files, so I want the syntax highlighter / folder to also fold (and highlight) on a per record (email) basis. The Kate highlighter does that, that is about the only thing the Scintilla highlighter does so far (but with a bug at this point).)
(Further aside: Learning Lisp (a long time ago, now mostly forgotten) gave me a terminal case of parenthesis-itis
--
Randy Kramer - 2020-10-05