How do I indent?

2,920 views
Skip to first unread message

philosopherhobbs

unread,
Feb 27, 2017, 12:23:43 AM2/27/17
to TiddlyWiki
Greetings,

I'm new to tiddlywiki and enjoying it for the most part, but I can't for the life of me find a way to insert spaces or indentation into a tiddler. Is there a straight-forward way to do this? If not, why? Isn't indentation a basic function of anything involving typing?

I have found on wikiMatrix the supposed syntax for indenting some text but it doesn't work. It lists ':indent' but it doesn't do anything so far as I can tell. The command for quotes and block quotes add unnecessary fluff to indentation. Why does TiddlyWiki have a pseudomethod of indentation that adds a bar when indentation is all that is needed for quotes and to do...normal indentation stuff.

Truly puzzled about this. TiddlyWiki added easy ways to italicize, underline, etc. Isn't indentation just as important in word processors as those functions? It provides an easy way to space things.

Thanks for any help!

Mat

unread,
Feb 27, 2017, 1:39:41 AM2/27/17
to TiddlyWiki
Many ways.

Most direct is probably to use so called definition lists - basically just write a ":" before the line.

Other options include writing multiple   to get a no-break-space character.

You could probably also insert a  <div style="width:3em;"></div> ...or with a margin-left:3em;

etc etc

<:-)

PMario

unread,
Feb 27, 2017, 3:22:14 AM2/27/17
to TiddlyWiki

Ton Gerner

unread,
Feb 27, 2017, 6:26:02 AM2/27/17
to TiddlyWiki
Hi,

Stephen Kimmel made an editor toolbar button for it, see http://skplugins.tiddlyspot.com/#Indent

Cheers,

Ton

philosopherhobbs

unread,
Feb 27, 2017, 11:18:09 AM2/27/17
to tiddl...@googlegroups.com
The &nbsp; works even though it's hard to read for later editing. The ":" just shows up as text on the other side. Finally, <div style="margin-left:1em> </div> works well but again isn't very readable for later editing. 

I'm not sure why : doesn't do anything. Maybe I'm supposed to do something else to enable it? At the very least, even if the solutions you gave aren't super readable, they work perfectly! Thanks!

philosopherhobbs

unread,
Feb 27, 2017, 11:42:31 AM2/27/17
to TiddlyWiki
PMario, can't get this solution to work and it would be the most elegant/readable one I've found. Created the tiddler and tagged it but I'm not sure what I'm tagging. So far as I know, I have no tiddler named Stylesheet (again, I'm new to tiddlyWiki so it may be hidden somewhere I'm unaware of or maybe I'm supposed to create it).

Is the syntax such that I just type *.x before the text I want to indent once and that should do it?

Thanks for your help!

PMario

unread,
Feb 27, 2017, 12:32:12 PM2/27/17
to TiddlyWiki
Hi,

It's basically defining a new visual representation for the standard unordered list element [1]: it removes the bullet points. Just uses the indent settings:

Create a tiddler eg: myStyles and tag it $:/tags/Stylesheet

.x li,
li.x{
  list-style-type: none;
  padding-left: 0;
}


---------------------------------

The above code is a CSS definition, that defines a new CSS class [2] selector named x
It can be any name, but I wanted to have a short one.  

Now you can use the following syntax:

*.x indent 1
**.x indent 2

If you put this little example into a tiddler, it creates this output:

  • indent 1
    • indent 2

Once the stylesheet is active it removes the bullets. .. That's it.

There is a second way to define a bigger block of text, where the rule should be active. Like this:

@@.x
* asdf asdf
** asdfasdfasdf
@@

The example text above uses the TW advanced feature, to apply custom styles and classes [3]. As you see, we redefined the list element between @@.x and @@. So depending on your usecase you may use both of them. ... You'll find out, when to use them ;)

hope that helps

have fun!
mario

[1] http://tiddlywiki.com/#Lists%20in%20WikiText
[2] https://developer.mozilla.org/en-US/docs/Web/CSS/Class_selectors
[3] http://tiddlywiki.com/#Styles%20and%20Classes%20in%20WikiText

PMario

unread,
Feb 27, 2017, 12:37:37 PM2/27/17
to TiddlyWiki
On Monday, February 27, 2017 at 5:42:31 PM UTC+1, philosopherhobbs wrote:

Is the syntax such that I just type *.x before the text I want to indent once and that should do it?

Right. If you use

**.x you'll indent to level 2 and so on.

There's also the reason why I did use x as a class name. It's short and fast to type. you could use i or indent ... indent if you find it easier. eg:

*.indent .. but more to type :)

