Saturday, January 4, 2014 at 6:09 PM

The #glossary is for re-usable bits of text

When you're working on websites, you find there are bits of text that appear all over the place. Rather than having to type them every time, we have a structure called the glossary, that allows you to define them once and use them in many places. And if you need to change something, you can change it where it's defined and it automatically changes in all the places its referenced.

Let's say you want to define a re-usable bit that contains a link to your home page.

  • Create a headline at the top level of your outline called #glossary.

  • Indented under it enter a line that says "myhome" (include the quotes).

  • Indented under that, enter a line containing the link. Example:

    • <a href="http://scripting.com/">Home</a>
  • Here's a screen shot to make it clear.

There's a #glossary in the example file.

Now to use it, enter the text into one of your pages: "myhome" (again include the quotes). I've done that in Example 6.

Here are some facts about glossary entries:

  • They can include macros.

  • You can use them in markdown pages and html pages.

  • They can contain Markdown text and it will be processed in Markdown pages.

  • You don't have to use double quotes to delimit them. It's a straight string substitution. However it's probably a good idea to use some kind of delimiter so you don't get substitutions in random and unexpected places.

  • They are case-insensitive, so "MyHome" is the same as "myhome".


Last built: Tue, Dec 9, 2014 at 3:29 PM

By Dave Winer, Saturday, January 4, 2014 at 6:09 PM. Yeah well, that's just, you know, like, your opinion, man.