Open
Description
Currently we don't have a Markdown template for spec documents. We should have one. Benefits include:
- Makes it easier for contributors to write spec docs.
- Ensures consistency if followed.
This could be in a file SPEC_TEMPLATE.md or similar, placed in the root directory, and linked to from WORKFLOW.md and CONTRIBUTING.md.
Inspired by @JHenneberg in #503.
Activity
JHenneberg commentedon Sep 1, 2021
Short summary of the more or less status quo. More or less because it is not consistently used over all documents:
Status
andSyntax
but missing the sectionResult Characteristics
:milancurcic commentedon Sep 1, 2021
Should Class be:
?
JHenneberg commentedon Sep 2, 2021
@milancurcic I think that would be usefull, even though there is the section
#### Syntax
it would be redundant.The
Syntax
section is not needed in the Fortran Std 2018 files because the complete function/procedure is written in the headline.Fortran Std or GCC Style:
ICHAR(C, [, KIND])
Description
Returns the code for the character in the first character position of
C
in the system’s native character set.Class
Elemental function.
Arguments
C
: shall be of type character and of length one. Its value shall be that of a character capable of representation in the processor.KIND
(optional): shall be a scalar integer constant expression.Result Characteristics
Integer. If
KIND
is present, the kind type parameter is that specified by the value ofKIND
; otherwise, the kind type parameter is that of default integer type.Result Value
The result is the position of
C
in the processor collating sequence associated with the kind type ...Example
ICHAR (’X’)
has the value 88 on a processor using the ASCII collating sequence for default characters.vs. fortran_stdlib or GCC ICHAR:
ICHAR
- Code value for characterStatus
Stable
Syntax
Description
Returns the code for the character in the first character position of
C
in the system’s native character set.Class
Elemental
Arguments
C
: shall be of type character and of length one. Its value shall be that of a character capable of representation in the processor.KIND
(optional): shall be a scalar integer constant expression.Result Value
Integer. If
KIND
is present, the kind type parameter is that specified by the value ofKIND
; otherwise, the kind type parameter is that of default integer type.The result is the position of
C
in the processor collating sequence associated with the kind type ...Example
So I guess it is mostly a discussion, which format is prefered and what should be added like @milancurcic suggested.
aman-godara commentedon Sep 7, 2021
How about we add 2 small sections in documentation with the name
troubleshooting
andcaution
?We know not everyone has the patience to go through the whole documentation only to look for the solution to the problems they are facing with a particular function. If we add a small troubleshooting section and caution section (they are not needed for all functions though but for can be quite useful for some) it will make documentation way easier to reference to.
Also, sometimes Fortan throws bad errors, so the documentation can provide some possible ways in which a user can solve those errors. It will be like a small stackoverflow in itself.
Also, at places where a feature is quite large people divide documentation as per the use case like
basic
andadvanced
assuming that not everyone importing the feature is going to be a user looking for advanced usages.aman-godara commentedon Sep 7, 2021
Also, a contributor might not be aware of markdown which GitHub uses this too can be added.
in GitHub Flavoured Markdown:
Double space + Enter
means new line.Double Enter
also means new line.space + Enter
DOESN'T mean new line and means a single space only.Single Enter
means a single spacemore than one space
means a single space only.Different websites support different markdown but mostly there is consensus.
These websites can help:
https://commonmark.org/help/tutorial/
https://guides.github.com/features/mastering-markdown/
https://www.markdownguide.org/basic-syntax/
milancurcic commentedon Sep 18, 2021
I'd like to simplify and condense the spec as much as possible so the user doesn't have to scroll down a lot to get the full picture.
What do you all think about having a "Signature" section? For example for
linspace
, it would look something like this:IMO there are a few advantages to this approach:
Then of course we have a question of how to represent signatures of generic procedures. For
linspace
, perhaps something like this:Where curly braces include all compatible types. Or, just spell out all specific signatures.
Doing so for all type kinds would probably be overkill and flood the spec page, so perhaps we can simply have a sentence at the bottom of the signature section, saying something like:
If you like this idea, let me know and I can prepare an alternative spec doc for one procedure so we can compare them side by side.
gareth-nx commentedon Sep 19, 2021
@milancurcic Yes, to me this sounds like an improvement.
JHenneberg commentedon Sep 20, 2021
@milancurcic : I agree. Especially about the generic routines. Your idea could be further extended. Instead of a text describing the
KIND
of datatype the signature could be shortened even more:Negative effect would be of course that the
KIND
needs to be added to every parameter.linspace
andlogspace
pure functions #549milancurcic commentedon Oct 5, 2021
I put together a proposal template that could be used as a mold for all spec docs: https://github.com/milancurcic/stdlib-spec-template, with a few changes from the current specs, as described in this thread:
To illustrate, I made an example spec following the proposed template. Compare it with the current version that we have.
Rationale on removing "Status" from the spec pages: While everything in stdlib is experimental, and it will be for the foreseeable future, we should simply state upfront in the README.md that everything is experimental, and unclutter the spec docs with unnecessary boilerplate. When we are ready to mark some procedures as stable, we should create a Status page where all the modules, procedures, and derived types will be listed with their statuses. But until then, having every single procedure spell out Status: Experimental on it doesn't communicate anything useful.
In summary, my motivation for this is to:
11 remaining items