Wiki Syntax for indenting a paragraph
Forum » Wikidot features and bugs / New features and ideas » Wiki Syntax for indenting a paragraph
Started by: BrigandBrigand
On: 1248866692|%e %b %Y, %H:%M %Z|agohover
Number of posts: 17
rss icon RSS: New posts
Summary:
Create a new, simple one character syntax to allow users to indent a paragraph selectively.
Wiki Syntax for indenting a paragraph
BrigandBrigand 1248866692|%e %b %Y, %H:%M %Z|agohover

I would like easy to use, simple syntax for indenting a paragraph that can be customized via CSS templates. I suggest using the ^ character to implement this syntax. It is currently not being used for anything by itself.

^ This paragraph would be indented, say a minimum of 5 em.

This paragraph would not be indented.


The Chronicles of Heaven's Gate
A 4th edition Dungeons & Dragons campaign setting.

unfold Wiki Syntax for indenting a paragraph by BrigandBrigand, 1248866692|%e %b %Y, %H:%M %Z|agohover
Re: Wiki Syntax for indenting a paragraph
BrigandBrigand 1249065183|%e %b %Y, %H:%M %Z|agohover

Please?


The Chronicles of Heaven's Gate
A 4th edition Dungeons & Dragons campaign setting.

unfold Re: Wiki Syntax for indenting a paragraph by BrigandBrigand, 1249065183|%e %b %Y, %H:%M %Z|agohover
Re: Wiki Syntax for indenting a paragraph
pieterhpieterh 1249066445|%e %b %Y, %H:%M %Z|agohover

There is no simple answer.

Changing the wiki syntax is a low priority: it can happen, but not immediately.

Try either of these workarounds:

[[div style="text-indent:20px"]]
Your indented paragraph here.
[[/div]]

Your indented paragraph here.

Or

##white|___##Your indented paragraph here.

___Your indented paragraph here.

unfold Re: Wiki Syntax for indenting a paragraph by pieterhpieterh, 1249066445|%e %b %Y, %H:%M %Z|agohover
Re: Wiki Syntax for indenting a paragraph
RobElliottRobElliott 1249067227|%e %b %Y, %H:%M %Z|agohover

Using CSS templates seems like a lot of work for something that is very easy to do either in your custom theme or in a div on your page.

1) CSS:

Just add the following to your custom CSS:

p {
    text-indent:25px;
}

This will indent the text for all paragraphs throughout your site.

2) Div:

If you only want it on selected paragraphs and therefore have more flexibility, use a div like this:

[[div style="text-indent: 25px;"]]
Donec viverra nibh sed.. .. etc
[[/div]]

which gives you:

Donec viverra nibh sed lectus sagittis ut tincidunt nulla egestas. Suspendisse ac tortor eget ligula consectetur ultricies et tincidunt nunc. Curabitur interdum consequat quam. Sed sagittis mi id ipsum dapibus faucibus. Praesent tempus rutrum lectus, gravida placerat ante malesuada molestie. Integer quis nulla ut sapien ullamcorper consequat. Nullam auctor erat sit amet massa pharetra hendrerit. Aenean accumsan posuere sodales. Ut aliquet congue convallis. Suspendisse potenti. Curabitur sit amet euismod orci. Quisque quis augue id magna tincidunt gravida.

Ut eget lacus vel dui elementum pellentesque. Etiam rutrum scelerisque diam. Integer in ante ullamcorper massa semper tempus vitae sed purus. Etiam rutrum blandit faucibus. Pellentesque id dui libero, eu sollicitudin velit. Cras posuere ultrices ultrices. Aliquam ornare suscipit purus, vitae convallis nunc egestas in. Vivamus vel ipsum urna, et lacinia eros. Nam ultrices pharetra quam vitae rutrum. Mauris cursus mauris at sem tempus egestas.

Vivamus et lectus tortor. Praesent tortor nibh, interdum interdum vehicula nec, molestie ultrices odio. Suspendisse urna lacus, molestie varius malesuada quis, fermentum ut dui. Etiam non erat eu leo vestibulum ultrices sed tristique nisl. Donec sit amet mi risus. Fusce vestibulum ipsum nec orci congue quis pretium urna semper. Aliquam sed sem vel sapien porttitor pretium a non justo. Curabitur in dui lectus, eu molestie sem. Sed sed erat nisl. Maecenas vel adipiscing tortor.

Rob


ad5.png
last edited on 1249067403|%e %b %Y, %H:%M %Z|agohover by RobElliott + show more
unfold Re: Wiki Syntax for indenting a paragraph by RobElliottRobElliott, 1249067227|%e %b %Y, %H:%M %Z|agohover
Re: Wiki Syntax for indenting a paragraph
BrigandBrigand 1249130202|%e %b %Y, %H:%M %Z|agohover

