Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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: 12,440
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.

Hire 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

#37 2011-01-04 22:23:22

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

Re: [textile] Definition lists in Textile

Hi Stef/everyone,

It was great to read that definition lists are now supported by textile.

I’m using one for the first time properly and wonder if I have a case of trying to do too much and should be using HTML, or, if there is a neat step I am missing to allow me to keep using textile.

Ideally I want multiple <P> tags in a DD.

;(class#id) My DT is here
: Para No.1 of my first DD is here
? I'd like para No.2 of my first DD to be here

Am I missing some clever way to do this, or, should I switch to HTML as I am going beyond the scope of how the textile DL implementation currently works?

Thanks lots in advance, cheers, -ALan


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

#38 2011-01-04 22:33:09

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,440
Website GitHub

Re: [textile] Definition lists in Textile

alanfluff wrote:

Ideally I want multiple <P> tags in a DD.

Hmmm, it’s kind of outside the scope of Textile’s ‘simple’ definition lists but if you wanted to cheat you could employ a similar technique to the one presented a post above yours:

  <txp:variable name="dd1">

First para of the first lorem ipsum...

dolor seti whatnot this is paragraph 2.

  </txp:variable>

; Term
: <txp:variable name="dd1" />
: Another definition here, or a second txp:var if you wish

Just depends if you like defining your paragraph content above the place you’re going to use them in the def list. If not, raw HTML will work.


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#39 2011-01-04 22:37:11

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

Re: [textile] Definition lists in Textile

Gotchya, thanks.

Glad it wasn’t me being daft and missing some other way of doing that. Will either employ that or go to HTML.

Cheers, -Alan


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

#40 2011-06-26 10:09:47

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

Re: [textile] Definition lists in Textile

Now I written a new article Das <abbr/> – Eine classTextile.php-Erweiterung (in german at moment, but the english came back soon!) for install the extensions in file classTextile.php

New:
  • without dl-list (is since TXP v4.3.0 installed)
  • <abbr> instead <acronym>
  • lower case in the abbreviations: now you can writing AbC()!
  • you can install what do you want!

Offline

#41 2011-06-26 12:35:34

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: [textile] Definition lists in Textile

Hi lythande,

you might be interested in this article from the weblog. Textile is being (rather slowly at the moment) developed as a separate project from Textpattern now. The main textile repository is currently on github but there are plans afoot to move it to its own domain. You are welcome to post issues to the github issue tracker but please read through the existing issues first as acronym / abbr support is on the developer’s radar already. You are also most welcome to submit pull requests for changes you have made to the code that you feel should be in textile core.


Steve

Offline

#42 2011-06-26 18:57:49

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

Re: [textile] Definition lists in Textile

Much thanks, Steve- at mo Im reading the posts at github :-)

Edit: Now I tried to read anythings, but I can’t figure out how works github and how I can using it :(
(and english is not my language….)

Last edited by lythande (2011-06-26 21:52:48)

Offline

#43 2012-04-27 12:44:39

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: [textile] Definition lists in Textile

Do some of you definition-list users want to try out Redcloth style definition lists?

The branch at github.com/netcarver/textile/tree/redcloth-dl allows you to define single-level definition lists in the Redcloth syntax to allow better import of textile sources from Redcloth. This allows you to do things like…

- coffee := Hot _and_ black
- tea := Also hot, but a little less black
- milk := Nourishing beverage for baby cows.
Cold drink that goes great with cookies. =:

As usual, you can add attributes & modifiers to list items, so…

-(hot) *coffee* := Hot _and_ black
-(hot#tea) _tea_ := Also hot, but a little less black
-(cold) milk := Nourishing beverage for baby cows.
Cold drink that goes great with cookies. =:

Please try this out and let me know how it goes.


Steve

Offline

#44 2012-04-27 19:15:03

Manaus
Member
From: Turin, Italy
Registered: 2010-10-22
Posts: 252
Website

Re: [textile] Definition lists in Textile

My 2 cents
The problem here is that if you use := notation, you can’t add many dd for each dl, which often comes useful, am I wrong?

Offline

#45 2012-04-27 21:01:19

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: [textile] Definition lists in Textile

Hi Manaus,

Thanks for trying this out & yes, that is correct — this notation does not allow multiple dds for each term as the redcloth syntax doesn’t support it (as far as I can tell). This addition is meant to add redcloth compatibility in order to make it easier to bring over and render redcloth documents more easily, not to extend their format1. Also, redcloth format does not allow for nested definition lists.

If you want multiple dd fields you can use the existing PHP-textile definition list syntax…

; Linux
: An open-source version of the UNIX operating system.
: The free Unix workalike created by Linus Torvalds and friends starting about 1991.

…giving…

<dl>
<dt>Linux</dt>
<dd>An open-source version of the <span class="caps">UNIX</span> operating system.</dd>
<dd>The free Unix workalike created by Linus Torvalds and friends starting about 1991.</dd>
</dl>

1 That said, I have support for class/id/styles on each element as it is pretty easy to do in php-textile.

Last edited by net-carver (2012-04-27 21:03:43)


Steve

Offline

Board footer

Powered by FluxBB