How to add warning macro to my Tiddlywiki

48 views
Skip to first unread message

Dieterv

unread,
Sep 3, 2021, 6:27:42 AMSep 3
to TiddlyWiki
I use my TiddlyWiki as some sort of external memory to compensate for my lack of good memory.

Often I am searching for a way to attract my attention to (for instance if I have a tiddler containing all kinds of linux commands, there might be some non-intuitive commands that I need to watch out for). 

Right now I would use something like:
|!Watch out for this:|
To create something eyecatching but that isn't too great.

I found warning and tip macros used on pages like these but using <<.warning "some text">>> does not render for me. I suppose I need to add a macro somewhere and have been trying to find the correct way by digging in to the wiki that I linked above, but cannot find how to make that work.

Any pointers? Thanks!

Eric Shulman

unread,
Sep 3, 2021, 6:54:58 AMSep 3
to TiddlyWiki
On Friday, September 3, 2021 at 3:27:42 AM UTC-7 Dieterv wrote:
I found warning and tip macros used on pages like these but using <<.warning "some text">>>

Many of the macros that start with "." (e.g., "<<.warning>>") have been specially installed on
https://TiddlyWiki.com as part of an "edition", and can be found here:

   $:/editions/tw5.com/doc-macros

If you import that tiddler to your file, you can then use the <<.warning "...">> and <<.tip "...">> macros.

However, you don't actually *need* those macros to display those symbols,
which are already part of the TiddlyWiki core installation, and can be found here:

$:/core/images/warning and $:/core/images/tip

To display those images without installing the TiddlyWiki documentation edition,
you can transclude them directly into your content by writing:
{{$:/core/images/warning}} or {{$:/core/images/tip}}

enjoy,
-e

P.S. Please join us on the new "Talk TiddlyWiki" Discourse server, here: https://talk.tiddlywiki.org/.
It's currently an "experiment", but we hope to transition to it, and away from GoogleGroups, sometime
in the near future.

Dieterv

unread,
Sep 3, 2021, 8:10:30 AMSep 3
to TiddlyWiki
Oh great!

It took me some time to figure out how everything worked, but your explanation helped me to get started. I think I understand now.

In case anyone else needs this, I have created the following tiddler for myself to document how to do this without importing the whole doc-macros tiddler (replace Deevee with any folder name you like):

! Add Warning and tip macro's

* Create a new tiddler, name it `$:/Deevee/macros`
* Add the tag `$:/tags/Macro`
* Past in the following contents:

```
\define .tip(_) <div class="doc-icon-block"><div class="doc-block-icon">{{$:/core/images/tip}}</div>$_$</div> 
\define .warning(_) <div class="doc-icon-block"><div class="doc-block-icon">{{$:/core/images/warning}}</div>$_$</div>
```

* Create another tiddler, name it `$:/Deevee/styles`
* add the tag `$:/tags/Stylesheet`
* paste in the following contents:

```
.doc-icon-block {
border-left: 2px solid <<colour code-border>>;
margin-left: 3em;
padding-left: 0.6em;
position: relative;
}

.doc-block-icon {
position: absolute;
left: -3em;
top: 0.2em;
}
```

Mohammad Rahmani

unread,
Sep 3, 2021, 8:48:41 AMSep 3
to tiddl...@googlegroups.com
You may also like kookma Classic Notes

image.png



Best wishes
Mohammad


--
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/08732143-cb55-4aef-beee-49d9d5ce3f0an%40googlegroups.com.

Paul Hampshire

unread,
Sep 3, 2021, 9:20:45 AMSep 3
to TiddlyWiki
Or you could just use a special html character which might be less text/typing.
There is a "Warning Sign" that will appear in color and can be make larger with headings.special character examples.jpg
Reply all
Reply to author
Forward
0 new messages