TECH: Interlinear glosses Wordpress plugin

Discussion of natural languages, or language in general.
Post Reply
User avatar
Jipí
Smeric
Smeric
Posts: 1128
Joined: Sat Apr 12, 2003 1:48 pm
Location: Litareng, Keynami
Contact:

TECH: Interlinear glosses Wordpress plugin

Post by Jipí »

For your interest, see what I've come up with over the weekend:
Guitarplayer wrote:EDIT: Mkay, since nobody objected, see http://benung.nfshost.com/archives/1721
Hope this'll work for other people, too, not just for me. My pageviews are currently exploding :P It'd be a shame if it wouldn't work properly.

User avatar
Cathbad
Avisaru
Avisaru
Posts: 269
Joined: Thu Aug 04, 2005 4:11 pm
Location: Edinburgh, UK

Re: TECH: Interlinear glosses Wordpress plugin

Post by Cathbad »

Superb! I'll install this immediately once I get back from uni this afternoon... and test it on my recent TC quote. :-D

Trailsend
Lebom
Lebom
Posts: 169
Joined: Fri Mar 27, 2009 5:50 pm
Contact:

Re: TECH: Interlinear glosses Wordpress plugin

Post by Trailsend »

Awesome! The specifiable dividing character is a nice feature, but an even nicer feature would be if you could specify a set of characters instead of just one, and if delimiting characters were (optionally?) not removed from the final gloss. This would allow people to separate columns by both word and morpheme. (Feayran, for example, looks much nicer when I align columns morpheme-by-morpheme rather than just word-by-word, since there tends to be a bucket-ton of morphemes per word.)

User avatar
finlay
Sumerul
Sumerul
Posts: 3600
Joined: Mon Dec 22, 2003 12:35 pm
Location: Tokyo

Re: TECH: Interlinear glosses Wordpress plugin

Post by finlay »

Can you install that on a free wordpress blog or do you have to have paid the subscription fee?

User avatar
Jipí
Smeric
Smeric
Posts: 1128
Joined: Sat Apr 12, 2003 1:48 pm
Location: Litareng, Keynami
Contact:

Re: TECH: Interlinear glosses Wordpress plugin

Post by Jipí »

Trailsend wrote:Awesome! The specifiable dividing character is a nice feature, but an even nicer feature would be if you could specify a set of characters instead of just one, and if delimiting characters were (optionally?) not removed from the final gloss.
Myeah, well, I wanted basic functionality first. Hm, I can see | potentially being removed by the RegExp that deals with explicitly marking stuff for small caps because it matches anything between two |'s. Shouldn't be hard to exclude whitespaces immediately following, though. Meh, should've thought of that. Well, let's hear more people's opinions and suggestions first. However, if you don't set a delimiter specifically it won't be removed. Instead, it'll probably get its own column.

[EDIT: Yes, the pipe character definitely clashes. Probably I should build in some check that lets you set (a) delimiter(s) to ignore?]
finlay wrote:Can you install that on a free wordpress blog or do you have to have paid the subscription fee?
IIRC wordpress.com doesn't let you install your own plugins in the free variant, sadly :x

User avatar
Cathbad
Avisaru
Avisaru
Posts: 269
Joined: Thu Aug 04, 2005 4:11 pm
Location: Edinburgh, UK

Re: TECH: Interlinear glosses Wordpress plugin

Post by Cathbad »

Tested here: http://jonafras.conlang.org/?p=548

And it appears to work quite well. Extremely useful. Great job, GP :)

EDIT: just one thing: is there any way to add your own formatting inside the 'glossed' area? I want to be able to emphasize the relevant words in the sentences for my WOTD posts, but currently it just seems to bold everything no matter what I do.

User avatar
Jipí
Smeric
Smeric
Posts: 1128
Joined: Sat Apr 12, 2003 1:48 pm
Location: Litareng, Keynami
Contact:

Re: TECH: Interlinear glosses Wordpress plugin

Post by Jipí »

Cathbad wrote:And it appears to work quite well. Extremely useful. Great job, GP :)
Yeah, David Peterson has also tried it out on his Kamakawi WotD blog yesterday. Nice to see it basically works :)
EDIT: just one thing: is there any way to add your own formatting inside the 'glossed' area? I want to be able to emphasize the relevant words in the sentences for my WOTD posts, but currently it just seems to bold everything no matter what I do.
TBH I haven't tried using HTML tags in the [gloss] block (though it should work because /\<\/?(.*?)\>/ doesn't get filtered out), but if you do e.g. [gloss blah1 blah2 blah3] it'll apply the CSS classes .blah1…3 to lines 1-3. You need to define them, though, which is why I included the style.css file in the plugin folder, where you can do exactly that. The script automatically adds a "class=''" to every <dt> and <dd> element. Look into the code of the plugin if you want to see how it works, the mapping stuff happens towards the bottom of the cb_gloss.php file. If you need a CSS reference, look at this reference by the Mozilla developers. If you want the layout to be permanently different, I'd suggest adding some definitions for .cb-gloss dt and .cb-gloss dd to styles.css. Otherwise your browser's default will be used.

