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

Revise Plugins API, add plugins keyword arg for makedocs and doctest #2249

Merged
merged 3 commits into from
Sep 14, 2023

Conversation

goerz
Copy link
Member

@goerz goerz commented Sep 10, 2023

  • Add tests for the Plugin/getplugin API (testing all documented behavior)
  • Fix the documentation for Plugin/getplugin. Specifically, the documentation claimed that it was possible to pass Plugin-types instead of objects to makedocs. This didn't match either the old or the new implementation, so the docstrings have been corrected to match what is actually implemented
  • Add a plugins keyword argument to makedocs that replaces passing instances of Plugin as positional arguments (which was completely undocumented)
  • Add a plugins keyword argument to doctest to address doctest and CitationBibliography DocumenterCitations.jl#34. This is implemented by forwarding all unknown keyword arguments from doctest to the internal call of maketest. The feature is documented as "use only as directed". Alternatively, I could implement this by fowarding only plugins, but generally forwarding kwargs seems more future-proof, avoid problems where in some specific context maketest requires some argument that doctest isn't giving it.

The introduction of the plugins keyword argument is (at least arguably) a breaking change, and thus should be included in the 1.0 release. The old behavior with regards to plugins wasn't documented, but anyone who might have been passing Plugin objects as positional arguments to makedocs has to change that to a plugins keyword argument.

Most notably, users of DocumenterCitations will be affected by this.

In any case, this PR makes the API for plugins significantly more explicit.

Closes #2245

Copy link
Member

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

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

This looks great, thank you @goerz! Other than being conservative about what kwargs to pass from doctest -> makedocs, the other comments are purely cosmetic.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
src/doctest.jl Outdated Show resolved Hide resolved
src/documents.jl Outdated Show resolved Hide resolved
src/documents.jl Outdated Show resolved Hide resolved
src/documents.jl Outdated Show resolved Hide resolved
Instead of passing plugin objects to `makedocs` as positional arguments
(which was undocumented), they are now passed as a a keyword argument
`plugins`.

The docstrings of the `Plugin` type and the `getplugin` function have
been corrected. They were at best misleading, and at worst flat-out
wrong.
Forward keyword arguments from `doctest` to `makedocs`. This
includes the `plugins` keyword argument, but potentially other keyword
arguments as well.
@goerz
Copy link
Member Author

goerz commented Sep 11, 2023

Ok, I made all the changes from @mortenpi's comments.

Should be ready for merge, unless there's any more changes related to the revised more conservative approach of only passing plugins in doctest.

Copy link
Member

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! I'll leave it open for a day or two, in case there is any other feedback, but otherwise I'm be happy to merge this as is.

@mortenpi mortenpi merged commit e702132 into JuliaDocs:master Sep 14, 2023
21 checks passed
@goerz goerz deleted the plugins-api branch September 14, 2023 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a plugins keyword argument for doctests (and makedocs)
2 participants