Closed sadlerjw closed 8 years ago
I don't like name documentId
. Too long + camalcase (because consists of 2 parts).
Oh okay, I thought that was your suggestion from #7, which I liked. docId
is the obvious next idea, which still has two parts...after that, I'm not sure what else to name it. (Maybe baseName
or something? Not sure I really like that either though...) Open to suggestions!
docId is the obvious next idea, which still has two parts...
I was asked for my opinion about this particular bike shed earlier today, so here it is: basename
works just fine (I'm not really a fan of camelcase either), or maybe a prefix
.
PS: Just out of curiosity, why are you using chai
? It's an extra dependency, and built-in assert
can do the same job (we're not running those tests in a browser as far as I know).
PS. i use http://www.thesaurus.com/ to search words.
Is it safe to use { id: XXX }
?
@puzrin I think for this particular use case, anchorBase or hashBase is most descriptive, but maybe isn't a great name for something that might eventually mean something more generic in markdown-it
core. I'm a little concerned with id because I'm not sure it's entirely clear what the id describes. I like basename a lot, although my personal favourites are documentId and docId. I'm happy to leave it to your judgment as maintainer what to settle on, including stuff I'm not a huge fan of :)
@rlidwka you're entirely right, I didn't know that (node newbie). I've removed the chai
dependency.
Let's wait a couple of days, to think about name.
PS. About chai - in testgen
it was used to enable colored diffs at mocha output. But in single package that does not make sense.
Merged, thanks!
The property is named env.docId
now.
Based on discussion in #7 - if
env.documentId
is supplied and is a non-empty string, footnote IDs are now in the formfn-some-document-id-1
/fnref-some-document-id-1
. (See #7 for details)To test, I needed a version of
generate()
from markdown-it-testgen that supported passing anenv
variable through torender
. After discussion in https://github.com/markdown-it/markdown-it-testgen/pull/1, I inlined most ofgenerate
with the necessary modifications. (This also required me to add chai as a new dev dependency.)