Macro for Transclusion to view original tiddler source:

\define reuse-pane(content)<style>.reuse-pane {
    position: absolute;
    right: 10px;
    width: auto;
    max-width: 4px;
    height: 1.5em;
    overflow: hidden;
    border: 10px solid transparent;
    border-top: 0;
    box-sizing: content-box;
    transition: max-width 0.5s;
}.reuse-pane:hover {
  max-width: 80vw;
}.reuse-pane-content {
    display: inline-block;
    background-color: rgba(233, 233, 233, 0.9);
    border-left: 4px solid rgba(0, 0, 0, 0.05);
    padding: 0px 5px;
    padding-bottom: 2px;
}</style><div class="reuse-pane">
  <small class="reuse-pane-content">$content$</small></div>
\end

\define reuse-tiddler(title)<$macrocall $name="reuse-pane" content="""
View Source:[[$title$]]
""" />

{{$title$}}

\end


在 2020年4月10日星期五 UTC+8下午12:23:48,Lin Onetwo写道:
>
> I got this idea from https://wiki.hintsnet.com  @pimgeek
>
> 在 2020年4月10日星期五 UTC+8下午12:22:59,LinOnetwo写道:
>>
>> I think you can use a macro to do such transclude, while transcluding, 
>> you also add some color or side note or a "edit me" button to the side.
>>
>> I'm now transcluding using <<reuse-tiddler "title">>
>>
>> with
>>
>> \define reuse-pane(content)
>> <div style="display:flex;justify-content:flex-end;">
>>   <small 
>> style="display:inline-block;background-color:lavender;border-left:3px solid 
>> slateblue;padding-left:5px;">$content$</small>
>> </div>
>> \end
>>
>> \define get-tiddler-name(title)
>> <$set name="tid" value="$title$">
>>   <$list filter="[all[current]title<tid>]">
>>     <$link to=<<tid>>>
>>       <$view field="name"><$view field="title"/></$view>
>>     </$link>
>>   </$list>
>> </$set>
>> \end
>>
>> \define get-tiddler-source(title)
>> <pre><$text text={{$title$}} /></pre>
>> \end
>>
>> \define get-tiddler-field(title field)
>> <$set name="fid" value="$field$">
>>   <$list variable="fid-val" 
>> filter="[[$title$]get<fid>]"><<fid-val>></$list>
>> </$set>
>> \end
>>
>> \define reuse-tiddler(title)
>> <$macrocall $name="reuse-pane" content="""
>> Edit Source:<<get-tiddler-name "$title$">>
>> """ />
>>
>> {{$title$}}
>>
>> \end
>>
>> 在 2020年4月10日星期五 UTC+8上午5:15:41,Alex Olsen写道:
>>>
>>> I've thought of a workaround. Sometimes all a seemingly complex problem 
>>> needs is a break and fresh eyes to realize it's not as complex as you're 
>>> making it!
>>>  
>>>
>>>> How does the system know it is an unfinished tiddler (so the 
>>>> transclusion can be applied)? What is the difference between an unfinished 
>>>> and finished tiddler?
>>>>
>>>
>>> Ideally with a tag. I plan on using 'incomplete' for any tiddler left 
>>> unfinished. I also wanted an array of in-line messages that were easy to 
>>> see, all of which would tag anything that transcludes them they same way. 
>>> These messages would describe the nature of incompleteness. I have no idea 
>>> what these would include. That's the first sign I'm on the wrong track.
>>>
>>> Fundamentally my issue is that I want to have an easy way to organize 
>>> what I need to finish. That's made difficult by the way I'd like to do it: 
>>> a very visible manner which automatically updates a list of tiddlers that 
>>> have the same need for completion.
>>>
>>> Moving forward, I'll be applying an incomplete tag to anything as I 
>>> begin it and remove that tag afterwards. Simple problems require the 
>>> simplest solutions!
>>>
>>>

-- 
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/dbed905e-0a11-4abd-ad1a-1fa33fbf3b24%40googlegroups.com.

Reply via email to