speced / bikeshed

:bike: A preprocessor for anyone writing specifications that converts source files into actual specs.
https://speced.github.io/bikeshed
Creative Commons Zero v1.0 Universal
1.1k stars 199 forks source link

Linking errors for terms defined in the `anchors` block. #831

Closed mikewest closed 8 years ago

mikewest commented 8 years ago

https://github.com/mikewest/artur-yes/blob/master/index.src.html defines a few fairly generic terms in the anchors block. These terms don't seem to be easily linkable from the text. Not sure if it's an anchors block problem, or an unrecognized spec problem, or what. Halp? :)

bikeshed -f spec ./index.src.html
LINK ERROR: No 'dfn' refs found for 'url' with spec 'REPORTING'.
LINK ERROR: No 'dfn' refs found for 'group' with spec 'REPORTING'.
LINK ERROR: No 'dfn' refs found for 'max-age' with spec 'REPORTING'.
 ✔  Successfully generated, with 3 linking errors

Terms defined at: https://github.com/mikewest/artur-yes/blob/master/index.src.html#L30 Used at: https://github.com/mikewest/artur-yes/blob/master/index.src.html#L359

tabatkins commented 8 years ago

I'm almost certain that was my fault - I canonicalize the 'spec' info in the anchors block to lowercase (which I also do for spec data and biblios), but wasn't lowercasing the 'spec' argument in the autolinker, so your autolinks were failing to find anything with the specified spec. ^_^ I just pushed a fix, lmk if that solves your problem.

mikewest commented 8 years ago

You fixed it, thank you!

That said, now I'm getting a different error for the same document. :)

LINK ERROR: No 'dfn' refs found for 'url' compatible with status 'ED' in spec 'reporting'.
LINK ERROR: No 'dfn' refs found for 'group' compatible with status 'ED' in spec 'reporting'.
LINK ERROR: No 'dfn' refs found for 'max-age' compatible with status 'ED' in spec 'reporting'.
tabatkins commented 8 years ago

Ugh, this is a manifestation of a different issue. :/

Normally, local dfns win over external ones; this makes it easy to link to things you're defining, even if some other spec defines the same term. You can override this by specifying which spec you want; then I skip local dfns entirely, assuming that you know what you're doing.

This collides in anchor blocks, which mark their dfns as local (if you're defining them, you probably mean to use them, so same logic applies as "real" local dfns), but if you then use spec to try to specify them, they get skipped.

This is really just bad semantics on my part; I need to mark anchor-block dfns as non-local but still preferred over foreign links.

tabatkins commented 8 years ago

Well, hm. I think I fixed it.