I started working on a page for the fpm user documentation. There is a lot of work that still needs to be done and various details that must be figured out, but the general structure is already in place:
four main parts of documentation: tutorials, recipes, design and references.
multilingual support (English and a partial German translation)
a news section to announce new releases, conference talks and new packages
Help is very welcome, feel free to contribute tutorials or recipes, help us formulate the design principles behind fpm or improve the references and specifications.
Also, we can translate the docs . If you would like to contribute a translation, just search for the de identifiers in the Makefile and the pages/conf.py to add a new language and run
make gettext
The po files will appear in the locale/<lang> directory and you can start translating!
@tomohirodegawa has just created Examples of Fortran-stdlib. The readme.md is in Japanese, and Google Translate in Chrome can nicely render it in English. Someone could fork it and create an English version.
A fifth part could be added: discussions. Most code in stdlib has one or more related issues where it has been discussed. If related discussions were listed for each source file, that would help to fill in the reference information, since people have often provided links to references when discussing algorithms. Reading discussions could also tell users why algorithms were chosen and what the alternatives are.
Discussion fit well in the existing categories, they would be part of the design documents for explaining the background of the respective parts of fpm.
I’m also planning to have some meta-documentation on the docs themselves to clarify points like this, see
Thanks to Vincent @vmagnin for bring this framework to my attention.
Excellent idea. Indeed, we should link all discussions for each module in stdlib. I think the discussions are usually related to the whole module, not just a single file.
I updated the documentation with a tutorial for using dependencies in fpm: Adding dependencies — Fortran package manager. Feedback is very welcome. Also, I’m looking for other tutorial and how-to ideas (maybe we can do a tutorial using fftpack?).
Thanks to @zoziha and @alozada we now have also multilingual fpm documentation. Most pages are available in Chinese, Spanish and German. Let us know how good we are doing with those translations, at least for me writing technical documentation in German is kind of a new thing
While building up the pages we stumbled upon a couple of issues with the framework we are using
Nice. In the section on dependencies, a link to the fpm registry and a mention of fpm-search would be nice. Note there is a getline function in M_io. The examples could be added to the
fpm example repostory, or a new repository could be started with the examples.
The source code for the tutorial is available here as fpm project. I’m using a literalinclude in the tutorial source to include parts of the source code as needed, with the right structuring I can incrementally build up files like the package manifest while walking the reader through the steps.
The basic idea of the two getlines is the same except mine is implemented as a function instead of a subroutine, so assuming it will be discussed it does not matter what it starts with much. I actually thought there was one in like that in stdlib already. Mine does a few odd things with using a local string and then copying it to the output at the end because of some old issues with allocatable character variables. A few things to note is that the algorithm does not work robustly if PAD=‘YES’ is not set on the input file, and that if the file is not open as a stream you technically run into problems if the system line length limit is hit; but there is no good way to open stdin as a stream in Fortran. Now-adays those limits are set so large they are very unlikely to cause a problem, and it is somewhat up to the compiler what happens anyway.
This is a very good idea and makes some things clearer for me. I have a request:
As a solely Windows user I have never used a package manager and did not even know about such tools until I started looking at Python. Is it maybe possible to add an introduction that explains what it is, the need for a package manager and why I need it on Windows. A large number of Windows users work only in tools like Visual Studio and never do any compiling or running from a command window.
and other discussions about how to integrate fpm into IDE packages. Are you more interested in
how to use fpm from IDEs and GUIs or the pros of using a terminal/CLI interface? I think both topics would be good to have materials gathered into tutorials on, but given the choice which are you most interested in?
Sebastian @awvwgk , I have now some time to work on a French translation of fpm-docs. I have successfully forked it and configured it for French, except that I don’t see anything related to language identifiers in pages/conf.py. And in the left margin of the compiled site, the “fr” identifier does not appear (but I can access file:///home/osboxes/fpm-docs/_build/html/fr/index.html with my browser).
I plan to use poedit and DeepL to accelerate the work (I have found 246 text blocks to translate).
Any help for the French translation will of course be welcome
@awvwgk
I have just forked the latest fpm-docs.
If I just put fr in the Makefile and in pages/_templates/sbt-sidebar-footer.html, then type the $ make gettext command, I can see that some files of the other languages are also modified:
$ git status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: Makefile
modified: locale/de/LC_MESSAGES/index.po
modified: locale/es/LC_MESSAGES/index.po
modified: locale/zh_CN/LC_MESSAGES/index.po
modified: locale/zh_CN/LC_MESSAGES/tutorial.po
modified: pages/_templates/sbt-sidebar-footer.html
I am confused and I don’t know if this is OK.
For example, the git diff command shows in the locale/de/LC_MESSAGES/index.po file changes like:
-#: ../../pages/index.md:122
+#: ../../pages/index.md:123
+msgid "{fa}`cubes` Registry"
+msgstr ""
+
+#: ../../pages/index.md:125
+msgid ""
+"There are already many packages available for use with fpm, providing an "
+"easily accessible and rich ecosystem of general purpose and high-"
+"performance code. For a full list of packages checkout the [fpm "
+"registry](https://fortran-lang.org/packages/fpm). New packages can be "
+"submitted to the registry [here](https://github.com/fortran-lang/fpm-"
+"registry)."
+msgstr ""
+
+#: ../../pages/index.md:130
msgid "{fa}`newspaper` News"
msgstr "{fa}`newspaper` Aktuelles"
-#: ../../pages/index.md:124
+#: ../../pages/index.md:132
Should I commit only the changes in the fr files? Or commit all?
The gettext target will always update all po files, in case they don’t match the latest page source anymore. Which is okay, just ignore the language files you are not interested in.