{"id":419,"date":"2006-05-27T12:27:01","date_gmt":"2006-05-27T17:27:01","guid":{"rendered":"http:\/\/www.shamusyoung.com\/twentysidedtale\/?p=419"},"modified":"2011-04-10T05:45:08","modified_gmt":"2011-04-10T10:45:08","slug":"lexicon-wordpress-plugin-v11","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=419","title":{"rendered":"Lexicon WordPress Plugin v1.1"},"content":{"rendered":"<p>I&#8217;ve been thinking more about the wordpress plugin I released a few days ago and how to improve it.  This project started with <a href=\"http:\/\/www.haibane.info\/2006\/05\/18\/editorial-policy-a-revision\/\">this post at haibane.info<\/a>, where Fledgling %Otaku talked about making a blog useable for for people familiar with your subject matter and at the same time making it accessable to newbies.  <\/p>\n<p>I wanted a plugin that would provide dictionary links for all of the jargon on my site but wouldn&#8217;t require any extra effort on my part (because I&#8217;m big on energy conservation, particularly my own) and that wouldn&#8217;t clutter up my posts with HTML tags.<\/p>\n<p>The first try was a little rough. Fledgling %Otaku has some good suggestions for using wiki-style tags which I really liked at first, but I moved away from this for a few reasons:<\/p>\n<ol>\n<li>Using wiki tags would mean going back and adding those tags to old posts, or accepting that the jargon on old posts would remain .  Meh.\n<\/li>\n<li>There are already plugins that use wiki-style markup tags, and I may want to use them someday.  Right now I could combine the two with no conflicts, but if I adopt wiki standards then those plugins with conflict with my own.\n<\/li>\n<li>If for whatever reason I drop usage of the plugin in the future, my posts would suddenly be filled with brackets and markup text.  I&#8217;m very commitment-shy when it comes to software, even stuff I&#8217;ve written myself.\n<\/li>\n<\/ol>\n<p>I realized I could parse things much better if I used some PHP 5-specific code.  I honestly don&#8217;t know if this is a problem or not.  This site has been running on PHP 4.4 and I had to request that <a href=\"http:\/\/www.hostingmatters.com\/\">Hosting Matters<\/a> (my host) move my site to a machine with PHP 5.  (Which they did quickly and seamlessly, BTW.)  I have no idea how widespread PHP 5 is or how much this will limit the usefulness of the plugin to others.  PHP 5 has been out for nearly two years, but there are still some holdouts, and I assume they have good reasons for this. Comments on this are welcome.<\/p>\n<p>Using PHP 5 I was able to eliminate almost all of the shortcomings of the original version.  It won&#8217;t insert unwanted spaces.  It will pick up links even if they are bracketed by HTML tags.  It WON&#8217;T mess with keywords that are inside of HTML tags.  It won&#8217;t mess with the case usage of the original word. <\/p>\n<p>The only bit of markup I did add was that you can now preceed a keyword with a percent to prevent it from becoming a link.  This enables me to say, &#8220;Fledgling %Otaku is one of my favorite otaku&#8221;, and not have his name become a link to my dictionary.<\/p>\n<p>For those interested, you can download the plugin <a href=\"?p=413\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been thinking more about the wordpress plugin I released a few days ago and how to improve it. This project started with this post at haibane.info, where Fledgling %Otaku talked about making a blog useable for for people familiar with your subject matter and at the same time making it accessable to newbies. I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66],"tags":[],"class_list":["post-419","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=419"}],"version-history":[{"count":0,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/419\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}