Using CSS to redefine paragraphs is not a valid option for me, because I will type lists without the * or + syntax in front of them and it indents all those as well. Using div's around every paragraph is not an option either because one, I'm lazy, and two… it's a lot of typing for little benefit. That's why I would love to have ^ as simple syntax for indenting paragraphs.


The Chronicles of Heaven's Gate
A 4th edition Dungeons & Dragons campaign setting.

unfold Re: Wiki Syntax for indenting a paragraph by BrigandBrigand, 1249130202|%e %b %Y, %H:%M %Z|agohover
Re: Wiki Syntax for indenting a paragraph
RobElliottRobElliott 1249130645|%e %b %Y, %H:%M %Z|agohover

Using div's around every paragraph is not an option either because one, I'm lazy, and two… it's a lot of typing for little benefit.

You put the div round the whole text, not each paragraph. It's 2 lines only that you've got to type!

Rob


ad5.png
last edited on 1249130981|%e %b %Y, %H:%M %Z|agohover by RobElliott + show more
unfold Re: Wiki Syntax for indenting a paragraph by RobElliottRobElliott, 1249130645|%e %b %Y, %H:%M %Z|agohover
Re: Wiki Syntax for indenting a paragraph
pieterhpieterh 1249131035|%e %b %Y, %H:%M %Z|agohover

Personally I think "lazy" is a pretty good argument. Here's something that could be fun, do it once in the CSS and then it works automatically.

From http://www.w3.org/Style/Examples/007/indent

p {
    margin-bottom: 0 
}
p + p {
    text-indent: 1.5em;
    margin-top: 0 
}
unfold Re: Wiki Syntax for indenting a paragraph by pieterhpieterh, 1249131035|%e %b %Y, %H:%M %Z|agohover
Re: Wiki Syntax for indenting a paragraph
BrigandBrigand 1249149964|%e %b %Y, %H:%M %Z|agohover

I have pages where I mix paragraphs with lists without bullets or simple numbering and it's easier to just selectively pick which paragraphs to indent. I ended up re-defining h1 header and am using +* to indent paragraphs. It's not one character, but it's better than typing divs around everything.

Have to use the * to prevent the header from showing up in the TOC, unless there's another way to use CSS to prevent that. In the end, this workaround works, but it's messy and causes problems with TOC's… so I'd still like ^ added as an indent syntax.

