Hi Raghu
Here’s a macro that gets close to what you want:
\define show-extract(title)
<$wikify name="output" text={{$title$}} mode="block" output="text">
<$text text={{{ [<output>split[]first[500]join[]] }}}/>
</$wikify>
\end
<<show-extract "HelloThere">>
Transclusions will be respected (ie you’ll see the content of the transcluded
tiddler, and not the {{}} markup). The problem is that all the text will appear
to be on one line.
That can be fixed with some CSS:
<div style="white-space:pre;">
<<show-extract "HelloThere">>
</div>
Best wishes
Jeremy
> On 15 Apr 2020, at 13:56, Raghu Veer S <[email protected]> wrote:
>
> As the title says, I want to transclude contents of one tiddler into another
> but limit the number of characters that are transcluded, meaning, when I
> transclude a tiddler I want to be able to specify the number of characters to
> be shown in the new tiddler. Also strip the formatting from the content that
> is transcluded. Is there a way to achieve something like that?
>
> An example would be: <$transclude tiddler="Tiddler1" characterlimit="100"
> mode=raw />
>
> If Tiddler1 looks like this:
> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
> tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
> quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
> consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
> cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
> proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
>
> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
> tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam,
> quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
> consequat. duis aute irure dolor in reprehenderit in voluptate velit esse
> cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non
> proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
>
> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
> tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam,
> quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
> consequat. duis aute irure dolor in reprehenderit in voluptate velit esse
> cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non
> proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
>
> When I say <$transclude tiddler="Tiddler1" characterlimit="100" mode=raw />
> in Tiddler2, It should only transclude:
>
> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
> tempor incididunt ut labore
>
> And mode=raw should be able to strip all the formatting from the original
> tiddler. Any help is appreciated.
>
>
>
>
>
> --
> 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 [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/c182cb96-7a4a-443e-81d2-942eb5d7b0f6%40googlegroups.com
>
> <https://groups.google.com/d/msgid/tiddlywiki/c182cb96-7a4a-443e-81d2-942eb5d7b0f6%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/2998109C-B5CB-46AA-AFED-DF9D59F3483B%40gmail.com.