Skip to content

Commit

Permalink
minor template updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jobisoft committed Dec 22, 2020
1 parent d4ff142 commit f2abf6d
Show file tree
Hide file tree
Showing 21 changed files with 99 additions and 38 deletions.
46 changes: 28 additions & 18 deletions _static/theme_overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ span.permission {
overflow-x:auto
}


/* RTD adds extra p */
div.container > p,
div.container > ul {
Expand Down Expand Up @@ -109,6 +110,10 @@ div.container > ul {
margin-bottom:3em;
margin-left: 1em;
}
.api-section-body a {
font-size: 95%;
font-style: italic;
}

/* styles for the api headers like "Parameters" */
.api-header-node {
Expand All @@ -124,10 +129,6 @@ div.container > ul {
.api-header-section div {
padding: 6px;
}
.api-header-section > div a {
font-size: 95%;
font-style: italic;
}
.api-header-annotation {
margin-left:2em;
}
Expand All @@ -139,27 +140,15 @@ div.container > ul {
/* member styles, elements below api headers*/
.api-member-definition {
display: flex;
align-items: center;
align-items: text-top;
}
.api-member-name, .api-member-type, .api-member-annotation {
margin-right: 0.5ex;
}
.api-member-annotation > p {
font-size: 80%;
font-style: italic;
}
.api-member-type > p {
font-size: 95%;
font-style: italic;
}
.api-member-node {
margin-bottom: 0.5ex;
}
/*.api-member-node ul,
.api-member-node p {
margin-bottom: 0 !important;
}*/
.api-member-description > p {
.api-member-description p {
font-size: 95%;
}
.api-member-description {
Expand All @@ -173,4 +162,25 @@ div.container > ul {
.api-member-description-only > .api-member-node {
margin-left:-1ex;
}
.api-member-annotation > p {
font-size: 80%;
font-style: italic;
}
.api-member-type > p {
font-size: 95%;
font-style: italic;
}


.api-member-inline-changes dl,
.api-member-inline-changes dd,
.api-member-inline-changes dd > p {
margin:0 !important;
padding: 0 !important;
}
.api-member-inline-changes dt {
font-size: 95%;
line-height:24px;
margin:0 !important;
padding: 0 1ex 0 0 !important;
}
2 changes: 2 additions & 0 deletions accounts.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _accounts_api:

========
accounts
========
Expand Down
2 changes: 2 additions & 0 deletions addressBooks.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _addressBooks_api:

============
addressBooks
============
Expand Down
2 changes: 2 additions & 0 deletions browserAction.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _browserAction_api:

=============
browserAction
=============
Expand Down
2 changes: 2 additions & 0 deletions cloudFile.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _cloudFile_api:

=========
cloudFile
=========
Expand Down
2 changes: 2 additions & 0 deletions commands.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _commands_api:

========
commands
========
Expand Down
2 changes: 2 additions & 0 deletions compose.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _compose_api:

=======
compose
=======
Expand Down
2 changes: 2 additions & 0 deletions composeAction.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _composeAction_api:

=============
composeAction
=============
Expand Down
2 changes: 2 additions & 0 deletions composeScripts.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _composeScripts_api:

==============
composeScripts
==============
Expand Down
2 changes: 2 additions & 0 deletions contacts.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _contacts_api:

========
contacts
========
Expand Down
2 changes: 2 additions & 0 deletions folders.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _folders_api:

=======
folders
=======
Expand Down
12 changes: 10 additions & 2 deletions mailTabs.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _mailTabs_api:

========
mailTabs
========
Expand Down Expand Up @@ -356,7 +358,10 @@ Fired when the displayed folder changes in any mail tab.
:name: ``tab``
:type: (:ref:`tabs.Tab`)

*Changed in TB 76: previously just the tab's ID*
.. container:: api-member-inline-changes

:Changes in TB 76: previously just the tab's ID



.. api-member::
Expand Down Expand Up @@ -386,7 +391,10 @@ Fired when the selected messages change in any mail tab.
:name: ``tab``
:type: (:ref:`tabs.Tab`)

*Changed in TB 76: previously just the tab's ID*
.. container:: api-member-inline-changes

:Changes in TB 76: previously just the tab's ID



.. api-member::
Expand Down
2 changes: 2 additions & 0 deletions mailingLists.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _mailingLists_api:

============
mailingLists
============
Expand Down
2 changes: 2 additions & 0 deletions menus.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _menus_api:

=====
menus
=====
Expand Down
7 changes: 6 additions & 1 deletion messageDisplay.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _messageDisplay_api:

==============
messageDisplay
==============
Expand Down Expand Up @@ -112,7 +114,10 @@ Fired when a message is displayed, whether in a 3-pane tab, a message tab, or a
:name: ``tab``
:type: (:ref:`tabs.Tab`)

*Changed in TB 76: previously just the tab's ID*
.. container:: api-member-inline-changes

:Changes in TB 76: previously just the tab's ID



.. api-member::
Expand Down
2 changes: 2 additions & 0 deletions messageDisplayAction.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _messageDisplayAction_api:

====================
messageDisplayAction
====================
Expand Down
2 changes: 2 additions & 0 deletions messageDisplayScripts.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _messageDisplayScripts_api:

=====================
messageDisplayScripts
=====================
Expand Down
2 changes: 2 additions & 0 deletions messages.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _messages_api:

========
messages
========
Expand Down
20 changes: 8 additions & 12 deletions tabs.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _tabs_api:

====
tabs
====
Expand Down Expand Up @@ -538,13 +540,11 @@ executeScript([tabId], details)
Injects JavaScript code into a page. For details, see the `programmatic injection <https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts>`_ section of the content scripts doc.

.. api-header::
:label: API changes
:label: Changes in Thunderbird 77


.. api-member::
:name: Thunderbird 77

With the :permission:`compose` permission, this now works in the document of email messages during composition.
:name: With the :permission:`compose` permission, this now works in the document of email messages during composition.

.. api-header::
:label: Parameters
Expand Down Expand Up @@ -586,13 +586,11 @@ insertCSS([tabId], details)
Injects CSS into a page. For details, see the `programmatic injection <https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts>`_ section of the content scripts doc.

.. api-header::
:label: API changes
:label: Changes in Thunderbird 77


.. api-member::
:name: Thunderbird 77

With the :permission:`compose` permission, this now works in the document of email messages during composition.
:name: With the :permission:`compose` permission, this now works in the document of email messages during composition.

.. api-header::
:label: Parameters
Expand Down Expand Up @@ -622,13 +620,11 @@ removeCSS([tabId], details)
Removes injected CSS from a page. For details, see the `programmatic injection <https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts>`_ section of the content scripts doc.

.. api-header::
:label: API changes
:label: Changes in Thunderbird 77


.. api-member::
:name: Thunderbird 77

With the :permission:`compose` permission, this now works in the document of email messages during composition.
:name: With the :permission:`compose` permission, this now works in the document of email messages during composition.

.. api-header::
:label: Parameters
Expand Down
20 changes: 15 additions & 5 deletions update-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,13 @@ def format_changes(obj, inline = False):
if "changed" in obj:
for k, v in obj['changed'].items():
if inline:
lines.append("*Changed in TB " + k + ": " + replace_code(v) + "*")
lines.extend([
".. container:: api-member-inline-changes",
"",
" :Changes in TB " + k + ": " + replace_code(v),
""])
else:
lines.extend(api_member(name="Thunderbird " + k, description=[replace_code(v)]))
lines.extend(api_header("Changes in Thunderbird " + k, api_member(name=replace_code(v))))
return lines

def get_api_member_parts(name, value):
Expand Down Expand Up @@ -413,14 +417,20 @@ def reference(label):
def format_namespace(namespace, manifest_namespace=None):
global unique_id, additional_type_used

lines = []
lines.extend([
"",
".. _%s_api:" % current_namespace_name,
""]);

#unique_id = 1
preamble = os.path.join(OVERLAY_DIR, current_namespace_name + ".rst")
if os.path.exists(preamble):
with open(preamble) as fp_preamble:
lines = map(lambda l: l.rstrip("\n").decode("utf-8"), fp_preamble.readlines())
lines.extend(map(lambda l: l.rstrip("\n").decode("utf-8"), fp_preamble.readlines()))
lines.append("")
else:
lines = header_1(current_namespace_name)
lines.extend(header_1(current_namespace_name))

lines.extend([
"",
Expand Down Expand Up @@ -454,7 +464,7 @@ def format_namespace(namespace, manifest_namespace=None):
lines.append("")

if "changed" in function:
lines.extend(api_header("API changes", format_changes(function)))
lines.extend(format_changes(function))

if len(function.get("parameters", [])) > 0:
content = []
Expand Down
2 changes: 2 additions & 0 deletions windows.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _windows_api:

=======
windows
=======
Expand Down

0 comments on commit f2abf6d

Please sign in to comment.