Skip to content

Commit

Permalink
doc: document new page/attachment events
Browse files Browse the repository at this point in the history
Adds documentation on the recently added events with publishing pages
and attachments. This also includes an update to the metadata directive
of the recently supported GUID option.

Signed-off-by: James Knight <[email protected]>
  • Loading branch information
jdknight committed Oct 14, 2024
1 parent 39e01f3 commit 81db3e8
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/directives.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ Common
.. versionadded:: 1.3
.. versionchanged:: 2.2 Added ``editor`` and ``full-width`` support.
.. versionchanged:: 2.8 Added ``guid`` support.

The ``confluence_metadata`` directive allows a user to define metadata
information to be added during a publish event. This directive supports the
Expand Down Expand Up @@ -237,6 +238,13 @@ Common
See also :lref:`confluence_full_width`.
.. rst:directive:option:: guid: value
:type: string
Assign a user-managed GUID value for a page. This value can be
shared in a subset of :doc:`events <events>` generated by this
extension.
.. rst:directive:option:: labels: value
:type: space separated strings
Expand Down
41 changes: 41 additions & 0 deletions doc/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@ The following outlines additional `events`_ supported by this extension.
Generic events
--------------

.. event:: confluence-publish-attachment (app, docname, key, aid, meta)

:param app: :class:`.Sphinx`
:param docname: ``str`` of the document name
:param key: ``str`` of the attachment key
:param aid: ``int`` of the upload id of the published attachment
:param meta: ``dict`` of additional metadata for this event

Emitted when this extension has completed the upload of an attachment.

.. versionadded:: 2.8

.. event:: confluence-publish-page (app, docname, pid, meta)

:param app: :class:`.Sphinx`
:param docname: ``str`` of the document name
:param pid: ``int`` of the upload id of the published page
:param meta: ``dict`` of additional metadata for this event

Emitted when this extension has completed the upload of a document.

.. versionadded:: 2.8

.. event:: confluence-publish-point (app, point_url)

:param app: :class:`.Sphinx`
Expand All @@ -16,6 +39,24 @@ Generic events

.. versionadded:: 2.6

Advanced events
---------------

.. event:: confluence-publish-override-pageid (app, docname, meta)

:param app: :class:`.Sphinx`
:param docname: ``str`` of the document name
:param meta: ``dict`` of additional metadata for this event
:returns: ``int | None`` of the new page identifier

Emitted when this extension is about to determine the page identifier
to publish a document. A configuration and register this event and
return a new identifier to use for a page. If ``None`` is returned,
the extension will operate in the same manner as if no override was
provided.

.. versionadded:: 2.8

.. references ------------------------------------------------------------------
.. _events: https://www.sphinx-doc.org/en/master/extdev/event_callbacks.html

0 comments on commit 81db3e8

Please sign in to comment.