jacebrowning/doorstop — pull request #98 by jacebrowning (2014-06-15 00:20:11+00:00)
Title: DoorstopError during publish with bad links.

If an item contains links to unknown items, this raises an uncaught exception during publishing:

```bash
$ doorstop publish all specs-gen/html
publishing tree to specs-gen/html...
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.3/bin/doorstop", line 9, in
load_entry_point('Doorstop==0.7-dev', 'console_scripts', 'doorstop')()
File "/Users/Browning/Drive/Programs/Desktop/Doorstop/doorstop/cli/main.py", line 177, in main
success = function(args, os.getcwd(), parser.error)
File "/Users/Browning/Drive/Programs/Desktop/Doorstop/doorstop/cli/main.py", line 534, in _run_publish
path = publisher.publish(tree, args.path, ext, **kwargs)
File "/Users/Browning/Drive/Programs/Desktop/Doorstop/doorstop/core/publisher.py", line 51, in publish
for line in publish_lines(obj2, ext, linkify=linkify, **kwargs):
File "/Users/Browning/Drive/Programs/Desktop/Doorstop/doorstop/core/publisher.py", line 123, in publish_lines
yield from gen(obj, **kwargs)
File "/Users/Browning/Drive/Programs/Desktop/Doorstop/doorstop/core/publisher.py", line 325, in _lines_html
text = '\n'.join(_lines_markdown(obj, linkify=linkify))
File "/Users/Browning/Drive/Programs/Desktop/Doorstop/doorstop/core/publisher.py", line 232, in _lines_markdown
items2 = item.parent_items
File "/Users/Browning/Drive/Programs/Desktop/Doorstop/doorstop/core/item.py", line 368, in parent_items
return [self.tree.find_item(i) for i in self.links]
File "/Users/Browning/Drive/Programs/Desktop/Doorstop/doorstop/core/item.py", line 368, in
return [self.tree.find_item(i) for i in self.links]
File "/Users/Browning/Drive/Programs/Desktop/Doorstop/doorstop/core/tree.py", line 375, in find_item
raise DoorstopError("no matching{} ID: {}".format(_kind, identifier))
doorstop.common.DoorstopError: no matching ID: Derived
```

The publish function shouldn't raise an exception here, but what should it do:

- not publish the bad link?
- publish the bad link but leave it non-hyperlinked?

Either way, this will require updates to the `Item` properties that call `Tree.find_item()` and `Tree.find_document()`. Maybe these properties shouldn't raise exceptions either?