Additional Wikitext rule - leading period for paragraphs

62 views
Skip to first unread message

TonyM

unread,
Oct 1, 2019, 12:22:26 AM10/1/19
to TiddlyWiki
Folks,

This is a new post and thread to separate out of this thread the development of an optional extra Wikitext markup method.

CdK has made and we have tested a patch to make the following "." or period character provide an additional markup option.

Currently you can use ";" and ":" for the html equivalent of definitions see https://tiddlywiki.com/#Definitions%20in%20WikiText

A key benefit in using these is an automatic line break occurs and additional double breaks are not required.
The introduction of the "." period such that when it is the leading character on any line is it will wrap that line at render time with 
<p>Line or multiple sentence paragraphs</p>
This results in a paragraph followed by a blank line.

A companion editorTool bar would allow you to select multiple lines and apply a leading period, just as one can currently with * and # to get bullets.

The Paragraph html tag will maintain a blank line between paragraphs but will also collapse multiple blank lines into one. This helps when additional blank lines end up in your tiddlers after a cut and paste operations.

To me the key value is when typing content into a tiddlers text field. With the use of "." ";" ":" and multiple ":" for indents, and the heading and bullet markup it is much easier to write nicely presented wiki text at "render time" but is simple and concise when editing.

  1. What do you think?
  2. Have you seen additional markup before?
  3. What is the best way to implement it?
  4. Have you a related issue with wikitext? do share!
  5. Should this be standard or optional, or a plugin?
Regards
Tony

@TiddlyTweeter

unread,
Oct 1, 2019, 4:29:35 AM10/1/19
to tiddl...@googlegroups.com
Ciao TonyM

Just some initial comments.

Thankyou for laying out something that is very clear on the final aim.

Have you seen additional markup before?
 
Yes. Seen and made. Though I tend to use raw regular expressions via BJ's tool that runs before the main parsers start for that. 
I don't think that is the best approach here. 

What is the best way to implement it?

Via a parser under ...

$:/core/modules/parsers/wikiparser/rules/


This could be either a hack of an existing one. OR, probably better, by cloning one of the existing parsers and modifying it.
I'm not fully clear on how you run a new parser rather than a hacked one. Or whether it matters what order they run it. 
But I doubt it is difficult to sort out.

The parsers are in JS but I don't think you need much JS knowledge to modify one as the important part will be a regular expression match followed by a replace.
  
Should this be standard or optional, or a plugin?

Probably a plugin. 
However, I often wondered if it would be worth requestiing that a generic "Custom Parser" be added that a user could add new markup processing for render to. 
 
Best wishes
TT
Reply all
Reply to author
Forward
0 new messages