Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pydoctor should hide all private names by default #29

Closed
Tracked by #104
mwhudson opened this issue Jan 12, 2015 · 16 comments
Closed
Tracked by #104

pydoctor should hide all private names by default #29

mwhudson opened this issue Jan 12, 2015 · 16 comments
Labels
Confirmed This issue has been confirmed by a core pydoctor dev

Comments

@mwhudson
Copy link
Contributor

https://bugs.launchpad.net/pydoctor/+bug/209077 was a step forward, but it was not consistently applied.

For example, the "instance variables" section on http://twistedmatrix.com/documents/10.1.0/api/twisted.internet.endpoints.TCP4ClientEndpoint.html still doesn't render the private instance variables differently.

While displaying private names is useful to maintainers, the main public documentation really shouldn't show the private names at all, and should instead have a link that says "show all private names".


Imported from Launchpad using lp2gh.

@mwhudson mwhudson added Confirmed This issue has been confirmed by a core pydoctor dev Undecided labels Jan 12, 2015
@mwhudson
Copy link
Contributor Author

(by mwhudson)
I agree. In general, the stuff that gets documented from @fields is not handled the same way as other things, and it should be.

@hawkowl
Copy link
Member

hawkowl commented May 25, 2016

Is this done to some reasonable satisfaction? @glyph

@glyph
Copy link
Member

glyph commented May 25, 2016

In the public website documentation, yeah, but in Dash (i.e.: without JavaScript) you still see private methods by default. They're also grouped according to their presence in the hierarchy, rather than private-ness, so you see private methods before you see other kinds of public methods. So I think there's still more to do here.

@hawkowl
Copy link
Member

hawkowl commented Jul 9, 2016

@glyph that seems like a Dash problem to me -- or maybe something we can fix in doc2dash (cc @hynek ). Is there such a thing as 'hidden' in dash, do you know?

@hynek
Copy link
Member

hynek commented Jul 9, 2016

I guess @Kapeli would be the right person to ask…

@Kapeli
Copy link

Kapeli commented Jul 9, 2016

There's no such thing as hidden in Dash. However as far as I understand from @glyph's comment this is a JavaScript issue? I can definitely enable JavaScript for the Twisted docset if that's the case.

Can you give me an example of a page that contains private methods that should be hidden? This page looks the same in Dash as online: http://twistedmatrix.com/documents/current/api/twisted.internet.endpoints.TCP4ClientEndpoint.html.

@hawkowl
Copy link
Member

hawkowl commented Jul 9, 2016

@hawkowl
Copy link
Member

hawkowl commented Jul 9, 2016

(also there's module-level stuff, e.g. http://twistedmatrix.com/documents/current/api/twisted.internet.endpoints.html )

@Kapeli
Copy link

Kapeli commented Jul 9, 2016

I can't make stuff in Dash hide/unhide, so I'm thinking of doing this:

  1. Only public stuff gets added to the Dash docset search index. This means you won't be able to search for any of the private stuff
  2. I enable JavaScript support so you'll be able to toggle public/private as you can in your browser, but the private stuff won't appear in Dash's table of contents at the bottom left, only public will

Would that be ok?

@glyph
Copy link
Member

glyph commented Jul 11, 2016

@Kapeli That would definitely be an improvement. Maybe these should be command-line options in doc2dash so that maintainers could have a separate, self-generated twisted-private docset?

@Kapeli
Copy link

Kapeli commented Jul 11, 2016

@hynek Could you add a command line option that would make doc2dash ignore private stuff?

@hynek
Copy link
Member

hynek commented Jul 11, 2016

I add command line options all the time. I’d need to know what exactly it would have to do to answer that. :)

@Kapeli
Copy link

Kapeli commented Jul 11, 2016

The HTML looks like this:

<tr class="instancevariable private">
    <td>Instance Variable</td>
    <td><a href="twisted.internet.endpoints.HostnameEndpoint.html#_getaddrinfo" data-type="Instance Variable" class="code">_getaddrinfo</a></td>
    <td>A hook used for testing name resolution.</td>
</tr>

So I think in https://github.com/hynek/doc2dash/blob/master/src/doc2dash/parsers/pydoctor.py#L65 you should ignore tags for which their parent parent element contains the class "private".

Sorry for not making a pull request, but my Python knowledge is a bit non-existent.

@hynek
Copy link
Member

hynek commented Jul 11, 2016

The best way forward is to open an issue on doc2dash explaining briefly what the problem is and what the solution should be.

@mthuurne
Copy link
Contributor

I think this issue has been resolved in pydoctor. If not, feel free to re-open, but please include an example of where the pydoctor output isn't as desired.

@glyph
Copy link
Member

glyph commented Jun 24, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Confirmed This issue has been confirmed by a core pydoctor dev
Projects
None yet
Development

No branches or pull requests

6 participants