-m

Mat

unread,
Feb 28, 2017, 4:58:29 PM2/28/17
to TiddlyWiki
@philosopherhobbs


>The ":" just shows up as text on the other side.

You need to include an empty line before the fist use of it, e.g

:like this (note the empty line before it)
:and this line is also indented because it has that first indented line above it

You can also use "quoting" variant, i.e

>like this
>and this

...or

<<<
this paragraph is in a quote

and this too
<<<


<:-)

philosopherhobbs

unread,
Feb 28, 2017, 5:18:49 PM2/28/17
to tiddl...@googlegroups.com
@PMario

Ok, so I saved and restarted tiddlywiki and this method will work on a new sheet but not on the old sheet I was originally working with. It seems it has something to do with the brackets I'm using or with forcing a line break. Basically, I'm taking notes for computer science. We all have to use a certain style with our conditionals and loops. What I'm trying to produce is something like this:

if (whatever)
   {
      Do stuff;
   }
   else
      {
         Do other stuff;
      }

To do that I am using <br> to force a line break like so:

if (whatever) <br>
*.x { <br>
and so on...

But something seems to be messing with the indentation using *.x followed by a '{' as this just produces the following:

if (whatever)
*.x {

Any ideas?

Thanks again!

philosopherhobbs

unread,
Feb 28, 2017, 5:23:40 PM2/28/17
to tiddl...@googlegroups.com
@Mat

Ah, then that introduces a space in my notes that I don't want to have as I'm trying to make something that looks like this:

while (something)
   {
      Do stuff;
   }

Instead, I get this:

while (something)

   {

      Do stuff;

   }

If there's a quick fix, let me know because a single colon is pretty elegant looking! So far &nbsp; has worked the best as crazy as it looks.

Mat

unread,
Feb 28, 2017, 5:56:57 PM2/28/17
to TiddlyWiki
@philosopherhobbs

If it is just non-formatted text, then you can simply use codeblocks. E.g

```
while (something)
   {
      Do stuff;
   }
```

<:-)

philosopherhobbs

unread,
Feb 28, 2017, 11:45:23 PM2/28/17
to tiddl...@googlegroups.com
PMario, it seems I figured it out. There must, for some reason that seems strange to me, be an empty line above the *.x. I never noticed this with lists before. Now, once the first empty line is in there, I can use your method to indent until my heart is content and it doesn't introduce extra line breaks like the method above with a ':'.

I'm pretty happy with this method but I will also try out the plugin mentioned above soon.

Thanks for all the help!

Edit: actually it doesn't always work. This method doesn't help when I want to indent in the middle of some text.


On Monday, February 27, 2017 at 11:37:37 AM UTC-6, PMario wrote:

PMario

unread,
Mar 1, 2017, 8:12:18 AM3/1/17
to TiddlyWiki
On Tuesday, February 28, 2017 at 11:18:49 PM UTC+1, philosopherhobbs wrote:
if (whatever)
   {
      Do stuff;
   }
   else
      {
         Do other stuff;
      }


Oh, It's not intended to be used that way. It will make your life much harder, at it should be :)

Why don't you use:

```

if (whatever)
  {
    Do stuff;
  }
else
  {
    Do other stuff;
  }
```

Which is the right way to show program code.

-m

philosopherhobbs

unread,
Mar 2, 2017, 12:52:05 PM3/2/17
to TiddlyWiki
That's what I've ended up going with. I guess there's not many other contexts where you would need to have similar indentation needs and be bothered by the change in font and whatnot.

Thanks again!
Reply all
Reply to author
Forward
0 new messages