Coder Social home page Coder Social logo

Comments (5)

mwhudson avatar mwhudson commented on September 23, 2024

(by exarkun)

from pydoctor.

mwhudson avatar mwhudson commented on September 23, 2024

(by mwhudson)
Ah. I think I know what's happening here: it's pydoctor's hackish way of extracting a summary line. For the table of contents, pydoctor takes the first non-blank line of ths docstring. In this case it's just "B{foo", which is unsurprisingly an error. It works fine for formatting the main docstring.

Not sure what to do about this.

from pydoctor.

mwhudson avatar mwhudson commented on September 23, 2024

(by rich-noir)
Just ran into the same problem. Took a bit to track down what the problem actually is as the line numbers on the error message are useless.

Just knowing that it's the first line is helpful. I'd noticed truncation but hadn't yet twigged to it being the first line.

I can work around that.

from pydoctor.

mwhudson avatar mwhudson commented on September 23, 2024

(by mwhudson)
Hm, the line numbers shouldn't be useless -- can you file a separate bug about that?

Ideas for better summary-extracting heuristics would be good. I think there is some mileage in taking the content up to the first blank line, unless that gets you more than say 200 characters, in which case you drop back to what we do know. Or you could try to do the truncation by processing the fully rendered complete docstring -- take the first paragraph level element or something. Or you could add some options to control this, but I don't really like this idea.

There's never going to be a clean answer for this.

from pydoctor.

mwhudson avatar mwhudson commented on September 23, 2024

(by mwhudson)
I think the way pydoctor extracts summaries now is much less likely to hit this problem, so closing.

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.