Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-06-28 05:47:19

yarco
Member
From: Shanghai, China
Registered: 2006-06-17
Posts: 16
Website

How to write partly textile enabled article?

Recently i’ve download the GeShi plugin.
But i get some trouble when make them work together.

Because the GeShi output may be formatted already, then if source is:
1.
<code>
print ‘Hello’;
</code>

GeShi will output:
2.
<code>
print ‘Hello‘;
</code>

3.
If i turn on textile, it will chanslate &amp; to &amp;amp;, so the source become:
<code>
print &amp;#8216;Hello&amp;#8216;;
</code>

So, when i view it on IE, it will show that something like 2…And there is also something like html-p br appear in the code lines.

But if i turn off textitle, and use pre or something instead.
The whole website looks strange: look like i am using 2 styles css.

Can i do something like:
<code>
<txp:textile state=“enabled”>
//normal format
</txp:textitle>
<txp:ske_geshi language=“php”>
//php code
</txp:ske_geshi>
</code>

You could view: http://co.naivix.com/ see what the trouble i am in.
(Maybe slow outside China.)
1. test
this post use geshi with textile, but output html-entities

2. XML
this post use textile

3. Qt
this post use html-pre format the text and geshi format the code without using textitle

(Although you may don’t know Chinese, but you could see they are in 2 styles: 2 and 3)

Last edited by yarco (2006-06-28 05:57:35)

Offline

#2 2006-06-28 06:47:50

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: How to write partly textile enabled article?

Textile supports this by the <notextile> element.

bc.. <notextile>
print ‘Hello’; </notextile>

Note the leading spaces before notextile and /notextile used to suppress the generation of surrounding <p> elements.

Offline

#3 2006-06-28 07:31:27

yarco
Member
From: Shanghai, China
Registered: 2006-06-17
Posts: 16
Website

Re: How to write partly textile enabled article?

thanks wet. but, yes, it’s ok when using @ on normal text.

but when i do something like this:
<code> < notextile >
<txp:ske_geshi language=“php”>
function hello()
{ print ‘Hello?’;
}
</txp:ske_geshi> </ notextile >
</code>

txp:ske_geshi did’t work.

I would like to write down some articles like:
<code>
————- begin textile ————————
normal text
————- end textile —————————-

————- ske_geshi should work but without textile ————
<txp:ske_geshi language=“php”> print ‘Hello’;
</txp:ske_geshi>
—————— so, print ‘Hello’ is colored… ————————————-

————— then another paragraph using textile ——————
</code>

and notextile works something like my post test2.2

Last edited by yarco (2006-06-28 07:37:10)

Offline

#4 2006-06-28 10:20:54

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: How to write partly textile enabled article?

How would <txp:upm_textile></txp:upm_textitle> strike you? That’d be an extremely simple plugin to make. And I think I shall do so, even if only for my own use. :)

Last edited by Mary (2006-06-28 10:21:11)

Offline

#5 2006-06-29 09:54:33

yarco
Member
From: Shanghai, China
Registered: 2006-06-17
Posts: 16
Website

Re: How to write partly textile enabled article?

<code><txp:upm_textitle></txp:upm_textitle></code> ?
After you write it, i will down it…

Hm…it brings me some other questions… Why textpattern has 3 choices in Content->Write “ Advanced Options Use Textile article “
  1. Use Textile
  2. Leave Text Untouched
  3. Convert Linebreaks

Why not using tags?
create 2 extra tags like:
<code><txp:upm_fmtSource>, <txp:upm_fmtLineBreak></code>
and set the default textile on.

BTW, what does ‘upm ‘ mean?

Offline

#6 2006-06-29 12:36:03

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: How to write partly textile enabled article?

Why not… and set the default textile on.

Because markup is parsed before plugins get run, so non-Textile content would still get Textiled.

Swapping to “Leave Text Untouched” and using tags would allow you to markup however you please. Remember that there are two different markup settings: one is set in the admin prefs for the default setting you’d like, the other is what markup setting you want for a particular article.

For instance, if you almost always use Textile, you could have your admin prefs set to use Textile. But when you have a post where you’d like to easily mix Textile and code (or any other markup plugin), you switch it to “Leave Text Untouched” for that post, and use the tags.

BTW, what does “upm” mean?

Plugins use a 3 character prefix, so there’s no tag name conflicts. There’s no formula or anything, just any 3 characters the plugin author wants. My plugins all use ‘upm’, first letters of my personal website and first name.

I’ve got the plugin bulk done, just gotta write up the help doc for it. :)

Last edited by Mary (2013-01-24 17:35:17)

Offline

#7 2006-06-30 02:01:33

yarco
Member
From: Shanghai, China
Registered: 2006-06-17
Posts: 16
Website

Re: How to write partly textile enabled article?

Hey, Mary, would you help me to learn how to write plugins?
I found a lot of things i want to change in textpattern.

For example, txp:category_list:
it will get the category and all sub categories. But i only want to get the level one categories without the category itself and other indirect categories.

I don’t know whether someone have already write them. It seems lack of Chinese translation.

Hum…yes, i’ve already visited your website. You are only a 23 years old woman, so i don’t hate you.
When i first glance at your photo, i think you come from Arab.

Offline

#8 2006-06-30 02:12:48

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: How to write partly textile enabled article?

lol That’s a screenshot from Black Adder. I don’t really walk around with underwear on my head and pencils up my nose. Hopefully I don’t look manish either… ;)

Plugin: ats_master_category_list. Check out the Plugin Author Resources sticky.

Offline

#9 2006-07-02 17:49:28

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: How to write partly textile enabled article?

yarco: upm_textile. :)

Offline

#10 2006-08-05 09:34:54

skeptisch
Archived Plugin Author
Registered: 2006-06-14
Posts: 7
Website

Re: How to write partly textile enabled article?

Hi all,
unfortunatelly, the author of ske_geshi, me, didn’t get any notification that there are problems. As described in the help file, I couldn’t work out how to completely disable textile for some paragraphs. When using notextile there a still things that get converted.

Mary, is upm_textile something that could help me improving my syntax highlighting ske_geshi plugin? Didn’t get your explanation right, sorry.


Skeptisch.com
ske_geshi – Textpattern plugin: Syntax Highlighter with GeSHi.

Offline

#11 2006-08-05 11:13:55

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: How to write partly textile enabled article?

If your “Use Textile” for your article is set to “Leave text untouched”, your text is just that – left completely untouched by Textpattern. Remember that your Textile setting is per article, under “Advanced Options”.

My plugin will parse for Textile anything you wrap the tag around. So, used with your plugin, an article might look like:

<txp:upm_textile>
I want this text parsed by Textile.
</txp:upm_textitle>

<txp:ske_geshi language="php">
<?php

echo 'Here is some PHP, which I only want parsed by ske_geshi.';

?>
</txp:ske_geshi>

<txp:upm_textile>
I want this text parsed by Textile too.
</txp:upm_textitle>

Does that help?

Offline

#12 2006-08-05 11:56:48

skeptisch
Archived Plugin Author
Registered: 2006-06-14
Posts: 7
Website

Re: How to write partly textile enabled article?

Okay, that would help. But isn’t there any chance to get a really working notextile-tag? There are some bug reports on this, this one for example: http://forum.textpattern.com/viewtopic.php?id=15315

Otherwise, I would include a reference to your plugin in my help file.

Last edited by skeptisch (2006-08-05 11:57:13)


Skeptisch.com
ske_geshi – Textpattern plugin: Syntax Highlighter with GeSHi.

Offline

Board footer

Powered by FluxBB