disable wiki formatting in a style

419 views
Skip to first unread message

f7o7

unread,
Jan 15, 2007, 3:05:56 AM1/15/07
to TiddlyWiki
I created a style that mimics the terminal window output, and would
like to turn off the wiki formatting inside it. How do I do that?
{{{...}}} doesn't work as it has the style of it's own, so it results
in another box inside the "terminal" box.

{{terminal{
-rw-r--r-- 1 root root 2556 Jan 14 03:09 /tmp/slimserver.log
}}}

Thanks.

Eric Shulman

unread,
Jan 15, 2007, 4:27:05 AM1/15/07
to TiddlyWiki
> I created a style that mimics the terminal window output, and would
> like to turn off the wiki formatting inside it. How do I do that?

you can use """...""" (tripled double-quotes) or <nowiki>...</nowiki>
surrounding the desired content

{{terminal{"""
-rw-r--r-- 1 root root 2556 Jan 14 03:09 /tmp/slimserver.log
"""}}}

should do the trick...

-e
Eric Shulman
TiddlyTools / ELS Design Studios

Jeremy Ruston

unread,
Jan 15, 2007, 5:28:41 AM1/15/07
to Tiddl...@googlegroups.com
I'm not sure if I've understood but, perhaps another approach is that
you could just remove the box around the {{{formatted text}} by
putting an entry like this in your StyleSheet tiddler:

.viewer pre {
background-color: [[ColorPalette::Background]];
color: [[ColorPalette::Foreground]];
border: none;
}

Cheers

Jeremy


--
Jeremy Ruston
mailto:jer...@osmosoft.com
http://www.tiddlywiki.com

f7o7

unread,
Jan 15, 2007, 11:04:17 PM1/15/07
to TiddlyWiki
Thanks a lot, guys. Yes, you understood, but I want to keep the two
styles of boxes.
""" and <nowiki> both do the trick. Ideally though I would like to set
it up so that ".terminal" implies nowiki.

I try to take the RTFM approach whenever I can, but I just can't find
the complete FM on TiddlyWiki anywhere, only bits and tiddlers here and
there :). I'm a newb when it comes to the web, but it looks like
TiddlyWiki is going to change that soon. It's a toy, not unlike Lego!
Right now I'm at the stage where I play with it a lot more than use it.

f7o7

unread,
Jan 17, 2007, 6:15:50 PM1/17/07
to TiddlyWiki
> you can use """...""" (tripled double-quotes) or <nowiki>...</nowiki>
> surrounding the desired content
>
> {{terminal{"""
> -rw-r--r-- 1 root root 2556 Jan 14 03:09 /tmp/slimserver.log
> """}}}
>
> should do the trick...

How to modify TW so that anything inside a {{terminal{...}}} is treated
as nowiki by default?
Thanks for your help.

Daniel Baird

unread,
Jan 17, 2007, 6:47:54 PM1/17/07
to Tiddl...@googlegroups.com
If you know a bit of JavaScript you can search the code for the
formatters array:

// ---------------------------------------------------------------------------
// Standard formatters
// ---------------------------------------------------------------------------------

config.formatters = [

..there's two formatters you want to look at, the monospace with css one:
name: "monospacedByLineForCSS",

and the raw text one:
name: "rawText",

You should be able to work it out from there. Once you know what to
do, write it into a plugin that replaces the necessary element in
config.formatters -- and welcome to the world of TiddlyWiki
development!

;Daniel


--
Daniel Baird
http://tiddlyspot.com (free, effortless TiddlyWiki hosting)
http://danielbaird.com (TiddlyW;nks! :: Whiteboard Koala :: Blog ::
Things That Suck)

f7o7

unread,
Jan 17, 2007, 7:07:16 PM1/17/07
to TiddlyWiki
Wow! Thanks for ushering and giving me such a huge credit! I'm afraid
I'm far from there yet. But I love tweaking my TW and wish I could have
more time for that :)

Daniel Baird

unread,
Jan 17, 2007, 7:15:40 PM1/17/07
to Tiddl...@googlegroups.com
Actually an easier way to do it might be to invent a new syntax, like
===== at the top and bottom or something, and write your own entirely
new entry in config.formatters -- you could pretty much copy the one
for {{{ except wrap it in <div class="terminal">.

Any takers? I think there'd be a fair few folk who'd like to have a
special escape for terminal type output -- programming tutorials,
command line references, TiddlyWiki formatting tutorials..

;D

PS Maybe something shell-like would be cool: perhaps $> as a line
format or something.

On 18/01/07, f7o7 <ewi...@gmail.com> wrote:
>

f7o7

unread,
Jan 17, 2007, 7:31:18 PM1/17/07
to TiddlyWiki
My other hobbies are running OpenWRT on my router and Slimserver on a
dedicated command-line-only linux box. I'm documenting my progress in
TW, so I invented this style to distinguish between what I'm entering
in the command line and what I get as an output. I find it much more
visual that way.

f7o7

unread,
Jan 17, 2007, 7:46:51 PM1/17/07
to TiddlyWiki
Could you clue me in on how to add such functionality to a TW once so
that it is there after I've upgraded the base? The first time around I
was just opening my TW file and modifying the source. I lost all of
that while upgrading to 2.1.3 and feel a bit discouraged now.

Daniel Baird

unread,
Jan 17, 2007, 8:48:37 PM1/17/07
to Tiddl...@googlegroups.com
Actually it'd nice to have a couple of styles, one for system output
and one for user input. Line formatters like !! for headings might be
easier to use.. so you could type in a tiddler:
$> ls
..and that gets rendered like the user is typing it, and then:
=> .
=> ..
=> .camelpr0n
=> tiddlywikistuff
=> VistaSourceCode

..and that gets rendered like the system responded it.

It's such a good idea i might look at it myself..

;Daniel

On 18/01/07, f7o7 <ewi...@gmail.com> wrote:
>

Daniel Baird

unread,
Jan 17, 2007, 9:00:10 PM1/17/07
to Tiddl...@googlegroups.com
You can write javascript into a tiddler, tag it with "systemConfig",
and it will be executed by TiddlyWiki when the TW is loaded. That's
all a plugin is.

So if you just write code that modifies the TiddlyWiki system objects,
then put it in a tiddler, it survives upgrades just like your other
tiddlers.

Tempted to write a plugin now? :)

;Daniel

On 18/01/07, f7o7 <ewi...@gmail.com> wrote:
>

Reply all
Reply to author
Forward
0 new messages