Syntax to highlight text

147 views
Skip to first unread message

Klaas Vaak

unread,
Apr 9, 2020, 11:28:28 AM4/9/20
to tiddl...@googlegroups.com
The only syntax I have seen mentioned is @@text@@, but it does not work.

Mat

unread,
Apr 9, 2020, 12:47:40 PM4/9/20
to TiddlyWiki

Klaas Vaak

unread,
Apr 9, 2020, 12:56:29 PM4/9/20
to tiddl...@googlegroups.com
Coloured background, which is what your link directs to, is not the same as highlight.

On 2020-Apr-09, at 19:47, Mat <matia...@gmail.com> wrote:


--
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/3a5e50c3-acdc-4587-a8a4-408324f12139%40googlegroups.com.

Mat

unread,
Apr 9, 2020, 1:02:23 PM4/9/20
to TiddlyWiki
Klaas Vaak wrote:
Coloured background, which is what your link directs to, is not the same as highlight.

What is highlight then?

Still, the link also instructs how to apply a css class, so you can define a custom class to "highlight" - assuming you know some css. (As noted, I don't understand what "highlight" means so I can't create the class for you.)

<:-)

Klaas Vaak

unread,
Apr 9, 2020, 1:08:07 PM4/9/20
to tiddl...@googlegroups.com
Highlight is giving a background colour to a word or phrase, like you do when e.g. reading a report and you highlight words in yellow; yes you can highlight a whole sentence while reading the report, but usually it is a word or a phrase and people use a felt-tipped marker.

What is on the page you linked to is colouring, “highlighting” if you like, a whole block. I am looking for the word highlighting. Usually it consists of putting symbols on either side of a word, like e.g. italics or bold.

--
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.

Mat

unread,
Apr 9, 2020, 1:24:02 PM4/9/20
to TiddlyWiki
Well, I think "highlighting" is actually just background coloring with a faint color :-)

There is no direct wikitext highlighting which is what I think is what you're after, but I made a github request for this (...some time ago, ehm) so give it a thumbs up.

So, for now, I'm afraid you'll have to something like @@background:#FF9; this@@.

OR you can check out the very recently announced Dynanote plugin that might do exactly what you're after. See release notes in the prerelease.

<:-)

Mohammad

unread,
Apr 9, 2020, 2:18:20 PM4/9/20
to tiddl...@googlegroups.com
You may know the mark tag works out of the box! So in your tiddler you can have

<mark> you text goes here</mark>


You can also use Shiraz plugin which has a css framework for Tiddlywiki

--Mohammad

Mat

unread,
Apr 9, 2020, 4:25:30 PM4/9/20
to TiddlyWiki
<mark> you text goes here</mark>

Aha - is that a native browser thing or a TW thing? Cos if it is native html, then we certainly should have it converted to @@this@@ in wikitext.


Klaas, a shorter thing than <mark> might be a made up html tag, say "h", like so:

<h>foo</h>

...as set in a stylesheet with:

h {background:#FF9}

<:-)

Mohammad

unread,
Apr 9, 2020, 5:47:39 PM4/9/20
to tiddl...@googlegroups.com


On Friday, April 10, 2020 at 12:55:30 AM UTC+4:30, Mat wrote:
<mark> you text goes here</mark>

Aha - is that a native browser thing or a TW thing? Cos if it is native html, then we certainly should have it converted to @@this@@ in wikitext.


This is native html5 tag!
 
Klaas, a shorter thing than <mark> might be a made up html tag, say "h", like so:

<h>foo</h>

...as set in a stylesheet with:

h {background:#FF9}

<:-)

also you can a macro like
<<h foo>>


and 

\define h(txt) <span style="background:#FF9" >$txt$</span>


or


\define h(txt) <mark>$txt$</mark>


TonyM

unread,
Apr 9, 2020, 8:42:11 PM4/9/20
to TiddlyWiki
Folks,

I will just add there is an editor toolbar button for highlighting the applies the following

@@background-color:yellow;  Text@@


Remember the @@XXX wrapps@@ text but the XXX needs to be a style or class as listed here https://tiddlywiki.com/#Styles%20and%20Classes%20in%20WikiText

Its not so hard to make your own toolbar options, so you could add buttons for different colours.

the new prerelease has the new freelinks plugin to automatically create links from any tiddler title, without having to type double square brackets or use CamelCase.

You could just create a title with the highlighted text and the same text will be highlighted where ever it is used with freelinks active. You could do this when typing content by using the excise tool to create a link to a tiddler. It

Regards
Tony

Klaas Vaak

unread,
Apr 10, 2020, 12:16:07 AM4/10/20
to tiddl...@googlegroups.com
Mat, thanks, @@background:#FF9; text@@ works, although the hex value can also be replaced by the word for the colour, as per TonyM’s reply.

