- And perhaps a code view with line numbers from the source.
- It would be nice to extend this also to a wikified version as well.
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/f609beb5-695f-4b38-aff3-36afe498cde9n%40googlegroups.com.
\define showLinesc(tid,from,to,language)
<$vars length={{{ [[$to$]subtract[$from$]add[1]] }}}>
<$set name="lines" filter="[[$tid$]get[text]splitregexp[\n]addsuffix[ ]first[$to$]last<length>]">
<ol start="$from$"><$list filter="[enlist:raw<lines>]" variable="line"><li><$codeblock code=<<line>> language=<<__language__>>/></li></$list></ol>
</$set>
</$vars>
\end
\define hslines(tid, from, to, rng, language)
<$wikify name="numbers" text=<<rawlist>> >
<$vars length={{{ [[$to$]subtract[$from$]add[1]] }}} >
<$set name="lines" filter="[[$tid$]get[text]splitregexp[\n]addsuffix[ ]first[$to$]last<length>]">
<ol start="$from$" class="code-list">
<$list filter="[range[$from$,$to$,1]]" variable=num>
<$list filter="[enlist<numbers>nsort[]match<num>then[code-selected]else[code-notselected]]" variable=selectedClass>
<$vars pos={{{ [<num>subtract[$from$]add[1]] }}} >
<span class=<<selectedClass>> >
<li><$codeblock code={{{ [enlist:raw<lines>nth<pos>] }}} language=<<__language__>>/></li>
</span>
</$vars>
</$list>
</$list>
</ol>
</$set>
</$vars>
</$wikify>
\end
\define rng2list() {{{[range[$(start)$,$(end)$]addsuffix[ ]]}}}
\define rawlist()
<$list filter="[<__rng__>split[,]split[ ]!is[blank]]" variable=num>
<$list filter="[<num>search:title[-]]" emptyMessage=<<num>> variable=vrng>
<$vars start= {{{ [<vrng>split[-]first[]] }}}
end= {{{ [<vrng>split[-]last[]] }}} >
<<rng2list>>
</$vars>
</$list>
</$list>
\end
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/70637961-7433-47db-ace4-36f8fcafa869n%40googlegroups.com.