Skip to content

Commit

Permalink
allow styling of permissions via <permission> tag (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
jobisoft committed Dec 19, 2020
1 parent 14588ff commit 246234b
Show file tree
Hide file tree
Showing 25 changed files with 156 additions and 857 deletions.
18 changes: 13 additions & 5 deletions _static/theme_overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,19 @@
}

}

.wy-nav-content {
max-width: 1000px;
}

span.permission {
background-color:#e74c3c;
color: #fcfcfc;
/* color:#fff; */
box-sizing:border-box;
white-space:nowrap;
max-width:100%;
border:1px solid #e1e4e5;
font-size:75%;
padding:0 5px;
font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;
overflow-x:auto
}

/* RTD adds extra p */
div.container > p,
Expand Down
24 changes: 4 additions & 20 deletions accounts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,23 @@ The accounts API first appeared in Thunderbird 66 (see `bug 1488176`__).

__ https://bugzilla.mozilla.org/show_bug.cgi?id=1488176

.. role:: permission

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

Permissions
===========

.. api-member::
:name: ``accountsRead``
:name: :permission:`accountsRead`

See your mail accounts and their folders

.. rst-class:: api-permission-info

.. note::

The permission ``accountsRead`` is required to use ``accounts``.
The permission :permission:`accountsRead` is required to use ``accounts``.

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

Expand All @@ -41,9 +43,7 @@ Returns all mail accounts.


.. api-member::
:name:
:type: array of :ref:`accounts.MailAccount`
:annotation:


.. _Promise: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
Expand All @@ -64,17 +64,14 @@ Returns details of the requested account, or null if it doesn't exist.
.. api-member::
:name: ``accountId``
:type: (string)
:annotation:


.. api-header::
:label: Return type (`Promise`_)


.. api-member::
:name:
:type: :ref:`accounts.MailAccount`
:annotation:


.. _Promise: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
Expand All @@ -95,13 +92,11 @@ Sets the default identity for an account.
.. api-member::
:name: ``accountId``
:type: (string)
:annotation:


.. api-member::
:name: ``identityId``
:type: (string)
:annotation:


.. rst-class:: api-main-section
Expand All @@ -123,15 +118,13 @@ MailAccount
.. api-member::
:name: ``folders``
:type: (array of :ref:`folders.MailFolder`)
:annotation:

The folders for this account.


.. api-member::
:name: ``id``
:type: (string)
:annotation:

A unique identifier for this account.

Expand All @@ -147,15 +140,13 @@ MailAccount
.. api-member::
:name: ``name``
:type: (string)
:annotation:

The human-friendly name of this account.


.. api-member::
:name: ``type``
:type: (string)
:annotation:

What sort of account this is, e.g. ``imap``, ``nntp``, or ``pop3``.

Expand All @@ -174,55 +165,48 @@ MailIdentity
.. api-member::
:name: ``accountId``
:type: (string)
:annotation:

The id of the :ref:`accounts.MailAccount` this identity belongs to.


.. api-member::
:name: ``email``
:type: (string)
:annotation:

The user's email address as used when messages are sent from this identity.


.. api-member::
:name: ``id``
:type: (string)
:annotation:

A unique identifier for this identity.


.. api-member::
:name: ``label``
:type: (string)
:annotation:

A user-defined label for this identity.


.. api-member::
:name: ``name``
:type: (string)
:annotation:

The user's name as used when messages are sent from this identity.


.. api-member::
:name: ``organization``
:type: (string)
:annotation:

The organization associated with this identity.


.. api-member::
:name: ``replyTo``
:type: (string)
:annotation:

The reply-to email address associated with this identity.

32 changes: 4 additions & 28 deletions addressBooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@ The `Address Books`__ sample extension uses this API.

__ https://github.com/thundernest/sample-extensions/tree/master/addressBooks

.. role:: permission

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

Permissions
===========

.. api-member::
:name: ``addressBooks``
:name: :permission:`addressBooks`

Read and modify your address books and contacts

.. rst-class:: api-permission-info

