Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor documentation regarding consistency #503

Merged

Conversation

JHenneberg
Copy link
Contributor

@JHenneberg JHenneberg commented Aug 31, 2021

Could someone link the file to where the documentation standard is desribed?

I was reading through some documents in doc/specs and realised differenced between those documents.
Mostly the layout looks like following:

---
title: <MODULE_NAME>
---

# The `<MODULE_NAME>` module

[TOC]

## Introduction

## <OPTIONAL_SECTIONS>

## Procedures and methods provided

### `<PROCEDURE_NAME>` - <SHORT_DESCRIPTION>

#### Status

#### Description

#### Syntax

#### Class

#### Argument

#### Result Value

#### Example

stdlib_ascii.md and a lot of other modules are following this convention, but some do not. Sometimes the order of the subsections describing the procedures are different or some subsections are missing. In other documents the hierarchy level is changed. Do you feel there is a need to address this issues? Should this be continued to be discussed in #181 ?

added section `Introduction`
added section `Procedures and methods provided`
adjusted level of procedure description
@milancurcic
Copy link
Member

Thanks, @JHenneberg and good question. I don't think we have a template for this, and I think we should. @jvdp1 @ivan-pi what did you use as reference when creating the first spec docs in stdlib?

@jvdp1
Copy link
Member

jvdp1 commented Aug 31, 2021 via email

Copy link
Member

@milancurcic milancurcic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me, thanks @JHenneberg.

Copy link
Member

@awvwgk awvwgk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sharing, looks good to me.

@milancurcic
Copy link
Member

@JHenneberg I see WIP in the title--would you like to work more on this PR or should we merge it?

@JHenneberg
Copy link
Contributor Author

I wanted to work more on it, but now that there is a discussion going on about the spec_template.md it can be merged, because depending what changes might come it could be double the work.

@JHenneberg JHenneberg changed the title WIP: refactor documentation regarding consistency refactor documentation regarding consistency Sep 4, 2021
@milancurcic milancurcic merged commit 86ed2f3 into fortran-lang:master Sep 5, 2021
@aman-godara
Copy link
Member

How about we add 2 small sections in documentation with the name troubleshooting and caution?
We know not everyone has the patience to go through the whole documentation only to look for a particular function they are looking for. If we add a small troubleshooting section and caution section (they are not needed for all functions though but for some) as per the use case it will make documentation way easier to reference to.

For example, if a person is using find function of stdlib_strings and got stuck, well then probably it is because the output of the function is 0 (suggesting that the input substring was NOT FOUND) which can be added in caution section.

or if a person is using slice function and got weird outputs then probably because of the person hasn't specified stride argument which then automatically got deduced by the function leading to smart behaviour (which the user doesn't want and wasn't aware of) so this can be added in troubleshooting section for slice function.

Also, sometimes Fortan throws bad errors, so the documentation can provided some possible ways in which a user might have added errors when using a function.
For example, if you give integer indexes to a stringlist, it gives 'binding not found error' which doesn't say that use fidx and bidx instead of integer index.

@aman-godara
Copy link
Member

aman-godara commented Sep 6, 2021

Also, removing those trailing double spaces which looked useless make .md file (markdown) look different:

image

taken from https://stdlib.fortran-lang.org/page/specs/stdlib_string_type.html#to_title-function.

in .md files (markdown):
Double spaces + Enter means new line. Double Enter also means new line.
space + Enter DOESN'T mean new line and means a single space only.
Enter means a single space
more than one space means a single space only

Previously with double spaces this used to look like this:

image

taken from GitHub and NOT from https://stdlib.fortran-lang.org

To try out one can use https://www.markdowntutorial.com or some other website but the point is that markdown files look different when viewed on GitHub from what they do when we are editing them on some editor like VS Code.

Those single spaces before Enter, I never knew, turned out to be redundant.

@@ -1350,7 +1350,7 @@ program demo
use stdlib_string_type
implicit none
type(string_type) :: string, reverse_string

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These double spaces are redundant because the two Enters did the job here of creating a new line

@JHenneberg
Copy link
Contributor Author

JHenneberg commented Sep 7, 2021

Also, removing those trailing double spaces which looked useless make .md file (markdown) look different:

image

taken from https://stdlib.fortran-lang.org/page/specs/stdlib_string_type.html#to_title-function.

in .md files (markdown):
Double spaces + Enter means new line. Double Enter also means new line.
space + Enter DOESN'T mean new line and means a single space only.
Enter means a single space
more than one space means a single space only

Previously with double spaces this used to look like this:

image

taken from GitHub and NOT from https://stdlib.fortran-lang.org

To try out one can use https://www.markdowntutorial.com or some other website but the point is that markdown files look different when viewed on GitHub from what they do when we are editing them on some editor like VS Code.

Those single spaces before Enter, I never knew, turned out to be redundant.

Ok Interesting. Did not know about this double space feature, but I guess its better because more intuitive to do this similar to LaTeX using double Enter for new line.

Can you add this information to #504 ?

And this too:

How about we add 2 small sections in documentation with the name troubleshooting and caution?
We know not everyone has the patience to go through the whole documentation only to look for a particular function they are looking for. If we add a small troubleshooting section and caution section (they are not needed for all functions though but for some) as per the use case it will make documentation way easier to reference to.

For example, if a person is using find function of stdlib_strings and got stuck, well then probably it is because the output of the function is 0 (suggesting that the input substring was NOT FOUND) which can be added in caution section.

or if a person is using slice function and got weird outputs then probably because of the person hasn't specified stride argument which then automatically got deduced by the function leading to smart behaviour (which the user doesn't want and wasn't aware of) so this can be added in troubleshooting section for slice function.

Also, sometimes Fortan throws bad errors, so the documentation can provided some possible ways in which a user might have added errors when using a function.
For example, if you give integer indexes to a stringlist, it gives 'binding not found error' which doesn't say that use fidx and bidx instead of integer index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants