avrdudes / avrdude

AVRDUDE is a utility to program AVR microcontrollers
GNU General Public License v2.0
716 stars 137 forks source link

Auto-build avrdude.pdf from texinfo sources #1847

Closed ndim closed 1 month ago

ndim commented 2 months ago

Originally posted by @stefanrueger in https://github.com/avrdudes/avrdude/issues/1842#issuecomment-2258214165 but I am creating a new issue as this is very much unrelated to that issue. The following words are from @stefanrueger, not mine.

It occurred to me that the avrdude.pdf documentation is installed somewhere on the user's destination system, but (as far as I am aware!) it isn't available in the avrdude repository for reference.

So, when discussing issues it is not possible for us maintainers to refer to the documentation of the current git-main avrdude other than saying something like "Find out where avrdude.pdf is installed on your system and look at Section 3.2"... This is bizarre.

What would be a good way to keep a current avrdude.pdf document (ideally created automatically when commits/merges happen to git main) in the repository? Ideally this would reside in a top-level directory such as documentation. Thoughts? @ndim @mcuee @dl8dtl @MCUdude

stefanrueger commented 2 months ago

To clarify: I realise that the documentation for releases resides in https://avrdudes.github.io/avrdude/. What I'm after is a current avrdude.pdf somewhere in the repository.

ndim commented 1 month ago

The avrdude manual is written in Texinfo. The info command for Texinfo replaced man pages with hypertext, in a time when neither HTML nor PDF had been invented yet. Since then, conversions to a number of output formats have been added: The original info files for the info command, a PDF file, one HTML file or a set of HTML files, a Postscript file, etc.

There are a few ways to put a generated avrdude.pdf alongside its texinfo source files inside the avrdude git repo, but none is nice.

Generating a set of HTML pages or a single HTML page version of the info page to replace the PDF version avrdude.pdf could help with some of the problems: No binary diffs to see, no binary diffs to merge. There would still be the issues of different tool versions producing same-but-technically-different outputs.

There is simply no good solution in sight when compiling doc sources into another format and insisting on keeping the result in the same place.

Switching the doc sources to a format with better readability like e.g. markdown could help here. Markdown would give people something which can be easily read and written in any text editor. However, that would mean we lose the info page which is quite convenient on systems which have the info program. I have also not checked how much work that conversion would be, and about other cross-dependencies (where the avrdude info uses special texinfo features, or other texinfo documentation uses avrdude.info). Markdown can still be compiled to PDF and/or HTML, just by using a different toolchain.

ndim commented 1 month ago

And in the mean time, do we really still need to build POSTSCRIPT output avrdude.ps? Is there anybody still using postscript in 2024?

I would like to just build PDF and HTML (and info for systems where that makes sense).

stefanrueger commented 1 month ago

Thanks for the detailed analysis, @ndim. Wow, complete automation sounds difficult with distinct disadvantages...

I was wondering whether a semi-automated mechanism would help. What is involved in having make/cmake/automake update somewhere in the repo with a certain switch (or whenever cmake runs and the sources have changed)? That file could be in .gitignore, so not "seen" when using git. I could imagine using a little shell script that copies that most recent avrdude.pdf version to the repo's /documentation/avrdude.pdf (which would be part of the repo) and committing that version together with NEWS everytime I update NEWS at the end of a mergefest. That way, we'd have a periodically updated documentation of git main.

And yes, I am not aware of anyone using avrdude.ps (I wasn't aware it is produced either). So as far as I am concerned PDF and HTML is just what's needed.