Giter VIP home page Giter VIP logo

Comments (2)

MichaelHatherly avatar MichaelHatherly commented on July 22, 2024

It would allow more freedom in how the abbreviations can be integrated into docstrings.

The problem with that of course is that different packages might start using different naming schemes, such as Arguments vs Args vs Parameters. I'm not totally against the idea, though it should be kept in mind if we decide to leave out headers.

I think according to the manual the idiomatic way to write docstrings is to have the signature code blocks as the first thing in the docstring, and there we definitely don't need the heading

That convention is only due to genstdlib.jl and the RST manual needing to find docstrings based on their first code block. It's only idiomatic by necessity really. Once we get the manual moved over to markdown I think it would be best to begin revisiting the current conventions. For example, starting a docstring with a short one line paragraph describing the object may be better in some cases than launching directly into the signature. It very much depends on what's being documented I think.

I would propose changing the semantics so that the abbreviation would generate only the list/block/etc. and would not decorate it.

Perhaps we could have it both ways and allow abbreviations to "turn off" the header if needed. Something like:

"""
$(SIGNATURE)
# Fields

$(!FIELDS)
"""

where we add a Bool field to the Abbreviation subtypes and define ! to negate it. I think we'd need to actually test that out to see whether it's not too complex/confusing.


Another thing that could potentially help us is a docstirng linting package (DocStringLinter.jl probably) that checks whether docstrings are being written in accordance with the guidelines we end up settling on, whatever they may be.

from docstringextensions.jl.

MichaelHatherly avatar MichaelHatherly commented on July 22, 2024

Having scanned over some of the HTML docs that have "Signature" headers it does look quite verbose, so I think this probably is a worthwhile change to make. As you say, we can manually add a header when actually needed.

from docstringextensions.jl.

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.