Aha @Charlie a legal cheater ;)
I do know some C, a bit php (be it rusty) and i still write bash-scripts.
So yes! A q&d macro demo, bring it oooooooooooon :-)

(maybe in an online session somewhere?? :-)  )

Ray

Op za 24 apr. 2021 om 22:18 schreef Hans Wobbe <[email protected]>:

> @ludwa6: Walt:
>
> I made a few tweaks to Eric's code to suit my own uses.  I did not put
> this into my sidebar, by now, you know that would be relatively simple to
> do.
>
> On Saturday, April 24, 2021 at 9:49:48 AM UTC-4 ludwa6 wrote:
>
>> Thanks @Eric : it does indeed work nicely -only not in the sidebar; after
>> the streamlining you've done on Charlie's script, that functionality seems
>> to have been compromised.
>> @Hans: Have you implemented Eric's script without modification, and does
>> it display & function correctly in your sidebar?
>>
>> Anyway: Without really understanding the code, i'm now using Eric's macro
>> definition line at the top, followed by Charlie's UI-related code, and that
>> seems to work pretty well, tho the sidebar view doesn't flow so well if
>> it's set too narrow; i can certainly live w/ this -happy!    /w
>>
>> 8<------(snip)----->8
>>
>> \define AddTopic(topic) <option value={{{ [[$topic$]encodeuri[]addprefix[
>> https://en.wikipedia.org/wiki/]] }}}>$topic$</option>
>>
>> <$select tiddler={{Wikipedia!!title}} field="curr-topic">
>> <!--🔴 AddTopic takes as input tiddler titles from wikipedia.org  and
>> creates a link to same tiddler at the static site.
>>              Add/modify/remove items as per the following three examples
>>              Order the topics as per your preferences
>>              Add   "optgroup elements to group entries" -->
>> <<AddTopic  "TiddlyWiki">>
>> <<AddTopic  "WikiWikiWeb">>
>> <<AddTopic  "Project_Xanadu">>
>> </$select>&nbsp;&nbsp;<a href={{Wikipedia!!curr-topic}} title="Open web
>> page in a separate window/tab"  target="_blank">link</a>
>> <iframe  src={{Wikipedia!!curr-topic}} height="500" width="100%"></iframe>
>>
>> 8<------(snip)----->8
>> On Saturday, April 24, 2021 at 2:07:33 PM UTC+1 [email protected] wrote:
>>
>>> @Eric: Thanbk you.
>>> This works nicely and is, of course, quite extensible to sites like
>>> TiddlyWikiLinks.
>>>
>>> Cheers,
>>> Hans
>>>
>>> On Saturday, April 24, 2021 at 8:30:04 AM UTC-4 Eric Shulman wrote:
>>>
>>>> On Saturday, April 24, 2021 at 3:16:22 AM UTC-7 ludwa6 wrote:
>>>>
>>>>> PS to my last: have fixed part of the problem: by adding the suffix
>>>>> clause back into macro (as below), it now pulls not a system-level error
>>>>> msg, but the error msg from wikipedia.org site itself, which seems to
>>>>> be objecting to the .html extension only... yet i can't find a way to
>>>>> remove that w/o reverting to the lower-level error msg.  Any insight about
>>>>> this problem would be appreciated!
>>>>
>>>>
>>>> Try this in a tiddler named "ShowWikipediaFrame":
>>>> \define AddTopic(topic) <option value={{{
>>>> [[$topic$]encodeuri[]addprefix[https://en.wikipedia.org/wiki/]]
>>>> }}}>$topic$</option>
>>>>
>>>> <$select field="curr-topic">
>>>> <<AddTopic  "TiddlyWiki">>
>>>> <<AddTopic  "WikiWikiWeb">>
>>>> <<AddTopic  "Project Xanadu">>
>>>> </$select>&nbsp;&nbsp;<a href={{!!curr-topic}} title="Open web page in
>>>> a separate window/tab"  target="_blank">link</a>
>>>> <iframe src={{!!curr-topic}} height="500" width="100%"></iframe>
>>>>
>>>> Notes:
>>>> * The filter  in AddTopic  needed a closing "]]".  Also, the filter
>>>> uses "encodeuri[]" rather than "split[ ]join[%2520]".  This handles all
>>>> special URI characters, not just space.
>>>> * The target tiddler for storing the $select widget value is the *current
>>>> tiddler*, rather than "Wikipedia" (or {{Wikipedia!!title}}) and the
>>>> corresponding <a href=...> and <iframe src=...> params simply fetch
>>>> {{!!curr-topic}} (i.e., from the current tiddler).  This allows you
>>>> transclude the above content as a template (e.g.,
>>>> {{||ShowWikipediaFrame}}) and each transcluded instance can be used to
>>>> show a different selected topic.
>>>>
>>>> enjoy,
>>>> -e
>>>>
>>> --
> 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/64e6a5a6-f097-40f7-88f5-c5b20074da94n%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/64e6a5a6-f097-40f7-88f5-c5b20074da94n%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/CAAF_p9CH86r4a3qjW7xJ0FvUKPLJA7NyV54F9iJ_b8_MzOXwKA%40mail.gmail.com.

Reply via email to