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

doc: Add a tutorial how to write plugins #1034

Merged
merged 7 commits into from
Jan 2, 2024
Merged

Conversation

jan-kolarik
Copy link
Member

Documentation updates cover the following aspects:

  • DNF5 and LIBDNF5 plugins
  • Example template codes
  • Purpose of plugins
  • Deployment description

Closes #287.

@jan-kolarik jan-kolarik force-pushed the jkolarik/plugins-docs branch from a76e721 to a24e098 Compare November 22, 2023 09:24
@inknos inknos self-requested a review November 27, 2023 13:49
doc/tutorial/plugins/index.rst Outdated Show resolved Hide resolved
doc/tutorial/plugins/index.rst Outdated Show resolved Hide resolved
doc/tutorial/plugins/dnf5-plugins.rst Outdated Show resolved Hide resolved
doc/tutorial/plugins/dnf5-plugins.rst Outdated Show resolved Hide resolved
doc/tutorial/plugins/dnf5-plugins.rst Outdated Show resolved Hide resolved
doc/tutorial/plugins/libdnf5-plugins.rst Outdated Show resolved Hide resolved
doc/tutorial/plugins/libdnf5-plugins.rst Outdated Show resolved Hide resolved
doc/tutorial/plugins/libdnf5-plugins.rst Outdated Show resolved Hide resolved
doc/tutorial/plugins/libdnf5-plugins.rst Outdated Show resolved Hide resolved
doc/tutorial/plugins/libdnf5-plugins.rst Outdated Show resolved Hide resolved
Copy link
Collaborator

@inknos inknos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only have a small review on the code. Then LGTM

doc/templates/dnf5-plugin/template_cmd_plugin.cpp Outdated Show resolved Hide resolved
doc/templates/libdnf5-plugin/template.cpp Outdated Show resolved Hide resolved
@j-mracek j-mracek self-assigned this Dec 6, 2023
constexpr const char * attrs[]{"author.name", "author.email", "description", nullptr};
constexpr const char * attrs_value[]{"Fred Fedora", "[email protected]", "Plugin description."};

class TemplateCmdPlugin : public IPlugin {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to add a comment for the class and each of its methods, including inheritance.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask you to add class documentation for class IPlugin?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've provided some additional brief docstrings for the IPlugin classes in dnf5 and libdnf5 namespaces. Please let me know if more detailed information would be appropriate.

[main]
name = template
enabled = yes
version = 1.0.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is configuration file mandatory? Is any of the keys mandatory? How the version key is used? May be I overlooked something and it is described in documentation somewhere.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried to make it more explicit in the docs text and I've also added a comment into the example configuration file.

@jan-kolarik jan-kolarik force-pushed the jkolarik/plugins-docs branch from 731b72b to 0cca56f Compare December 8, 2023 14:58
@jan-kolarik
Copy link
Member Author

I've tried to address all comments. Please let me know if I've missed anything.

@j-mracek
Copy link
Contributor

j-mracek commented Jan 2, 2024

LGTM

@j-mracek j-mracek added this pull request to the merge queue Jan 2, 2024
Merged via the queue into main with commit 5a8dbd7 Jan 2, 2024
12 of 14 checks passed
@j-mracek j-mracek deleted the jkolarik/plugins-docs branch January 2, 2024 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Create documentation regarding plugins
3 participants