:filter[get[title]regexp<nonWhitespace>]
change to
:filter[regexp<nonWhitespace>]
and let me know if it works!
:filter[get[title]regexp<nonWhitespace>]
change to
:filter[regexp<nonWhitespace>]
and let me know if it works!
It works well. Awesome!
Mohammad, thanks for that reference. In fact it is the find macro that is the revelation.
Its taking a little time to digest how it works because its very compact and there are number of nice design tricks there in,
There remains the issue of if a marker is loaded with additional content, which does not occur in the \define / \end
but if we used the aformentions section;
<section>
content
</section>
Would work but not;
<section class="namedclass">
content
</section>
Or
\define macro() single line
\define multiline macro
one extra line
\end
would mess up?
But its almost there! Ta
@TW_Tones , then it needs to accept regex pattern! It is solved and can be found in
http://tw-regexp.tiddlyspot.com/#Extract%20Contents%20between%20Html%20Tags
Yes regular expressions thanks for the reference.
Actually your macro may need to be extended to support nesting which could not occur with macro definitions or headings but could with div and other html tags.
As I said I will continue this weekend. If I can i will extend the TOC with filter and position. I have always being keen to totally tame hierarchy.
Thank for the inspiration
This is definitely in the category of âWhy didnât anyone do this before?â
I think the first improvement I would like is to use âCntrl-enterâ to close the editing session.
If sections could fold then it would be great for long-form documents.
Iâll be adding it to my stuff soon as itâs ready for prime time.
@Mohammad I hope the section element is customizable (I donât want Hn tags or have to style them invisible/hidden).
@Mohammad I took your prototype and did the follwing;
in toggle-button added this style/class to the button
style="float: left; margin: -35px;" class="tc-btn-invisible"
in feditor
moved the following to the bottom of feditor
<$macrocall $name=toggle-button stateTiddler=<<stateTid>> onlabel="edit" offlabel="show"/>
Now it looks like this;
Not perfect but the button appears at the bottom of the content in the margin.
@TW_Tones please test the latest version! See the first post!
It uses right float! but you can set it for left float as you suggested! See styles and give a try!
Thank you Mark,
Please open the settings, you have option to switch between text area / main editor (e.g. codemirror)
Then you have some shortcuts!
I will work on this to have keyword shortcuts working for text area too!
Absolutely! It is in todo list!
@Mark_S one question: what do you think if we add settings allow user determines the levels of sectioning? I mean: set =1 only h1 creates sections, if set=2 both h1 and h2 creates sections but not h3! If so, what regex pattern do you propose?
@CodaCoder - sure,
If you are in rush, please see the section-editor! also see the tw-regexp (how to extract contents between elements tag). Give a try and let me know!
I tried to insert a regex pattern to create only h1 and h2 sections, but not h3.
--- Start
<$vars pattern="\n(?=^!{1,2}[^!])" nonWhitespace="[^\s]"
src={{{[<source>get[text]]}}} stid=<<currentTiddler>>>
<$list filter="[<src>splitregexp:m<pattern>!is[blank]first[]] :filter[regexp<nonWhitespace>]
[<src>splitregexp:m<pattern>!is[blank]]" counter=cnt >
<<feditor>>
</$list>
</$vars>
Iâm not sure on browser support for lookaheads, though. Does it work?
kookma.github.io/TW-SE/
Gives a 404 error
My lookahead is almost the same as sull-vitsy
<$list filter="[all[current]has:field[se-type]]">
<$macrocall $name=section-editor source=<<currentTiddler>> pattern="\n(?=!{1,2}[^!])" />
</$list>
Then, in your main macro you donât have to add back in the ! because youâve used the lookahead:
<$list counter=counter variable=section
filter="[<sourceText>splitregexp<pattern>!is[blank]first[]regexp<nonWhitespace>]
[<sourceText>splitregexp<pattern>!is[blank]butfirst[]regexp<nonWhitespace>]">
@Mohammad There is a little problem. Try this text
! asdf
aaaa
! asdf
aaaa
Now edit the 2nd one and save. â The 1st one will be edited.
Corrected! I also updated the original post at top of this thread!
Section Editor is here:
Thank you @pmario - I confirm the bug!
While having two similar sections, is an edge case, but I surely address this bug!
Great job! Iâve been waiting for a plugin like this for a long time, thanks for the work!
I think this section editor plugin in conjunction with my CodeMirror-Enhanced
plugin would greatly enhance the TiddlyWiki writing experience, just like notion does.
Also, Iâd like to ask if itâs possible to make each block (e.g. a paragraph, an image, a quote, a table, etc.) editable individually like notion, instead of using headers for section editing? I think this would make editing more flexible. Thanks!