Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » [archived] cng_acronym

#1 2005-11-16 15:08:58

chess
Plugin Author
Registered: 2005-11-10
Posts: 19
Website

[archived] cng_acronym

Notice: This thread is archived, this can be achieved with textile.

**********************************************************

I have ported the <a href=“http://www.huddledmasses.org/2004/04/19/wordpress-plugin-acronym-replacer/”>Wordpress acronym plugin</a> by Joel Bennett to TXP. The existing acronym mods for TXP worked fine, but it appeared that they all required some modifications to the core TXP code. I wanted the acronym feature without the hacks, so I decided to port the WordPress plugin to TXP.

I cannot take much credit for this plugin. Joel, who kindly released his code under the GPL, did all the heavy lifting. All I did was figure out how to pull the TXP content into the plugin and get it back out. I am sure that there is a better way to do what I have done, but it works.

You can download the plugin <a href=“http://www.chessgriffin.com/files/plugins/cng_acronym.txt”>here</a> and the help documentation should be enough to get it going. You can also read more about it <a href=“http://www.chessgriffin.com/projects/txp-acronym-plugin”>here</a>.

This is my first plugin and I am not much of a coder, so any feedback would be greatly appreciated. Thanks!

Offline

#2 2005-11-16 16:43:43

maharis
New Member
From: KL Malaysia
Registered: 2005-08-02
Posts: 9
Website

Re: [archived] cng_acronym

Yay! i’ve been wanting a plugin to do this!! Got it installed, n it works like a charm

:) Thanks Chess!!

Offline

#3 2005-11-16 20:45:56

NXArmada
Member
From: Sevierville, TN
Registered: 2005-09-13
Posts: 82

Re: [archived] cng_acronym

What happened to the Textile way of useing acronym’s:
http://rpc.textpattern.com/help/?item=acronym

The plugin, which i like, makes the acronym more visible which is nice.


Ryan

Offline

#4 2005-11-16 21:04:38

chess
Plugin Author
Registered: 2005-11-10
Posts: 19
Website

Re: [archived] cng_acronym

maharis, glad it’s working for you! :)

NXArmada, it looks like the acronym gets wrapped twice, with the plugin acronym overriding the Textile acronym. Not an elegant solution, for sure. Ideally, I guess it would strip out the Textile acronym tags first. I’ll see if I can figure out a way to make that work.

Last edited by chess (2005-11-16 21:05:04)

Offline

#5 2005-11-16 22:17:52

chess
Plugin Author
Registered: 2005-11-10
Posts: 19
Website

Re: [archived] cng_acronym

Version 0.2 is now available. This updated version strips out existing acronym tags from the content, so you may want to make sure the acronyms you have defined manually are added to the acronym array in the plugin. Same download link as above.

Offline

#6 2005-11-17 10:21:27

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: [archived] cng_acronym

I don’t understand the point… As far as I can see, he does what Textile and CSS does. I’m sure I’ve missed something…

Offline

#7 2005-11-17 14:18:38

chess
Plugin Author
Registered: 2005-11-10
Posts: 19
Website

Re: [archived] cng_acronym

Since the plugin maintains the list of acronyms and their corresponding descriptive titles, I don’t need to type FAQ (Frequently Asked Questions) every time. All I do is enter that once in the plugin array and from then on, all I need to do is type FAQ and the “Frequently Asked Questions” title is added for me automatically. Plus, since it is not dependent on Textile, it will work whether I use Textile or not. For someone who does not use many acronyms it probably does not add a whole lot, but for someone who does like to use a lot of acronyms and wants the tags and titles it can save some time.

Last edited by chess (2005-11-17 14:18:51)

Offline

#8 2005-11-17 17:50:14

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: [archived] cng_acronym

Ok I got it. I will have a look… maybe I can transform it to use Textile, and be applied to any string transformation.

Offline

#9 2005-11-20 23:36:24

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: [archived] cng_acronym

This is nice. I am looking at the code and I know just enough to really mess it up. Could this be hacked into automatically adding links as well?

ie:

<code>“Amazon” => “<a href=“http://amazon.com”>Amazon</a>”,
“Textpattern” => <a href=“http://textpattern.com”>Textpattern</a>”,
NYTimes” => <a href=“http://nytimes.com”>NYTimes</a>”,
“Ebay” => <a href=“http://ebay.com”>Ebay</a>”,
“Textbook” => <a href=“http://textbook.com”>Textbook</a>”,
“Mozzila” => <a href=“http://mozilla.org”>Mozzila</a>”</code>

etc etc etc

Just thought I would throw it out there….

Jamie

Last edited by soulship (2005-11-20 23:40:38)

Offline

#10 2005-11-21 14:14:21

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: [archived] cng_acronym

That’s what I meant. TXP lack (and need) a plugin to automatically transform text strings into others text strings, so that it can be applied to links, complex CSS (textiled) constructs, hyperlinks, acronyms, and so on.

Offline

#11 2005-11-21 15:26:33

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: [archived] cng_acronym

I’m with you Jeremie. I think this would make a great addition. I’m going to look at the code. But from what I see since this replaces txp:article and txp:excerpt it looks as if it would have to be either accronyms or links but not both.

Jamie

Offline

#12 2005-12-30 10:49:20

Garfield
Member
From: Barcelona
Registered: 2005-07-09
Posts: 11
Website

Re: [archived] cng_acronym

Chess, thanks for the plugin, it works great and is really usefull!!

By the way I was trying to add the next “acronym” by it didn’t work:

“C#” => “C-Sharp”, “C\#” => “C-Sharp”,

I looked at the regular expression, but I didn’t found anything that implied that the acronym must be upercase letters, in fact it seems that it just looks for a literal string, isnt?

Any idea?

thanks

Offline

  1. Index
  2. » Archives
  3. » [archived] cng_acronym

Board footer

Powered by FluxBB