documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Question on case sensitivity

Open shuckster opened this issue 5 years ago • 3 comments

I have the following module and methods signature:

function module() {
  function method() {
  }
  function Method() {
  }
  return {
    method,
    Method
  }
}

How would I document this so that the generated links consider the case of each method-name please?

As such, using a combination of @module, plus @function/@memberof here produces a document that will link only to the first method, as the second one is forced to a lower-cased version.

  • What version of documentation.js are you using?: 12.1.4
  • How are you running documentation.js (on the CLI, Node.js API, Grunt, other?): CLI

shuckster avatar Apr 09 '20 13:04 shuckster

Right now, this isn't possible. Our slugger, github-slugger is case-insensitive. We'd need to switch to a different linking module or customize that one, and release a breaking release to support methods with the same names with different capitalization schemes.

tmcw avatar May 09 '20 19:05 tmcw

Thanks for getting back to me @tmcw . I managed to solve my issue for the time-being with a little awk-hackery, but I guess in terms of adding this in as a feature I appreciate that it's a bit of an edge-case.

shuckster avatar May 11 '20 20:05 shuckster

Just discovered that github-slugger seems to offer a maintainCase option:

  • https://github.com/Flet/github-slugger/blob/68f7e7c5d954bdc0e965a5293c21afb57b16077b/index.js#L46

I know you said that supporting this would cause breaking-changes, but just putting it out there in case there as a possibility to make case-sensitivity a config-option or something.

shuckster avatar Dec 07 '20 23:12 shuckster

Will close for now.

Nice to see this project is still active, though!

shuckster avatar Mar 02 '23 15:03 shuckster