.. note::

The permission ``addressBooks`` is required to use ``addressBooks``.
The permission :permission:`addressBooks` is required to use ``addressBooks``.

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

Expand Down Expand Up @@ -63,7 +65,6 @@ Gets a list of the user's address books, optionally including all contacts and m
.. api-member::
:name: [``complete``]
:type: (boolean)
:annotation:

If set to true, results will include contacts and mailing lists for each address book.

Expand All @@ -73,9 +74,7 @@ Gets a list of the user's address books, optionally including all contacts and m


.. api-member::
:name:
:type: array of :ref:`addressBooks.AddressBookNode`
:annotation:


.. _Promise: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
Expand All @@ -96,13 +95,11 @@ Gets a single address book, optionally including all contacts and mailing lists.
.. api-member::
:name: ``id``
:type: (string)
:annotation:


.. api-member::
:name: [``complete``]
:type: (boolean)
:annotation:

If set to true, results will include contacts and mailing lists for this address book.

Expand All @@ -112,9 +109,7 @@ Gets a single address book, optionally including all contacts and mailing lists.


.. api-member::
:name:
:type: :ref:`addressBooks.AddressBookNode`
:annotation:


.. _Promise: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
Expand All @@ -135,12 +130,10 @@ Creates a new, empty address book.
.. api-member::
:name: ``properties``
:type: (object)
:annotation:

.. api-member::
:name: ``name``
:type: (string)
:annotation:



Expand All @@ -149,9 +142,7 @@ Creates a new, empty address book.


.. api-member::
:name:
:type: string
:annotation:

The ID of the new address book.

Expand All @@ -174,18 +165,15 @@ Renames an address book.
.. api-member::
:name: ``id``
:type: (string)
:annotation:


.. api-member::
:name: ``properties``
:type: (object)
:annotation:

.. api-member::
:name: ``name``
:type: (string)
:annotation:



Expand All @@ -205,7 +193,6 @@ Removes an address book, and all associated contacts and mailing lists.
.. api-member::
:name: ``id``
:type: (string)
:annotation:


.. rst-class:: api-main-section
Expand All @@ -229,7 +216,6 @@ Fired when an address book is created.
.. api-member::
:name: ``node``
:type: (:ref:`addressBooks.AddressBookNode`)
:annotation:


.. _addressBooks.onUpdated:
Expand All @@ -248,7 +234,6 @@ Fired when an address book is renamed.
.. api-member::
:name: ``node``
:type: (:ref:`addressBooks.AddressBookNode`)
:annotation:


.. _addressBooks.onDeleted:
Expand All @@ -267,7 +252,6 @@ Fired when an addressBook is deleted.
.. api-member::
:name: ``id``
:type: (string)
:annotation:


.. rst-class:: api-main-section
Expand All @@ -291,53 +275,46 @@ A node representing an address book.
.. api-member::
:name: ``id``
:type: (string)
:annotation:

The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the program is restarted.


.. api-member::
:name: ``name``
:type: (string)
:annotation:


.. api-member::
:name: ``type``
:type: (:ref:`addressBooks.NodeType`)
:annotation:

Always set to ``addressBook``.


.. api-member::
:name: [``contacts``]
:type: (array of :ref:`contacts.ContactNode`)
:annotation:

A list of contacts held by this node's address book or mailing list.


.. api-member::
:name: [``mailingLists``]
:type: (array of :ref:`mailingLists.MailingListNode`)
:annotation:

A list of mailingLists in this node's address book.


.. api-member::
:name: [``parentId``]
:type: (string)
:annotation:

The ``id`` of the parent object.


.. api-member::
:name: [``readOnly``]
:type: (boolean)
:annotation:

Indicates if the object is read-only. Currently this returns false in all cases, as read-only address books are ignored by the API.

Expand Down Expand Up @@ -369,5 +346,4 @@ Indicates the type of a Node, which can be one of ``addressBook``, ``contact``,

.. api-member::
:name: ``mailingList``


0 comments on commit 246234b

Please sign in to comment.