[tw5] How to add warning macro to my 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!

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.

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;
}

You may also like kookma Classic Notes
http://classic-notes.tiddlyspot.com/

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.

1 Like