TonyM, thank you for that.

Mohammad, <mark>text</mark> works well and is the simplest. The default colour setting is yellow, so if one wants a different colour Mat’s/TonyM’s syntax would be required.

Many thanks guys.


On 2020-Apr-10, at 03:42, TonyM <anthony...@gmail.com> wrote:

background-color:yellow;  Text@@

Mohammad

unread,
Apr 10, 2020, 12:55:59 AM4/10/20
to tiddl...@googlegroups.com


On Friday, April 10, 2020 at 8:46:07 AM UTC+4:30, Klaas Vaak wrote:
Mat, thanks, @@background:#FF9; text@@ works, although the hex value can also be replaced by the word for the colour, as per TonyM’s reply.

TonyM, thank you for that.

Mohammad, <mark>text</mark> works well and is the simplest. The default colour setting is yellow, so if one wants a different colour Mat’s/TonyM’s syntax would be required.

mark tag also lets you to set properties like below

<mark style="background:bisque;">Hi</mark>


By the if you can use macro as I wrote above, macro is the simplest! like below

\define h(txt, color:#FF9) <mark style="background:$color$>$txt$</mark>



Then these are valid

<<h Hi>>


or 

<<h Hi bisque>>


 

Many thanks guys.


On 2020-Apr-10, at 03:42, TonyM <anthon...@gmail.com> wrote:

background-color:yellow;  Text@@

Klaas Vaak

unread,
Apr 10, 2020, 1:46:54 AM4/10/20
to tiddl...@googlegroups.com
Thanks for that additional input, Mohammad.

Where would I have to put the macro code? In each tiddler text box?

On 2020-Apr-10, at 07:55, Mohammad <mohammad...@gmail.com> wrote:



On Friday, April 10, 2020 at 8:46:07 AM UTC+4:30, Klaas Vaak wrote:
Mat, thanks, @@background:#FF9; text@@ works, although the hex value can also be replaced by the word for the colour, as per TonyM’s reply.

TonyM, thank you for that.

Mohammad, <mark>text</mark> works well and is the simplest. The default colour setting is yellow, so if one wants a different colour Mat’s/TonyM’s syntax would be required.

mark tag is also let you to set properties like below

<mark style="background:bisque;">Hi</mark>


By the if you can use macro as I wrote above, macro is the simplest! like below
\define h(txt, color:#FF9) <mark style="background:$color$>$txt$</mark>

Then these are valid

<<h Hi>>


or 

<<h Hi bisque>>


 

Many thanks guys.


On 2020-Apr-10, at 03:42, TonyM <anthon...@gmail.com> wrote:

background-color:yellow;  Text@@

--
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.

Mohammad

unread,
Apr 10, 2020, 3:13:41 AM4/10/20
to TiddlyWiki
You can create a new tiddler like

title: whatever you like e.g.  mymacros
tag: $:/tags/Macro
text:

\define h(txt, color:#FF9) <mark style="background:$color$>$txt$</mark>

save it. This is then called a global macro and you can call it everywhere you like

You can add more macros to above tiddler.

I may recommend to have a look at https://kookma.github.io/TW-Shiraz/

and specially this part:

Good luck
Mohammad




On Friday, April 10, 2020 at 10:16:54 AM UTC+4:30, Klaas Vaak wrote:
Thanks for that additional input, Mohammad.

Where would I have to put the macro code? In each tiddler text box?
On 2020-Apr-10, at 07:55, Mohammad <mohamma...@gmail.com> wrote:



On Friday, April 10, 2020 at 8:46:07 AM UTC+4:30, Klaas Vaak wrote:
Mat, thanks, @@background:#FF9; text@@ works, although the hex value can also be replaced by the word for the colour, as per TonyM’s reply.

TonyM, thank you for that.

Mohammad, <mark>text</mark> works well and is the simplest. The default colour setting is yellow, so if one wants a different colour Mat’s/TonyM’s syntax would be required.

mark tag is also let you to set properties like below

<mark style="background:bisque;">Hi</mark>


By the if you can use macro as I wrote above, macro is the simplest! like below
\define h(txt, color:#FF9) <mark style="background:$color$>$txt$</mark>

Then these are valid

<<h Hi>>


or 

<<h Hi bisque>>


 

Many thanks guys.


On 2020-Apr-10, at 03:42, TonyM <anthon...@gmail.com> wrote:

background-color:yellow;  Text@@


--
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 tiddl...@googlegroups.com.

Klaas Vaak

unread,
Apr 10, 2020, 4:26:12 AM4/10/20
to tiddl...@googlegroups.com
Thanks a lot Mohammad :-)))

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/d4e76361-dec5-40a4-9edc-fc3dbd542e93%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages