Skip to content

Commit

Permalink
Use dedicated descriptions for MV2 and MV3 properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jobisoft committed Apr 7, 2023
1 parent 2161e9d commit d289b65
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Manifest file properties

A *dictionary object* defining one or more commands as *name-value* pairs, the *name* being the name of the command and the *value* being a :ref:`commands.CommandsShortcut`. The *name* may also be one of the following built-in special shortcuts:

* :value:`_execute_action`
* :value:`_execute_browser_action`

* :value:`_execute_compose_action`

Expand Down
2 changes: 2 additions & 0 deletions compose.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,8 @@ Used by various functions to represent the state of a message being composed. No
:name: [``newsgroups``]
:type: (string or array of string, optional)
:annotation: -- [Added in TB 74]

A single newsgroup name or an array of newsgroup names.


.. api-member::
Expand Down
4 changes: 2 additions & 2 deletions menus.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ __ https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/me

.. role:: code

The menus API allows to add items to Thunderbirds menus. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.
The menus API allows to add items to Thunderbird's menus. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.

.. rst-class:: api-main-section

Expand Down Expand Up @@ -103,7 +103,7 @@ Creates a new context menu item. Note that if an error occurs during creation, y
:name: [``command``]
:type: (string, optional)

Specifies a command to issue for the context click. Currently supports internal commands :value:`_execute_action`, :value:`_execute_compose_action` and :value:`_execute_message_display_action`.
Specifies a command to issue for the context click. Currently supports internal commands :value:`_execute_browser_action`, :value:`_execute_compose_action` and :value:`_execute_message_display_action`.


.. api-member::
Expand Down
15 changes: 14 additions & 1 deletion update-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,19 @@ def format_object(name, obj, print_description_only = False, print_enum_only = F
global unique_id
# enums have been moved inline and are no longer referenced
#enum_lines = []

# Cater for MV2/3 differences, pick the correct one and proceed as normal. We
# do not support individual descriptions of the allowed types.
if "choices" in obj:
for choice in obj["choices"]:
if "min_manifest_version" in choice and choice["min_manifest_version"] > MV:
continue
if "max_manifest_version" in choice and choice["max_manifest_version"] < MV:
continue
if "type" in choice and "description" in choice:
for key in choice:
obj[key] = choice[key]

parts = get_api_member_parts(name, obj)

#enum_only: fake header + enum
Expand Down Expand Up @@ -333,7 +346,7 @@ def format_object(name, obj, print_description_only = False, print_enum_only = F
#unique_id += 1

if print_enum_only:
content.extend([indent + sub for sub in parts['enum']])
content.extend([indent + sub for sub in parts['enum']])
else:
content.extend([indent + sub for sub in parts['description']])
content.extend([indent + sub for sub in parts['enum']])
Expand Down

0 comments on commit d289b65

Please sign in to comment.