Giter Site home page Giter Site logo

Documentation about stdlib HOT 35 CLOSED

milancurcic avatar milancurcic commented on May 25, 2024
Documentation

from stdlib.

Comments (35)

certik avatar certik commented on May 25, 2024 2

Let's go with stdlib-docs. We can always rename it I think. If you agree, I'll create it and set the permissions so that @zbeekman can take it from there.

from stdlib.

milancurcic avatar milancurcic commented on May 25, 2024 2

We're far from done. This should stay open.

from stdlib.

jvdp1 avatar jvdp1 commented on May 25, 2024 1

I think it would be a good time to introduce a documentation.
Several modules are now present in stdlib, and it would be useful to have some documentations to show what is already implemented to the new contributors (and users).

From the different comments, it seems that FORD could be a good tool for generating a doc from Fortran files, while @marshallward and @zbeekman proposed more complicated (better?) approaches. Should we give a try to FORD first?

from stdlib.

milancurcic avatar milancurcic commented on May 25, 2024 1

I haven't considered size. wavy docs/ is 21M, which is quite heavy, and stdlib will be bigger than this. I think it's important that stdlib repo is small and lean on disk. I think it's okay to use a separate repo, even if less elegant approach.

from stdlib.

milancurcic avatar milancurcic commented on May 25, 2024 1

Okay, I thought Org members can create new repos but maybe not. Ondrej or I can create a repo and set adequate permissions at the repo level.

For the repo name, I prefer stdlib-docs over stdlib-API-docs (redundant).

We can worry about subdomains and DNS stuff later. I own the domain so I can manage that end.

from stdlib.

certik avatar certik commented on May 25, 2024 1

Here you go, and @zbeekman is the admin for it:

https://github.com/fortran-lang/stdlib-docs

so you should be able to take it from here.

from stdlib.

certik avatar certik commented on May 25, 2024 1

@zbeekman do you still plan to get it setup https://github.com/fortran-lang/stdlib-docs? If you got busy, let us know, there is no problem. I am just asking so that we do not duplicate your work.

@jvdp1 I think we all agree we need documentation. And regarding the details, who ever is pushing this should simply choose something, get started, and then if something better comes along, we can switch. It seems FORD is the only documentation tool currently that allows to extract comments, so it might be the only option, unless we want to implement something from scratch, which I would recommend not to do initially.

from stdlib.

zbeekman avatar zbeekman commented on May 25, 2024 1

from stdlib.

jvdp1 avatar jvdp1 commented on May 25, 2024

Regarding the documention, is it planned to use some tools, like Doxygen or Ford to generate documention from the code?

from stdlib.

certik avatar certik commented on May 25, 2024

I think we should write documentation as comments in the code and generate nice html documentation from it, that way the documentation and code is at one place and easier to maintain and keep in sync. So whatever tool allows us to do that, or if we have to write or improve some tools, I think we should do that.

from stdlib.

zbeekman avatar zbeekman commented on May 25, 2024

FORD is my preference unless someone knows a good way to do that with sphinx.

I think it can be worthwhile to have additional docs. I like hosting markdown based docs on RTD and API docs on gh-pages.

from stdlib.

certik avatar certik commented on May 25, 2024

Down the road I would like to use LFortran to execute "doctests" just like in Python. Here is the issue for it: https://gitlab.com/lfortran/lfortran/issues/73

from stdlib.

ivan-pi avatar ivan-pi commented on May 25, 2024

