Wednesday, April 24, 2013; 3:16:37 PM Eastern
How to create an "include" node
- My friend Anton Zuiker is our best tester. Anton is a really smart guy. And he's earnest. And doesn't give up. And he makes things break. Which is exactly what you look for in a tester. Because you want to find out about breakage as soon as you break something. Easier to fix then. And it helps make the software better sooner, which is what we're trying to do, all software developers.
- Anyway, Anton wrote me an email this morning asking how to include an outline in another outline. I'm including the full text of his email below. I don't think he'll mind.
- Dave, asking this off-list because I'm not sure you've announced this functionality yet.
- Something that I've never grasped is how to include an outline in another outline, or said another way, display Outline1 inside Outline2. I know you've referred to this, and some of the more experienced outliners on the list are mentioning it, but I'm not seeing includes mentioned in the HowTo or Fargo docs.
- Sorry for my confusion, but I'm finally at the point where I want to connect my outlines. Am I getting ahead of the feature rollout?
- I'm on a train and couldn't think of a better place to answer his question than in a blog post, so here goes.
- Headlines in outlines, sometimes called nodes, can have hidden attributes that tell software how to do special things with it. One of the things we can do is include an outline in another. Include is the right word.
- The way you do that is to add a type attribute to the node. The value of the type attribute should be "include" -- leave out the quotes. It should have another attribute called "url" and its value is the address of the outline that's to be included. That's all there is to it.
- Now, how to do that?
- In Fargo, we have a command that lets you edit the attributes of any headline. It's called, unimaginatively, Edit Attributes, and it's in the outliner menu. So if I wanted to add an include node here, pointing to my states outline, I would edit its attributes like this:
- The "created" attribute is automatically put there by Fargo, on every headline you create, so we can tell when it was created. It also gives each headline a unique identity, unless you manage to create two headlines in the same second (us programmer types are always thinking about things this way, they're called "edge" conditions, and every one of them eventually happens, it seems).
- BTW, I've created such an include node here, as a sub of the headline you're reading right now, so you can see how an include node works.
- My Much-Maligned States Outline
- I'm sure this is confusing at first. But if you try it out, ask questions, and do it again, eventually it'll make sense. You're learning a pretty cool computer science concept -- pointers. But it's really not that hard, once you understand it. ;-)