EDIT: HTML tags somehow get filtered out :? I'll try seeing to that.
EDIT: Ah yes, on line 57 it currently says $content = strip_tags($content);. Shouldn't have done that. It was supposed to strip off superfluous <br />s.

User avatar
Jipí
Smeric
Smeric
Posts: 1128
Joined: Sat Apr 12, 2003 1:48 pm
Location: Litareng, Keynami
Contact:

Re: TECH: Interlinear glosses Wordpress plugin

Post by Jipí »

OK, I've done some tentative changes to address the two issues Cathbad and Trailsend have encountered. See the updated file here: http://dl.dropbox.com/u/8026017/cb_gloss.php.txt — To test the updated file, you'll best rename your cb_gloss.php to something like cb_gloss.php.bak and replace it with the file from my Dropbox, where you'll have to strip the final .txt. It should support markup HTML tags in the [gloss]…[/gloss] block now (search for "DEFINE ALLOWED HTML TAGS") and shouldn't delete "| " anymore.

Bristel
Smeric
Smeric
Posts: 1258
Joined: Mon Jun 01, 2009 3:07 pm
Location: Miracle, Inc. Headquarters
Contact:

Re: TECH: Interlinear glosses Wordpress plugin

Post by Bristel »

Your invention has been tweeted on Twitter at least once by a popular conlang or linguistics twit. So word is spreading quickly, I hope. :)
[bɹ̠ˤʷɪs.təɫ]
Nōn quālibet inīquā cupiditāte illectus hoc agō
Yo te pongo en tu lugar...
Taisc mach Daró

User avatar
Jipí
Smeric
Smeric
Posts: 1128
Joined: Sat Apr 12, 2003 1:48 pm
Location: Litareng, Keynami
Contact:

Re: TECH: Interlinear glosses Wordpress plugin

Post by Jipí »

Bristel wrote:Your invention has been tweeted on Twitter at least once by a popular conlang or linguistics twit.
Mh.

User avatar
Cathbad
Avisaru
Avisaru
Posts: 269
Joined: Thu Aug 04, 2005 4:11 pm
Location: Edinburgh, UK

Re: TECH: Interlinear glosses Wordpress plugin

Post by Cathbad »

Guitarplayer wrote:OK, I've done some tentative changes to address the two issues Cathbad and Trailsend have encountered. See the updated file here: http://dl.dropbox.com/u/8026017/cb_gloss.php.txt — To test the updated file, you'll best rename your cb_gloss.php to something like cb_gloss.php.bak and replace it with the file from my Dropbox, where you'll have to strip the final .txt. It should support markup HTML tags in the [gloss]…[/gloss] block now (search for "DEFINE ALLOWED HTML TAGS") and shouldn't delete "| " anymore.
Thanks! :) There's still some funky behavior, especially in the "visual" editing bit, but nothing too crucial. Italics at least are possible now!

User avatar
Jipí
Smeric
Smeric
Posts: 1128
Joined: Sat Apr 12, 2003 1:48 pm
Location: Litareng, Keynami
Contact:

Re: TECH: Interlinear glosses Wordpress plugin

Post by Jipí »

Cathbad wrote:There's still some funky behavior, especially in the "visual" editing bit, but nothing too crucial
Could you maybe PM me an example?

EDIT: I think I have found what you might have meant: HTML tags now get a zero-width space before and after them so that they don't collide with the small-caps function. I'll release an update tomorrow. I should also upload this to the Wordpress plugin repository, so you'll get an automatic notification if there's an update available.

User avatar
Jipí
Smeric
Smeric
Posts: 1128
Joined: Sat Apr 12, 2003 1:48 pm
Location: Litareng, Keynami
Contact:

Re: TECH: Interlinear glosses Wordpress plugin

Post by Jipí »

OK, the updated file is here (still stuff to improve, though): http://benung.nfshost.com/files/cb-gloss-20120215.zip (SEE BELOW!) – Since this isn't on wordpress.org, you won't get automatic notifications on updates :(
Last edited by Jipí on Thu Feb 16, 2012 2:57 pm, edited 2 times in total.

User avatar
Jipí
Smeric
Smeric
Posts: 1128
Joined: Sat Apr 12, 2003 1:48 pm
Location: Litareng, Keynami
Contact:

Re: TECH: Interlinear glosses Wordpress plugin

Post by Jipí »

It's on Wordpress.org now, so you should be able to install it even from within your blog and get updates if I should make any. Only works with self-hosted Wordpress blogs, though.

Post Reply