#302 Document Fedora Hubs Widgets
Closed by abompard. Opened by jcline.
jcline/fedora-hubs document-widgets  into  develop

Download 302.patch

Widgets in Hubs have an interface they are expected to implement. This
formally defines and documents this interface as Sphinx docblocks in
code. The docblocks are then rendered to HTML using the Sphinx autodoc
plugin as part of a new API section of the documentation project. This
replaces the separate API documentation for widgets originally found in
the dev guide. This has the advantage of creating a single source of
truth for API documentation.

This commit does introduce a new Widget class to define the
interface. It should function in the same way as the widgets currently
defined at the module level and truthfully only serves to bundle the
interface into one neat object within the module.

I'm interested to hear what people think about implementing widgets as modules
or as classes. They're pretty much equivalent and both approaches should work,
but we should pick one way or the other and document it. If we want to use the
module approach, I can probably move the docblocks around and fiddle with sphinx
a bit to make the documentation still work and make sense.

To get a good idea of what this looks like, just build the docs with make html and then
navigate to the api.html page.

Signed-off-by: Jeremy Cline jeremy@jcline.org

rebased

rebased

I'd recommend filing this TODO as a ticket instead of putting it here, or at least in addition to putting it here.

LGTM, though it's conflicting.

I was hoping someone would enlighten me as part of the PR review process :(

rebased

Okay, I've rebased and fixed the conflict. I spent a while investigating the chrome function and I think it's best to remove it since I believe its functionality is equivalent to setting the render function directly.

Yeah, the chrome function isn't really useful, it can be replaced with template blocks.

I've started working on a class-based implementation of the widgets like the one you suggest (not exactly, but in this direction), and it's taking shape! Give me a couple days more and I'll have something to propose that will be more extendable, more modular, and with less magic :-)

My branch is merged now, I believe this pull request can be closed.

Pull-Request has been closed by abompard

Metadata