Rafostar / gtuber

C library to fetch media info from websites
https://rafostar.github.io/gtuber/
GNU Lesser General Public License v2.1
9 stars 3 forks source link

add bin/gtuber-dl/gtuber-dl.1 #53

Open josch opened 1 year ago

Rafostar commented 1 year ago

Also, one thing I am concerned here with this MAN is that it will probably get outdated constantly. What tools did you use to generate it? Can we maybe generate up-to-date manual from within meson at/after compile? How other projects are handling this?

josch commented 1 year ago

I used help2man to generate this and then did some manual editing because the output wasn't very good yet. One of the problem is what I reported to GLib here: https://gitlab.gnome.org/GNOME/glib/-/issues/3007

But even after that is fixed, I would like to caution against using help2man because if help2man is required to build, then this will break cross-compilation because it will be necessary to run a foreign architecture binary to produce the man page.

Of course I can also understand the desire to never have the man page go out-of-sync with the program it is documenting. How about the following plan:

That way, each (native) build will make sure that the man page is up-to-date while at the same time, cross builds will not need to re-generate the man page because it already exists.

What do you think?

josch commented 1 year ago

To avoid the dependency on help2man, GOptionContext could gain a new output format where instead of human-readable --help output, it would output in the roff format directly. I read glib/goption.c to create the patch I linked above and it seems that this would be quite a bit of work. And it also would not solve the problem with cross-compilation because it would also require running the binary.

Rafostar commented 1 year ago

How about storing this on git and making a git action that runs on git push, creates this file and if it differs it opens a MR with updated version?

josch commented 1 year ago

Sure, whatever works best for you! Though let me convert this pull request to a draft because:

Rafostar commented 1 year ago
  • i've never written a github action creating a MR before

Oh, it does not need to be a part of this MR. I just want us to agree on something for now. If we determine that git action would be best, then no problem we can merge this as this action would replace this file anyway later. Just there won't be probably anyone to keep updating it manually until such solution exists.

  • before committing the man page to git, I'd like to add a short description and fix the encoding problem

Yes, please do.

sp1ritCS commented 1 year ago

How about storing this on git and making a git action that runs on git push, creates this file and if it differs it opens a MR with updated version?

How about adding a git precommit hook that does the same (under the condition that the tool is installed) just without the extra MR?

Rafostar commented 1 year ago

How about adding a git precommit hook that does the same (under the condition that the tool is installed) just without the extra MR?

Also a nice idea. :+1: