Comments (2)
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.
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)
- How to use alias of AbstractArray instead of the full name? (Feature request) HOT 2
- Display parametric types in a better way? HOT 2
- Remove documentation page for v0.1
- Update CI badges in the README HOT 2
- TagBot trigger issue HOT 7
- The `TYPES` template does not apply to parametric types
- MODULES key not found for `@template` HOT 1
- Doctest failures
- Format docstrings HOT 4
- Considering writing a script to add function signatures to a code base. HOT 5
- Examples of how to use all of the functionality HOT 5
- expected test failure from the incoming `Core.Compiler` changes HOT 3
- Cannot get source for generated functions
- feature request: non-api doc marker HOT 7
- How to show default values and types of keyword arguments? HOT 1
- Update docs to latest version of Documenter HOT 5
- different abbreviations for concrete and abstract types HOT 1
- FUNCTIONNAME inside a function that generates the docstring HOT 7
- Would it be possible to add a TYPEDMETHODLIST abbreviation HOT 2
- Internal errors when (ab)using `@template` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docstringextensions.jl.