dartdoc icon indicating copy to clipboard operation
dartdoc copied to clipboard

Add option to document private members

Open Levi-Lesches opened this issue 3 years ago • 6 comments

Removes all instances of .publicX in favor of .documentedX, to reflect that private elements can be documented if the user chooses. This came with the main change of relying on filterNonPublic (which checks Privacy.isPublic) to filterNonDocumented (checks Documentable.isDocumented). Changes some implementation to maintain current behavior

So far, I've got the smoke tests to pass. I haven't tested the new behavior nor run the full existing test suite. I'm mainly opening this PR to get the CI to run the suite for me because I've been having issues (#3095). Also open to feedback on current changes before I make even more, although I suspect the main part of the implementation is mostly done.

TODO:

  • possibly remove privateLibrariesInSidebar option
  • test, test, test behavior with documentPrivate turned on

Levi-Lesches avatar Jul 25 '22 07:07 Levi-Lesches

@srawlins, can you enable the bots? I'd like them to run the tests since I can't do it locally.

Levi-Lesches avatar Jul 25 '22 07:07 Levi-Lesches

@srawlins, sorry to bother you again, but the bots need their permissions renewed for some reason. Maybe because I rebased with master, not sure if that affects it.

Levi-Lesches avatar Aug 10 '22 20:08 Levi-Lesches

No problem! Sorry about that, kind of weird...

srawlins avatar Aug 10 '22 20:08 srawlins

Not sure why the tests failed. https://github.com/dart-lang/dartdoc/runs/7775813969 failed at check-build even though:

  • running grind build doesn't result in a different file (at least not according to git)
  • running grind check-build on my end (Windows) passes with no errors

Also it seems the workflows need a manual approval on every commit

Levi-Lesches avatar Aug 10 '22 21:08 Levi-Lesches

@srawlins, can you point out the purpose of this assert within Documentation.asHtml?

https://github.com/dart-lang/dartdoc/blob/8ee30225e2d89d6044dc48965c9ce1ec1c406cb9/lib/src/model/documentation.dart#L18-L24

It fails when a public class in a private library is being exported in the private library. But I can't figure out what it's meant to check for. It seems to be saying: "If this is not the canonical reference, then _asOneLiner must not have been generated." But... why?

(Also, is there a place off GitHub where I can ask rapid-fire questions like these? If not, that's okay too.)

Levi-Lesches avatar Aug 10 '22 23:08 Levi-Lesches

can you point out the purpose of this assert within Documentation.asHtml?

Sorry for the extreme delay in responding. This code always trips me up when I look at it. I come away with more questions than I started with 😛 . I've been meaning to refactor it but I've always been afraid. Since I couldn't even answer this question without getting my hands dirty, I decided to refactor it now, haha. See https://github.com/dart-lang/dartdoc/pull/3131, and see the long comment I inserted in there which makes things hopefully more clear.

srawlins avatar Aug 25 '22 17:08 srawlins