How do I create an online glossary?
May 24, 2006 11:09 AM   Subscribe

How do I create an online glossary?

I'm currently using Excel and exporting to html within the program. The results are less than stellar.
It would be nice if I could keep the data in CSV format (or something else) so that I could edit it on a spreadsheet. It works fine with searching for terms via the browser and there aren't enough entries to make elaborate search functions necesarry. Does anyone have a recommendation? Freeware program? CSS solution?
posted by imposster to Computers & Internet (9 answers total)
 
How frequently would you want to update this?

It's not hard, using a few GREP patterns, to take a CSV file (or tab-separated file) and transform it to an HTML table. Paste on a boilerplate static header and footer, and bob's your uncle.

There's probably a single GREP pattern that would do the whole table at once, but my GREP-fu isn't up to that level.

It's also not that hard to use search/replace to prune the HTML generated by Excel down to something more reasonable (though probably more work).

In either case, you could then add some simple CSS to jazz up the table.

This assumes occasional updating. If you want to update and republish more frequently, you'll probably want either a CMS specifically to maintain the glossary, or a program that can apply a series of transformations to the CSV and emit the proper HTML.
posted by adamrice at 11:24 AM on May 24, 2006


Unless you can do server-side hoop-jumping (e.g., parsing the .CSV file with PHP every time it's loaded, or something similar -- which is actually pretty easy if you know a little PHP), there's really no other way (than what you're apparently doing) that I can think of to have your web server and Excel work from a common file without needing to do some sort of periodic export from Excel.

For what it's worth, for something this simple, I usually just concatenate the HTML within Excel, and then copy-and-paste from Excel to the .htm file when I want it updated. If, for example, you have the following in your spreadsheet:

Cell A1: cov suab
Cell B1: the tone in Hmong spoken language H(300)
Cell C1: (empty)
Cell D1: ="<tr><td>"&A1&"</td><td>"&B1&"</td><td>"&C1&"</td></tr>

Then each time you want to update the web site, you just paste the contents of column D into a text file (between <table></table> tags) and upload it to your web server.
posted by Doofus Magoo at 12:22 PM on May 24, 2006


Best answer: If you have a tab-separated text file, but save it as a dot-XLS file, Excel will happily read it as a spreadsheet anyway. This is an easy way to have the website and Excel work off the same file as Doofus suggests. It doesn't look like you have calculations in those cells, just data?

Can you run Perl scripts on your server, or PHP? I'd be happy to help you work out a solution where you would just upload the file and a script could read and output it every time the page was accessed.
posted by AmbroseChapel at 2:36 PM on May 24, 2006


One simple, cheap way to do it if you were starting from scratch would be to hack up a template for any standard blogging CMS. For each term in the glossary, you'd make a separate "post". The title of the post is the glossary term, and the body of the post is the definition, etc.

Then, you can have the system list all "posts" on a single page, which page would in effect be your glossary. Clicking on a post could take you to an additional page with more information, or not. This display could look as much or as little like the html table you just showed as you want.

This option would make use of the simple text editing environments built into the CMS for adding/editing entries, and then also use functionality if you needed.

You could actually do a lot of cool things with this, like categorize your glossary terms, tag them, make them commentable, etc.

For this I'd personally recommend TextPattern, because I find any editing of the WordPress templates to be laborious and fraught with difficulty (haven't tried the newest version though, so what do I know).

I've been working on a pretty complicated Web-based glossary for a couple years now. We're not using this solution because it's not right for our site, but it might be for you. Good luck.
posted by Hildago at 2:42 PM on May 24, 2006


and then also use built-in search functionality if you needed
posted by Hildago at 2:44 PM on May 24, 2006


Response by poster: Thanks for all the the great ideas. I'll think about it tonight and post again.
posted by imposster at 8:06 PM on May 24, 2006


Response by poster: P.S. I can run PHP and Perl on the server (hosted via your-site.com)
posted by imposster at 8:56 PM on May 24, 2006


Response by poster: Update: AmbroseChapel came through with a great script and css that allows me to format the table as I please. You can find the results here, although I will probably be changing the url soon. You can still find the glossary linked on this page.

Thanks again AC.
posted by imposster at 7:14 AM on May 26, 2006


Am I allowed to say "will code for food"?

Just wanted to say, while the satisfied-customer glow is still on this thread, I'm available to do this kind of thing commercially too. Email me.

If I'm not allowed to say that, please delete this post.
posted by AmbroseChapel at 7:03 PM on May 28, 2006


« Older Where can I find a nice Bible for a gift?   |   What is the origin of the hitchhiker's thumb? Newer »
This thread is closed to new comments.