FORD also supports the option to include additional markdown based docs (http://d3denergetic.github.io/FIDASIM/ is my favourite example).

Personally, I find the FORD generated documentation easier to navigate than doxygen. In case we decide to use FORD we should agree on the symbols to indicate documentation and whether we use preceding documentation strings or not.

I am not sure if FORD can be used together with jin2for. Does one only document the generic interface block in that case?

cc: @cmacmackin

from stdlib.

cmacmackin avatar cmacmackin commented on May 25, 2024

@ivan-pi I've never used jin2for so I can't be certain. However, FORD does allow files to be preprocessed prior to it parsing for documentation, so that could work. You'd probably want to give a detailed explanation only in the generic blocks, but still document the arguments in each specific implementation.

from stdlib.

marshallward avatar marshallward commented on May 25, 2024

MOM6 uses Doxygen-style comments, but these are converted into reST files which are then passed onto Sphinx.

An example Doxygen-marked file: https://github.com/NOAA-GFDL/MOM6/blob/dev/gfdl/src/parameterizations/vertical/MOM_vert_friction.F90

This uses the !<and !! syntax for marking up variables, subroutines, etc.

The Doxygen XML is then converted to reST by a local tool developed by a former visitor (itself forked from another project): https://github.com/angus-g/sphinxcontrib-autodoc_doxygen

although we are looking to migrate to this tool: https://github.com/vovkos/doxyrest

Once it's been converted to reST, then we just run it through the usual Sphinx process.

This is the generated output: https://mom6.readthedocs.io/en/dev-gfdl/api/generated/modules/mom_vert_friction.html#f/mom_vert_friction

Some limitations of the above system are that the Doxygen -> reST process depends on an unsupported tool which only exposes a fraction of the Doxygen content, and that there are apparently bugs inside of Doxygen's Fortran support which prevent adoption of doxyrest (which is a supported tool). We have someone here working on this problem, but it's not ready to go at this moment.

Not necessarily advocating this approach BTW, only hoping to show what alternatives are out there and what is possible.

I agree with others that the native Doxygen output is not that pleasant to navigate, and I don't think we'd continue to use it if we didn't have the pipeline above.

from stdlib.

zbeekman avatar zbeekman commented on May 25, 2024

I am not sure if FORD can be used together with jin2for. Does one only document the generic interface block in that case?

I usually generate the sources with jin2for then run FORD on those.

from stdlib.

zbeekman avatar zbeekman commented on May 25, 2024

I do quite like Sphinx but the Doxygen to Sphinx pipeline seems complicated. Ideally whichever tool we choose will be Fortran aware enough to provide additional useful information beyond the source file markup.

For high-level documentation I really like read-the-docs and using mkdocs. E.g., https://zstdfortranlib.readthedocs.io/en/latest/?badge=latest (WIP)

from stdlib.

certik avatar certik commented on May 25, 2024

from stdlib.

cmacmackin avatar cmacmackin commented on May 25, 2024

from stdlib.

certik avatar certik commented on May 25, 2024

from stdlib.

zbeekman avatar zbeekman commented on May 25, 2024

A question for @milancurcic and @certik: Should we host FORD API documentation with github pages? If so then I suggest we pick one of the following approaches for hosting and then deploy the documentation during CI.

Approach 1

Publish API documentation as part of this repository using an orphan gh-pages branch. This would replace the readme at http://fortran-lang.org with the FORD documentation, but the landing page could include the readme.

Approach 2

Create a new github repo to host the FORD API documentation and tweak the DNS settings for fortran-lang.org to point something like api-docs.fortran-lang.org to the documentation published in the other repository. I'd be happy to lead administering that documentation repo and help to setup a GitHub action to publish with FORD.

from stdlib.

certik avatar certik commented on May 25, 2024

I would do the second approach and use a url docs.fortran-lang.org. That way we can keep the landing page separate from the documentation. If you could set it up, that would be awesome.

from stdlib.

milancurcic avatar milancurcic commented on May 25, 2024

I think approach 2 is better if we're considering landing page for fortran-lang to be its own thing eventually (separate from stdlib). I think we should as the fortran-lang website should encompass more than just stdlib -- eventually fpm, getting started, resources etc.

As for the stdlib landing page, it makes sense to me that it goes together with the documentation. For example, FORD docs for wavy include the README as the landing page: https://wavebitscientific.github.io/wavy/

If we make the Org (fortran-lang) GH page to be fortran-lang.org, then the GH page for stdlib will automatically become fortran-lang.org/stdlib, which I think is the most meaningful and intuitive url. docs.fortran-lang.org would make sense at the time being, but would be confusing when fortran-lang.org transcends stdlib.

from stdlib.

milancurcic avatar milancurcic commented on May 25, 2024

Sorry, on re-reading Zaak's question and my response, I'd like to take that back.

If we agree that stdlib landing page + docs make sense as one website (I think they do, see the wavy example; FORD just tacks on documentation pages and styles it, but you still need a meaningful landing page for the docs), then I would do FORD docs as a GH site in the existing repo (stdlib), just as the current website is. So this is approach 1.

When we need other websites, they can go in their own repos:

  • fortran-lang home page as Org-level GH website;
  • fpm website and docs in the fpm repo;
  • and so on

from stdlib.

milancurcic avatar milancurcic commented on May 25, 2024

Publish API documentation as part of this repository using an orphan gh-pages branch

Alternative (and my preference) to gh-pages branch is to have a docs/ directory in master.

from stdlib.

certik avatar certik commented on May 25, 2024

I would not put any auto generated files (such as FORD docs) into the stdlib repository, otherwise everybody has to clone it all the time, increasing the download traffic and download time. I would definitely not put it into the docs/ directory into the master branch, but I would not even put it into the gh-pages branch (because it still gets cloned, and forked, etc.). Instead, let the stdlib repository CI generate the docs, and push them to a separate repository. That separate repository will then get hosted at some url online (we can discuss where).

from stdlib.

zbeekman avatar zbeekman commented on May 25, 2024

OK, I think the 3 of us are in agreement that we'll put the FORD API docs into a separate repository. If this is true, what should we call the repository (on github, separate from what the URL is)? If we create an org page later, then I think something like fortran-lang/stdlib-docs, fortran-lang/stdlib-API-docs or similar would be the best bet because it will be accessible at fortran-lang.org/stdlib-docs. For the near-term a dns entry like api.fortran-lang.org or stdlib-docs.fortran-lang.org etc. would be a good place to start.

FYI I don't have sufficient org permissions to create a repo under the fortran-lang organization. So if we can pick a good name and then someone create it that would be great. Having owner or admin perms on the documentation repo might be needed/helpful, but I can try to do what I can with push only access and see if I run into any issues. I'd also be happy to help out with DNS provider stuff etc etc but figuring out credentials and permissions/roles can be tricky so I'll defer to you guys.

from stdlib.

milancurcic avatar milancurcic commented on May 25, 2024

Perfect, let's do it.

from stdlib.

leonfoks avatar leonfoks commented on May 25, 2024

I've had great success with Ford. Markdown makes it super easy to include code snippets to help a user.

I might have missed this being stated somewhere, but is there a strict requirement for documentation of all functions and subroutines. If not I think that should be added to the style guide? or somewhere else. Having documentation debt is worse than having to use MPI in R.

Once the tool is decided on, a set of example style guides for functions, subs, interfaces, derived types, modules and submodules would be nice to follow. (I can help with this if needed)

Finally, having docs for the arguments of functions is nice, but having usability code snippets really helps too. Something like this which produces these docs using Ford. This is also an example of when to ignore the dependency diagram :P

from stdlib.

zbeekman avatar zbeekman commented on May 25, 2024

Once the tool is decided on, a set of example style guides for functions, subs, interfaces, derived types, modules and submodules would be nice to follow. (I can help with this if needed)

This would be great. As a place to start collecting this, we could create a page (or pages) on the wiki while we get automated documentation bootstrapped and deployed. Then, since it's markdown, we can migrate it to FORD. I think FORD also has a warning flag to catch un-documented entities that we could integrate into the CI process to try to ensure properly documented code.

Finally, having docs for the arguments of functions is nice, but having usability code snippets really helps too.

I agree. I just helped a colleague figure out how to grab items from an array of json objects with JSON Fortran. There is great API documentation in that great project (I may be biased here...) but there are not as many examples as there could be. Or at least easy to find examples.

from stdlib.

jvdp1 avatar jvdp1 commented on May 25, 2024

Found this issue back. Is it any agreements on this topic?

from stdlib.

certik avatar certik commented on May 25, 2024

@zbeekman that would be awesome! We'll wait.

from stdlib.

milancurcic avatar milancurcic commented on May 25, 2024

@zbeekman Let us know if you need any help with this.

from stdlib.

zbeekman avatar zbeekman commented on May 25, 2024

Should this be closed now that #183 is merged, or should we keep it open?

from stdlib.

milancurcic avatar milancurcic commented on May 25, 2024

FORD has been working quite well for stdlib and more recently for fpm as well.

I will close this and we will continue to pursue user-facing docs in #182, and if we need to revisit developer docs, we will open a dedicated issue for that.

from stdlib.

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.