Mario,You are a wizard with this kind of thing, I hope you could assist me. I ask now because your above solution is slow close to what I have asked for for some time.
- Is there a possibility you could generalise this so others could modify it to produce their own parser/pragma?
- If you see in the core where * # ; : are defined it seems to me it should be trivial to add another special character and set html tags but it is not.
- could you make a standard plugin template we can modify to set the lead character and the html tags to apply?
- I really want the leading period "." to trigger a html paragraph around multiple sentences until we get to end of line (line break)
- However I see value if I could build others
Thanks if this is possibleTony
On Tuesday, February 25, 2020 at 11:13:54 PM UTC+1, TonyM wrote:..You are a wizard with this kind of thing, I hope you could assist me. I ask now because your above solution is slow close to what I have asked for for some time....
- I really want the leading period "." to trigger a html paragraph around multiple sentences until we get to end of line (line break)
I have seen this request, but I don't understand it. I think the first time it came up with the "single linebreak" - "hard linebreak" in paragraphs discussion.In my thinking having a dot at the start of the wikitext line is annoying. I'd rather go with some spaces, which you can sometimes see.Also inserting a dot at the beginning of a line is the same manual work as hitting [Enter] or even 2 times Enter, to create a real wikitext paragraph.The second problem I have is, that a "hard paragraph" will create HTML code like this:<p><p>This text is wrapped because there was a "dot" at the beginning of the line</p></p>Which is ugly, since TW already suffers from "divitis". So imo we shouldn't add "paragraphitis" if we can avoid it ;)Mario
Mario,I would expect a dot at the beginning to simply do this.<p>This text is wrapped because there was a "dot" at the beginning of the line</p>To me this is a very valuable tool for use in my own wikis, not only for massaging imported content but helping me structure notes as I compose them. It would be easy to remove all leading periods if required and if we copy the resultant html for reuse it is good for sharing.I want a bespoke setting here, not a change to the fundamental markup standards, and if possible offer the option for other bespoke leading charater markup. eg someone may like to indicate sections or chapters etc... with their own markup, basically allowing a markup character to be defined use standard html tags, tags not already catered for in wikitext or widgets.Perhaps you are not interested but It would help me (and I believe others would like it) a lot. But the question is why is the addition of such bespoke markup not possible?, from what I can see programmatically it should be trivial, perhaps even entries in a data tiddler to define them.
With an Editor toolbar button I can turn all lines into paragraphs buy, select all, click, prepending the lines with a period.One way to test the value is to copy a big block of multi paragraph lorum ipsum then use a editor toolbar item to select all lines and prepend with ";"Empty `<P>` tags collapse to one blank line between paragraphs and indicating the "pre-wrapped" line starts helps and editor review the layout, especially for content sourced elsewhere. Which often contains multiple blank lines, using this they all collapse to a single blank line when rendered.In rapid note taking I use ";" and ":" a lot, and this would complement these by providing automatically managed paragraphs. There is no non-bold equivalent to ";".If you have another character or markup pattern in mind happy to consider. But I realy, realy, want this, given my personal organiser, my data imports, note taking in courses etc.. Material I add tends to go nowhere but in my own personal wikis.And yes, for some people this will satisfy there frustration with the line breaks.RegardsTony
On Thursday, February 27, 2020 at 12:27:36 AM UTC+1, TonyM wrote:Perhaps you are not interested but It would help me (and I believe others would like it) a lot.I wouldn't discuss it, if I wouldn't be interested. I just need to understand it in a broader context.But the question is why is the addition of such bespoke markup not possible?It is possible -- and it should create html markup that is in line with the html spec. The spec is important for eg: accessibility tools like screen readers. So our wikitext should produce output, that doesn't confuse those tools., from what I can see programmatically it should be trivial, perhaps even entries in a data tiddler to define them.Not really trivial. ... The elements you pointed out, are all part of the list-parser. So they create 2 elements.eg:* test ... creates an <ul> wrapper and <li> elements.; test ... creates a <dl> wrapper and <dt> elements.So if the leading-dot is added, in a naive way it creates nested paragraphs, which is outside the html specs.I did test it with a <section> wrapper and <p> elements which seems to be OK.eg:.test 1.test 2will give us<section><p>test 1</p><p>test 2</p></section>There may be other possibilities, to add this behaviour, but I didn't think about that ... yet.-mario
MarioThanks. That explains a lot more. Would it be ok to nest it in a div, perhaps the div could have a class so styles could be applied e.g. the paragraph style, thus the transition to multiple paragraphs could be changed e.g. 1.5 line space between paragraphs.
Regards
Tony
Ciao TonyMHere is my naive comment. I'm still not fully clear what the outcome you looking for is meant to "look like".But I think CSS might be a workable solution. Either in a div container or a CSS rule that detects markup?Best wishesTT
MarioThanks. That explains a lot more. Would it be ok to nest it in a div, perhaps the div could have a class so styles could be applied e.g. the paragraph style, thus the transition to multiple paragraphs could be changed e.g. 1.5 line space between paragraphs.
Codemirror allows indents/with tabs, but the render does not honor them, but here I want no indent, just a paragraph.
In my case I already use ":" to indent and make an effective paragraph,
multiple indents as well, as you know ";" is bolded but is does what I want otherwise, but since I we are dealing with paragraphs it seems best to use the html P tag. At one point I removed the bold with ;.p where p was a class name that unbolded it. But ;.p is surprisingly distracting.
I notice that using period as the second character to ;.classname and :.classname works, so theoretically ..classname could also work while rendering the text in an un-indented paragraph.
But I am not wedded to period, however it is nicely easy to access on the keyboard (no shift) and it is often so unassuming if it was at the beginning of a paragraph (not wikifield) it is almost unnoticeable.
One idea is what if we used an invisible character? eg; non breaking space, one that is otherwise ignored?, the only question is how do we get a single key entry, and ideally display while editing raw text.
I also created .q and .a classes to highlight Questions and their Dnswers differently and this also allowed the Questions and answers in a long text to be listed in a footer.
With matching I listed unanswered Questions. You can see here, this provides an ad hoc way for an author to add annotations,
classification and formatting details to their content as they write, a bit like a home grown shorthand, which is what markup is all about.
I may also add when trying to take notes in a class or watching a video the more easy tricks the better.
Regardless if such "customisations" were hackable more can be done. Inventions we can't imagine.
- One I can imagine - an indicator to later excise, and transclude or Link to that transclusion (needs beginning and end, or default to end of line/paragraph)
wikitext markup should be globally interchangeable
It makes me wonder if we need a kind of "escape character", behind which custom markup can be defined, but ignored if not handled by the recipient wiki. A field and its content could cause such an alternate markup or the type field. Perhaps copy to clipboard, and copy, export could include an option to ignore especially escaped markup.
We may be able to create a \rules use <regexp> dot-paragraph ... Which can do something sensible, if the "dot-paragraph" inline parser is missing.eg: hide the leading dot, but show a "dot-paragraph parser is missing" message somewhere. ... A more intelligent solution would be an "import the missing stuff" dialogue ;)
TonyM wrote:In my case I already use ":" to indent and make an effective paragraph,
No you create a Description Details element ... that's a different thing. ... You are basically "misusing" it, because there is no visual difference.But there is a semantic difference. eg: If you copy paste the html code into a different app, that tries to make sense out of the html structure, it will be confused.
We may be able to create a \rules use <regexp> dot-paragraph ... Which can do something sensible, if the "dot-paragraph" inline parser is missing.
\rules use <regexp> three-lead-spacesI'm not a big fan of invisible "formatting", but for some things, we don't have a choice. ... The [tab] at the beginning of a line will be visible in edit mode. ... but it would look the same as if you did 8 spaces. ... But nobody makes 8 spaces at the start of a line. right ;)
PMario wrote:We may be able to create a \rules use <regexp> dot-paragraph ... Which can do something sensible, if the "dot-paragraph" inline parser is missing.Wondering if the idea here is extensible? For example ...\rules use <regexp> three-lead-spaces
In other words, generic ability for the user to add BESPOKE RULES using regex?
IF so I think it would be excellent. It could, maybe, solve Tony's issue and simultaneously make the parsing process less obscure and practically extensible?
The issue is the KIND of document. The point about light-weight markup is precisely to use as little markup as possible so that the text remains human readable.
Some kinds of document can have incredibly light markup because the actual written form already implies its own markup.
For instance, screenplays rely on spacing in the human readable version so parsers for them use spacing as a primary vector. An example is https://fountain.io/syntax
which is an elegant space-centric variation on Markdown.
>Fountain, formerly known as Screenplay Markdown, is inspired by John
Gruber's super cool Markdown language,
>and uses some of its conventions,
but Fountain is not Markdown.
>There's no use in converting Fountain to
Markdown or the reverse.
>Markdown simply pointed the way to a rich but
simple experience of creating beautiful,
>functional documents using only human-readable plain text.
Sounds good. What is the best way to proceed for a dot-paragraph?, and ideally so others can be added if desired.
On Tuesday, March 3, 2020 at 10:44:01 AM UTC+1, TonyM wrote:...Sounds good. What is the best way to proceed for a dot-paragraph?, and ideally so others can be added if desired.I just found out, that we can't use a "global" dot-paragraph rule since it messes with the TW stylesheet parsing.
I have seen the discussion about fountain.io ... I think this is a completely new tiddler-type, which can be implemented as a plugin and type: text/vnd.fountain or something similar.
I just found out, that we can't use a "global" dot-paragraph rule since it messes with the TW stylesheet parsing. eg:
\bespokemarkup notes
\bespokemarkup dotparagraphs
PMario wrote:I have seen the discussion about fountain.io ... I think this is a completely new tiddler-type, which can be implemented as a plugin and type: text/vnd.fountain or something similar.Right. Ideal.FYI for private use I use raw regex made via bj's content pre-parser to make a fully workable Fountain (crude) pre-parser.
Mario,I just found out, that we can't use a "global" dot-paragraph rule since it messes with the TW stylesheet parsing. eg:Maybe this the point. Such bespoke parsing could be designed to only operate for a given tiddler type
or tiddlers with the pragma set to apply the "local" parsing rule.
As an example In the case of the dot paragraph The key places I would expect to use it would be
- when pasting text from other sources and transforming to a more readable rendering
- when typing content in class or capturing ideas brain to text
In these examples I would be happy to introduce pragma to support thiswhere notes defines standard markup + some rules defined in "notes".\bespokemarkup notes
\bespokemarkup dotparagraphs
- Although a way to apply it from the view template or another conditional method would be nice.
- The point being you would not do this on a tiddler containing CSS unless it provides some value.
- In tiddlywiki a local rule can become global if you apply it everywhere but I think bespoke markup could be constrained to nominated tiddlers.
The point here is I / We are free to use period and I do not need to go looking for other symbols.
In these examples I would be happy to introduce pragma to support thiswhere notes defines standard markup + some rules defined in "notes".\bespokemarkup notes
\bespokemarkup dotparagraphs
. Paragraph
. Para 2
. Para three
. First
.
.
.
. SecondWhat does a notes do ?
. Class notes Feb 23 2020
;Subject: Analysis
. Analysis and Synthesis.
.. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Volutpat ac tincidunt vitae semper quis. Congue eu consequat ac felis donec et odio pellentesque diam. Dictumst vestibulum rhoncus est pellentesque elit ullamcorper. Orci nulla pellentesque dignissim enim sit. Feugiat scelerisque varius morbi enim. Malesuada fames ac turpis egestas maecenas pharetra. Dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida. Gravida neque convallis a cras semper auctor neque vitae tempus. Lobortis scelerisque fermentum dui faucibus in. Faucibus scelerisque eleifend donec pretium vulputate sapien nec sagittis. Cursus in hac habitasse platea dictumst. Sollicitudin nibh sit amet commodo nulla. Elementum facilisis leo vel fringilla est ullamcorper eget nulla facilisi. Felis imperdiet proin fermentum leo. Diam maecenas sed enim ut sem viverra.
;Analysis
. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Volutpat ac tincidunt vitae semper quis. Congue eu consequat ac felis donec et odio pellentesque diam. Dictumst vestibulum rhoncus est pellentesque elit ullamcorper. Orci nulla pellentesque dignissim enim sit. Feugiat scelerisque varius morbi enim. Malesuada fames ac turpis egestas maecenas pharetra. Dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida. Gravida neque convallis a cras semper auctor neque vitae tempus. Lobortis scelerisque fermentum dui faucibus in. Faucibus scelerisque eleifend donec pretium vulputate sapien nec sagittis. Cursus in hac habitasse platea dictumst. Sollicitudin nibh sit amet commodo nulla. Elementum facilisis leo vel fringilla est ullamcorper eget nulla facilisi. Felis imperdiet proin fermentum leo. Diam maecenas sed enim ut sem viverra.
;Synthesis
. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Volutpat ac tincidunt vitae semper quis. Congue eu consequat ac felis donec et odio pellentesque diam. Dictumst vestibulum rhoncus est pellentesque elit ullamcorper. Orci nulla pellentesque dignissim enim sit. Feugiat scelerisque varius morbi enim. Malesuada fames ac turpis egestas maecenas pharetra. Dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida. Gravida neque convallis a cras semper auctor neque vitae tempus. Lobortis scelerisque fermentum dui faucibus in. Faucibus scelerisque eleifend donec pretium vulputate sapien nec sagittis. Cursus in hac habitasse platea dictumst. Sollicitudin nibh sit amet commodo nulla. Elementum facilisis leo vel fringilla est ullamcorper eget nulla facilisi. Felis imperdiet proin fermentum leo. Diam maecenas sed enim ut sem viverra.Would it be possible to still trigger this markup with <dot>any character? This was the original desire?
Can your extended markup still accommodate this?
Although I see that the space may allow to load it with more possibilities.
- I am yet to grasp the use of trailing "space space enter"
* test
next line should be part of the li-element.
- Is there a reason why we could not issue a <br> for <dot><space><space>, or even turn the previous line into a paragraph as a result.
I have also started testing if and how the previous markup method work with and without the ".paragraph" to introduce css the ".classname" eg ";.classname "
You askedWhat does a notes do ?It was only an example of another bespoke markup, I imagined it boxing a div and providing dl dt tags to highlight a specific note.
Given your work so far and this particular case of providing markup to use `<p>` html tags makes me ask if it makes sense to also develop markup for `<section>`, `<div>` and `<span>` to which one can introduce css. I am thinking of what markup could be helpful for rapid authorship, note taking and very simple layout.
eg: place this in a dot paragraph wiki and see how beautiful the result with little effort
! Class notes Feb 23 2020
!! Subject: Analysis
. Analysis and Synthesis.
<h5>Class notes Feb 23 2020</h5>
<h6>Subject: Analysis<h6><p>Analysis and Synthesis.</p>
If dot space is applied to all lines and they include blank lines I am getting the desirable result from the html paragraph tag, the blank lines collapse into one paragraph break.This is helpful when pasting content from elsewhere because it is often full of multiple blank lines, eg copy off a webpage.
This rule is also intended to work with TW syntax like:* test
next line should be part of the li-element.
If you copy the above code into tiddlywiki.com and your experimental wiki, you'll get a different result.
Although I see that the space may allow to load it with more possibilities.
- I am yet to grasp the use of trailing "space space enter"
That's compatible to the new "CommonMark" markdown parser spec for "hard linebreaks". So if someone copies a markdown paragraph to TW, they should see the same result.see: https://spec.commonmark.org/0.29/#hard-line-breaks .. (I just found out, that it's not 100% compatible, but good enough to start with)
This rule is also intended to work with TW syntax like:* test
next line should be part of the li-element.
* List
:notes
* list more
:more notes
# List
:notes
# list more
:more notes
**item 1 no matching"*" Eroniouse dot to left
**item 2
<ul><ul>
<li>item 1 no matching"*" no eroniouse dot to left</li>
<li>item 2</li>
</ul></ul>
:::*List items indented
:::*listI think, it should be possible to "remove" empty lines or empty lines preceded by a dot from the generated DOM. At the moment empty p-tags are created. They are not visible, but they are there, which isn't nice.
Yea, I did think about that. ... But there will be a steeper learning curve, the more elements we add or change from the original behaviour.
<section> and <div> should be no problem, because they allow "flow content" as "Permitted Content" see the link.<span>'s are inline elements only. They only allow "phrasing content" (same as paragraphs). It will produce invalid html code if used at the start of the line like: * or # or .I was thinking about an <aside> (note) using > at the beginning of the line.
\startheading 5
I also think, the manual workflow could be improved, using less time and getting improved html output. ... BUT I'll need to think about this. ... I think about new editor-shortcuts,
That can speed things up significantly.
-mPS: I'll need some time, since the last storm knocked over some of my trees. I have to remove them.
<section> and <div> should be no problem, because they allow "flow content" as "Permitted Content" see the link.
<span>'s are inline elements only. They only allow "phrasing content" (same as paragraphs). It will produce invalid html code if used at the start of the line like: * or # or .
I was thinking about an <aside> (note) using > at the beginning of the line.
Are you suggesting this?;
- test
next line should be part of the li-element.should become
- test next line should be part of the li-element.
Please see some sample wiki text below that illustrates some of my observations* List
:notes
* list more
:more notes
# List
:notes
# list more
:more notes
**item 1 no matching"*" Eroniouse dot to left
**item 2
<ul><ul>
<li>item 1 no matching"*" no eroniouse dot to left</li>
<li>item 2</li>
</ul></ul>
:::*List items indented
:::*list
**item 1 no matching"*" Eroniouse dot to left
**item 2
**item 1
**item 2
:::*List items indented
:::*list\startheading 5This is a nice idea, how will it effect transclusions, Actually applying this to subtiddlers transcluded at a different heading level could be helpful, again can we programmatically apply pragma?