Re: [tw5] Re: Code Tiddler and Transclude few lines

2021-01-08 Thread Mohammad Rahmani
Hi Tones Thank you for your feedback. Yes the idea is great to have an interactive ui. I also like to hear about the performance and see how I can improve the macro hslines. Best wishes Mohammad On Sat, Jan 9, 2021 at 2:25 AM TW Tones wrote: > Mohamad et al > > Nice work, I could imagine

Re: [tw5] Re: Code Tiddler and Transclude few lines

2021-01-08 Thread TW Tones
Mohamad et al Nice work, I could imagine range sliders, one for the start line, one for the number of lines, at least for setting the "code window" to be displayed, at least in an authorship mode.. Tones On Saturday, 9 January 2021 at 03:40:05 UTC+11 Mohammad wrote: > This *second version*

Re: [tw5] Re: Code Tiddler and Transclude few lines

2021-01-08 Thread Mohammad Rahmani
This *second version* of hslines even accepts a text as source code no need to provide a tiddler (of course I may recommend to put your code inside tiddler) This can be used to teach Tiddlywiki scripts ;-) A minor bug is version 1 has been fixed. You can set the opacity to blur the other lines .

Re: [tw5] Re: Code Tiddler and Transclude few lines

2021-01-08 Thread Mohammad Rahmani
Attached is an interesting solution to transclude codes from a tiddler. This is useful when you want to discuss part of the code. 1. The code has a macro and a stylesheet 2. It is possible to transclude any part of code (say from line n to line m) 4. Macro accepts ALSO a composite range like

Re: [tw5] Re: Code Tiddler and Transclude few lines

2021-01-08 Thread Mohammad Rahmani
To explain the solution I just posted The modified code is as below. The issue here is if you remove the $codeblock and pass the whole macro output to a single $codeblock the macro content will be displayed! If you use the $wikify widget the line breaks will be removed. So what do you think?

Re: [tw5] Re: Code Tiddler and Transclude few lines

2021-01-08 Thread Mohammad
Hi, I tried to implement a partial solution to transclude selected lines of code from a tiddler contains the whole code. Then I transcluded the whole code with those selected lines. The whole code is opaque but those lines are clear with sharp contrast. This way one can show a code with few

Re: [tw5] Re: Code Tiddler and Transclude few lines

2021-01-07 Thread Mohammad Rahmani
Hi Eric, I came to this thread and found it very interesting. One use case is to show a code using the $codeblock widget with language to highlight the code for those specified lines and show the rest without highlighting! I appreciate to instruct me how to do this. I thought to use the

[tw5] Re: Code Tiddler and Transclude few lines

2020-11-25 Thread TW Tones
Eric, Very impressive Thanks. I am playing with further extension's. Love it. Tones On Thursday, 26 November 2020 at 11:21:02 UTC+11 Eric Shulman wrote: > On Wednesday, November 25, 2020 at 3:19:13 PM UTC-8 TW Tones wrote: > >> >>- It would be nice to extend this also to a wikified

[tw5] Re: Code Tiddler and Transclude few lines

2020-11-25 Thread Eric Shulman
On Wednesday, November 25, 2020 at 3:19:13 PM UTC-8 TW Tones wrote: > >- It would be nice to extend this also to a wikified version as well. > > Wikified output should be as simple as changing this line: <$list filter="[enlist:raw]" variable="line"><$text text=<>/> to: <$list

[tw5] Re: Code Tiddler and Transclude few lines

2020-11-25 Thread Eric Shulman
On Wednesday, November 25, 2020 at 3:19:13 PM UTC-8 TW Tones wrote: > >- And perhaps a code view with line numbers from the source. > > Here's an updated version that add line numbers AND also fixes a bug whereby only one blank line was included in the output \define

[tw5] Re: Code Tiddler and Transclude few lines

2020-11-25 Thread TW Tones
Eric/ Atronoush Eric, I really like that. Just some thoughts as a result. - It would be nice to extend this also to a wikified version as well. - And perhaps a code view with line numbers from the source. - Perhaps a tool for selecting the start and end lines in the source tiddler

[tw5] Re: Code Tiddler and Transclude few lines

2020-11-25 Thread Atronoush
Thank you Eric! Works like a charm! -Atro On Thursday, November 26, 2020 at 1:56:14 AM UTC+3:30 Eric Shulman wrote: > Place the following in a tiddler (e.g., "ShowLinesMacro"), tagged with > $:/tags/Macro" > \define showLines(tid,from,to) > <$vars length={{{ [[$to$]subtract[$from$]add[1]]

[tw5] Re: Code Tiddler and Transclude few lines

2020-11-25 Thread Eric Shulman
Place the following in a tiddler (e.g., "ShowLinesMacro"), tagged with $:/tags/Macro" \define showLines(tid,from,to) <$vars length={{{ [[$to$]subtract[$from$]add[1]] }}}> <$set name="lines" filter="[[$tid$]get[text]splitregexp[\n]first[$to$]last]"> <$list filter="[enlist:raw]"

[tw5] Re: Code Tiddler and Transclude few lines

2020-11-25 Thread Atronoush
See also this discussion for possible solution https://groups.google.com/forum/#!topic/tiddlywiki/6eL-yh2qdB8 On Thursday, November 26, 2020 at 1:07:43 AM UTC+3:30 Atronoush wrote: > Correction: > > Then in another tiddler I explain how code works and I need to include few > *lines* of code and

[tw5] Re: Code Tiddler and Transclude few lines

2020-11-25 Thread Atronoush
Correction: Then in another tiddler I explain how code works and I need to include few *lines* of code and explain them. So for example in Tiddler B, I need to transclude *lines 3-5* and in another part transclude *lines 8-19 * On Thursday, November 26, 2020 at 1:05:46 AM UTC+3:30 Atronoush