Edit - I would have to have 21 paragraphs on a single page before the number of keystrokes before the +* solutions equals the [[div…. solution. =)


The Chronicles of Heaven's Gate
A 4th edition Dungeons & Dragons campaign setting.

last edited on 1249150352|%e %b %Y, %H:%M %Z|agohover by Brigand + show more
unfold Re: Wiki Syntax for indenting a paragraph by BrigandBrigand, 1249149964|%e %b %Y, %H:%M %Z|agohover
Re: Wiki Syntax for indenting a paragraph
KynanKynan 1250342087|%e %b %Y, %H:%M %Z|agohover

Come to think of it, if you don't use block quotes, you could redefine that style to do what you want with a simple leading "> ". Or you could hijack the style used for notes, but that syntax requires wrapping in "[[note]]...[[/note]]".

BTW, even if I used the [[div]] method, I would do it using "class=NAME" rather than a raw style, and define the style in CSS. Much more configurable if you decide to change the appearance a bit later.

And while I'm at it, I wish [[span]] took a class= attribute….

last edited on 1250342361|%e %b %Y, %H:%M %Z|agohover by Kynan + show more
unfold Re: Wiki Syntax for indenting a paragraph by KynanKynan, 1250342087|%e %b %Y, %H:%M %Z|agohover
Re: Wiki Syntax for indenting a paragraph
James KanjoJames Kanjo 1250414277|%e %b %Y, %H:%M %Z|agohover

Come to think of it, if you don't use block quotes, you could redefine that style to do what you want with a simple leading "> ". Or you could hijack the style used for notes, but that syntax requires wrapping in "[[note]]…[[/note]]".

You're a genius! You set the challenge, and I accept:

blockquote {
    margin: 0;
    border: none;
    padding: 0;
    background-color: transparent;
}
blockquote p {
    margin: 0;
    text-indent: 3em;
}
blockquote p + p {
    margin: 1em 0 0;
}

So that will turn blockquotes into normal text but with indents. So this code:

> Kynan is awesome!

Will render:

Kynan is awesome!


@ Pieter

p + p {

OMG! I had no idea you could do that in CSS! This opens a whole world of possibilities! Is it compatible with all browsers? Do you have a link to some documentation on the subject? I tried Googling “add html elements in css”, but that rendered silly results.

And while I'm at it, I wish [[span]] took a class= attribute…

Umm, it does. [[span class="name"]]


λ James Kanjo | blog | photos | contact

unfold Re: Wiki Syntax for indenting a paragraph by James KanjoJames Kanjo, 1250414277|%e %b %Y, %H:%M %Z|agohover
Re: Wiki Syntax for indenting a paragraph
RobElliottRobElliott 1250415052|%e %b %Y, %H:%M %Z|agohover

Is it compatible with all browsers?

Yes, although not IE6 and below.

Do you have a link to some documentation on the subject? I tried Googling “add html elements in css”, but that rendered silly results.

Just do a google search for adjacent sibling selector for that is what it is called.

Rob


ad5.png
unfold Re: Wiki Syntax for indenting a paragraph by RobElliottRobElliott, 1250415052|%e %b %Y, %H:%M %Z|agohover
Re: Wiki Syntax for indenting a paragraph
Ed JohnsonEd Johnson 1250435589|%e %b %Y, %H:%M %Z|agohover

James,

I found this site to be really useful, especially the section on CSS Selectors:
http://css.maxdesign.com.au/selectutorial/

-Ed

unfold Re: Wiki Syntax for indenting a paragraph by Ed JohnsonEd Johnson, 1250435589|%e %b %Y, %H:%M %Z|agohover
Re: Wiki Syntax for indenting a paragraph
KynanKynan 1250435722|%e %b %Y, %H:%M %Z|agohover

I tried using a class= with [[span]] once (a long time ago) and it didn't work. And since it wasn't documented in the help, I thought it hadn't changed. I tried it though, and yup, it works now. So either I did something wrong a long time ago, or it got silently added. In any case, great!

unfold Re: Wiki Syntax for indenting a paragraph by KynanKynan, 1250435722|%e %b %Y, %H:%M %Z|agohover
Re: Wiki Syntax for indenting a paragraph
pieterhpieterh 1250019398|%e %b %Y, %H:%M %Z|agohover

  Brigand, your question was really quite fun.

  It took me a while to find this particular solution, which I'm using here.

  It is simple. There are no divs, no changes needed to Wikidot, no other hacks.

   You can indent paragraphs as far as you like.

  It works with any stylesheets.

  It works immediately and requires just that you type the indent.

  Are you interested? If so, əɔɐdsɯə ɹo '3002+n əɔɐds əpoɔıun ɐ s,ʇı1

  To use, just copy and paste this code and remove or add spaces at the start using your editor's copy/paste functions. :-)

last edited on 1250019519|%e %b %Y, %H:%M %Z|agohover by pieterh + show more
unfold Re: Wiki Syntax for indenting a paragraph by pieterhpieterh, 1250019398|%e %b %Y, %H:%M %Z|agohover
Re: Wiki Syntax for indenting a paragraph
ErichSteinboeckErichSteinboeck 1250020657|%e %b %Y, %H:%M %Z|agohover

> Unicode U+2003

Pieter, this reminds me of a post by someone back in late 2006 asking “A related thing, how can I enter a non-breaking space?”

And me getting into that same thread a year later asking “Can we please have a solution for
the non-breaking space ( ), or better all HTML &xxx; variables?”

Can we get that maybe now?

P.S. How do you generate that upside-down stuff?

unfold Re: Wiki Syntax for indenting a paragraph by ErichSteinboeckErichSteinboeck, 1250020657|%e %b %Y, %H:%M %Z|agohover
Re: Wiki Syntax for indenting a paragraph
pieterhpieterh 1250070708|%e %b %Y, %H:%M %Z|agohover

A solution for all &xxx variables should be doable. Personally, I just copy/paste but it's a bit evil.

Search for "upside down text", that should do it. It's Unicode, btw, someone even more evil than me discovered that there are characters in random alphabets that just almost look like upside down Latin characters. See http://en.wikipedia.org/wiki/Transformation_of_text

unfold Re: Wiki Syntax for indenting a paragraph by pieterhpieterh, 1250070708|%e %b %Y, %H:%M %Z|agohover
Re: Wiki Syntax for indenting a paragraph
BrigandBrigand 1254746280|%e %b %Y, %H:%M %Z|agohover

Using non-breaking spaces and copy/pasting will work, but it's inelegant. For now, I've altered the h1 heading via css to include an indent, so it's only one character + to indent a paragraph, unless I'm using the TOC module, and then I just have to use +* to avoid each paragraph showing up in the TOC. I'd still like to have ^ as a dedicated indent syntax that you can alter the size of the indent through css.


The Chronicles of Heaven's Gate
A 4th edition Dungeons & Dragons campaign setting.

unfold Re: Wiki Syntax for indenting a paragraph by BrigandBrigand, 1254746280|%e %b %Y, %H:%M %Z|agohover
New post

Bookmark and Share

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.