Coder Social home page Coder Social logo

Comments (16)

mwhudson avatar mwhudson commented on September 23, 2024

(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.

from pydoctor.

hawkowl avatar hawkowl commented on September 23, 2024

Is this done to some reasonable satisfaction? @glyph

from pydoctor.

glyph avatar glyph commented on September 23, 2024

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.

from pydoctor.

hawkowl avatar hawkowl commented on September 23, 2024

@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?

from pydoctor.

hynek avatar hynek commented on September 23, 2024

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

from pydoctor.

Kapeli avatar Kapeli commented on September 23, 2024

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.

from pydoctor.

hawkowl avatar hawkowl commented on September 23, 2024

@Kapeli here's one: http://twistedmatrix.com/documents/current/api/twisted.internet.endpoints.HostnameEndpoint.html

from pydoctor.

hawkowl avatar hawkowl commented on September 23, 2024

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

from pydoctor.

Kapeli avatar Kapeli commented on September 23, 2024

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?

from pydoctor.

glyph avatar glyph commented on September 23, 2024

@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?

from pydoctor.

Kapeli avatar Kapeli commented on September 23, 2024

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

from pydoctor.

hynek avatar hynek commented on September 23, 2024

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

from pydoctor.

Kapeli avatar Kapeli commented on September 23, 2024

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.

from pydoctor.

hynek avatar hynek commented on September 23, 2024

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

from pydoctor.

mthuurne avatar mthuurne commented on September 23, 2024

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.

from pydoctor.

glyph avatar glyph commented on September 23, 2024

from pydoctor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.