Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2010-06-07 21:24:29

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Re: [textile] Definition lists in Textile

Yes. If you check out the latest SVN build…

Thanks Stef!


At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

#26 2010-06-08 08:05:26

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: [textile] Definition lists in Textile

Nice work :)

Offline

#27 2010-06-08 17:01:36

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: [textile] Definition lists in Textile

Thanks Stef ! I love definition lists :)

Offline

#28 2010-06-08 18:54:17

Christopher
Member
From: T.O.
Registered: 2004-05-27
Posts: 42
Website

Re: [textile] Definition lists in Textile

Saw the svn commit for this go through and just wanted to say: Awesome! Nice work.

Offline

#29 2010-06-17 19:46:14

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: [textile] Definition lists in Textile

hi is there a reason why the below code doesn’t render the textile for the link?:

<dd>"www.ostanlochaltan.com":http://www.ostanlochaltan.com</dd>

where as this does but adds a break?:

<dd>
"www.ostanlochaltan.com":http://www.ostanlochaltan.com
</dd>

Code display -Gocom

Last edited by Gocom (2010-06-17 20:08:45)


its a bad hen that wont scratch itself.
photogallery

Offline

#30 2010-06-17 20:06:19

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] Definition lists in Textile

kvnmcwebn wrote:

hi is there a reason why the below code doesn’t render the textile for the link?:
<dd>www.ostanlochaltan.com;

Because Textile’s parser tries to validate the output by checking if the markup indeed should generate a link. For example it tries to avoid accidently turning words into links.

Anway, if you break the single word into parts, it will turn the link into link. An append or prepeding space should be enough:

<dd>"www.ostanlochaltan.com":http://www.ostanlochaltan.com </dd>

If not, then both:

<dd> "www.ostanlochaltan.com":http://www.ostanlochaltan.com </dd>

Or if you are using r3359 (or newer):

; Term
: "www.ostanlochaltan.com":http://www.ostanlochaltan.com

where as this does but adds a break?

Because Textile turns line breaks into HTML line breaks.

Offline

#31 2010-06-17 20:28:47

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: [textile] Definition lists in Textile

hi gocom,
thanks for breaking that down and editing my post. Unfortunately if i add a space after the opening dd tag or before the closing it still adds a line break. Also i’m using r3275 and have just finished formatting a dozen articles with the dd tag so am going to use the html for now
-kevin


its a bad hen that wont scratch itself.
photogallery

Offline

#32 2010-06-19 21:47:31

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: [textile] Definition lists in Textile

Just fyi for you guys that are working on this i replaced classTextile.php and got this error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /nfs/c01/h05/mnt/34978/domains/trabansligo.ie/html/textpattern/lib/classTextile.php on line 198

its a bad hen that wont scratch itself.
photogallery

Offline

#33 2010-06-19 22:21:15

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] Definition lists in Textile

kvnmcwebn wrote:

Just fyi for you guys that are working on this i replaced classTextile.php and got this error:

Kevin, you shouldn’t be getting that. The r3359 classTextile.php works perfectly fine. It must be the way you are trying to save/download the revision.

My guess is that you are copying the raw code, and trying to save it with an editor (or browser) that automatically converts entities and quotes. If you are trying to save (or modify) the r3359’s classtextile/lib/classTextile.php with such editor that automatically converts quotes or entities, that is the problem and you need to use something else to transfer it. The file itself in the SVN is fine.

Hope that helps you to find the source of the trouble.

Offline

#34 2010-08-30 15:32:37

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: [textile] Definition lists in Textile

Bloke schrieb:

Definition lists are go.

Much thanks, Bloke for add the dl-list!
Its work! :-)

One point I’ve a little problems with dl-list:
If I wish to have a ul-list inside <dd>:

Textile

; Term
: Definition-first sentence, then ul:
* first line,
* second line and
* third line.
(last entry dl-list)

Output:

<dt>Term</dt>
<dd>Definition-first sentence, then ul:</dd>
	<ul>
		<li>first line,</li>
		<li>second line and</li>
		<li>third line.</li>
	</ul>
	</dl>

Thats not very valide code. How I can add inside dd a ul-list?

(: * first line, does’nt work)

Offline

#35 2010-08-31 08:42:21

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,270
Website GitHub

Re: [textile] Definition lists in Textile

lythande wrote:

How I can add inside dd a ul-list?

Short answer (as far as I can tell) is that you can’t. Textile is a markup helper language not a markup replacement. Although putting ol or ul tags inside a dl structure is valid, Textile isn’t geared up for that kind of usage. In the same way that in HTML you can put ul tags inside an ol, Textile cannot because it relies on the marker being the first character on the line.

So, unfortunately, under these specific circumstances, the only thing you can do is to put the HTML in yourself, manually.

Alternatively, if you really want to use Textile and don’t mind a bit of mucking about you can do something like this:

  <txp:variable name="inner_list">
* first line,
* second line and
* third line

  </txp:variable>

; term
: Definition-first sentence, then ul
: <txp:variable name="inner_list" />
: another definition

It’s ugly but it works. Note the spaces before the txp:variable tags to stop textile from wrapping <p> tags around them, and the newline after the list to tell Textile to ‘finish the list off’ properly.

Last edited by Bloke (2010-08-31 08:43:09)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#36 2010-08-31 17:20:37

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: [textile] Definition lists in Textile

Bloke schrieb:

It’s ugly but it works.

Thats very nice, much thanks!!!

Edit:

 <txp:variable name="inner_list">
* first line,
* second line and
* third line

  </txp:variable>

; Term
: Definition-first sentence, then ul <txp:variable name="inner_list" />

will result in:

<dt>Term</dt>
<dd>Definition-first sentence, then ul:
	<ul>
		<li>first line,</li>
		<li>second line and</li>
		<li>third line.</li>
	</ul>
</dd>
</dl>

works too and thats excactly, what I need

Thanks to Bloke, now I’ve updating my files for dl-list with <abbr>-code instead <acronym>-code and actualized my txt_article.php for get the new description for dl-list in Textile-Help in “Writing” a new article.

Last edited by lythande (2010-09-01 00:03:22)

Offline

Board footer

Powered by FluxBB