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

Docs: Update template code, documentation page for the DNF5 Command Template #1994

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ferdnyc
Copy link

@ferdnyc ferdnyc commented Jan 8, 2025

Recently on Fedora Discussions, it was brought up / discovered that the template source code in the DNF5 documentation had fallen a bit out of date, to the point where it wasn't even compilable because the internal APIs have changed so much in two years.

Since it actually says, right at the top of that page:

Note

This code is thought to be self explanatory. You should be able to copy the snippets, following the directory structure and naming shown above each one.

...It seemed clear that it was no longer remotely achieving that goal.

So, I went through and updated all of the included source code based on the current dnf5/commands/ source and dnf5/main.cpp, built and tested the template source integrated into DNF5 (as a new dnf5/commands/template/ directory, just like the note says), and also updated the sample output at the end to reflect reality.

I hope to do the same for the other two template documents, as well, but we'll see what happens. I wanted to at least submit this one for now, and I'll take the rest one step at a time.

The `.. literalinclude::`s for the code in `doc/templates/command/`
were using `:lines:` arguments that excluded the first line, which
is the `#ifndef` for the include guards. That's kind of important.
Bring code in `doc/templates/command/` up to date with latest
internal API changes; code tested and working when compiled in
to current HEAD codebase.
- Add a section heading for each file
- Move filenames to listing captions
- Make integration instructions into a section, and add a CAUTION
  admonishment that plugin authors should ignore it
- Link from caution message to next template (DNF5 Plugin Template)
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.

1 participant