Skip to content

Commit 2cb70f7

Browse files
committed
docs: add property list manager page, update doc refs
1 parent 5b4ec93 commit 2cb70f7

File tree

6 files changed

+270
-83
lines changed

6 files changed

+270
-83
lines changed

docs/reference/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ base_api_client
1212
api_client
1313
analyze
1414
config_manager
15+
plist_manager
1516
report_manager
1617
setup
1718
token_manager

docs/reference/plist_manager.rst

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
:html_theme.sidebar_secondary.remove: True
2+
3+
.. _plist_manager:
4+
5+
=====================
6+
Property List Manager
7+
=====================
8+
9+
.. autoclass:: patcher.client.plist_manager.PropertyListManager
10+
:members:

docs/user/customize_reports.rst

+54-80
Original file line numberDiff line numberDiff line change
@@ -16,81 +16,60 @@ Tailor the user interface elements of your exported PDF reports. You have the fl
1616
.. seealso::
1717
Configuring the date format is done at runtime by using the ``--date-format`` option. See :ref:`date format <date-format>` for more information.
1818

19-
.. _property_list_file:
2019

21-
Setup
22-
=====
20+
Customizable User Interface Elements
21+
------------------------------------
2322

24-
When you first launch Patcher, a :ref:`setup assistant <setup>` will automatically create the necessary ``com.liquidzoo.patcher.plist`` file in the user's Library Application Support directory, located at ``$HOME/Library/Application Support/Patcher``. Once setup is completed successfully, the ``first_run_done`` key in the property list file will automatically be set to ``True``:
23+
Patcher allow syou to personalize the appearance of your reports using settings stored in the project's property list file. For full details on modifying the property list, see :ref:`Property List Configuration <property_list_file>`.
24+
25+
Editing the Header & Footer Text
26+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27+
28+
The header and footer text displayed in exported reports can be adjusted. These settings are stored in the ``com.liquidzoo.patcher.plist`` file under the ``UserInterfaceSettings`` dictionary.
2529

2630
.. code-block:: xml
2731
2832
<?xml version="1.0" encoding="UTF-8"?>
2933
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3034
<plist version="1.0">
3135
<dict>
32-
<key>Setup</key>
36+
<key>UserInterfaceSettings</key>
3337
<dict>
34-
<key>first_run_done</key>
35-
<true/>
38+
<key>header_text</key>
39+
<string>AnyOrg Patch Report</string>
40+
<key>footer_text</key>
41+
<string>Made with &lt;3 from IT</string>
3642
</dict>
3743
</dict>
3844
</plist>
3945
40-
.. admonition:: Warning
41-
:class: warning
42-
43-
**Do not modify** the ``first_run_done`` key in the ``Setup`` dictionary directly. Altering this key may cause Patcher to re-run the setup process. If you need to reset the initial setup state, use the ``--reset`` command instead. For more information, see :ref:`resetting Patcher <resetting_patcher>`.
44-
45-
.. _modify_plist:
46-
47-
Modifying the Property List File
48-
================================
49-
50-
The property list file contains the settings that control the appearance of the PDF reports. You can edit these values using ``/usr/libexec/PlistBuddy`` or a code editor of your choice (VSCode, BBEdit, CodeRunner, etc.).
51-
52-
.. admonition:: Opening Property Lists in Xcode
53-
:class: tip
54-
55-
If the plist file appears as a binary file when opened in VSCode or other editors, you can open it in **Xcode** instead. Xcode is available as a free download from the Mac App Store and fully supports editing plist files. This will prevent issues with binary formatting that some editors may encounter.
56-
57-
Using ``jappleseed`` as an example, the path to the property list file would be:
58-
59-
``/Users/jappleseed/Library/Application Support/Patcher/com.liquidzoo.patcher.plist``
60-
61-
Editing the Header & Footer Text
62-
--------------------------------
63-
64-
.. tip::
65-
Why not use ``defaults`` to edit the property list file? Unfortunately, the ``defaults`` binary in macOS lacks the ability to update keys nested within dictionaries. ``PlistBuddy`` is much better equipped to handle property lists with nested elements.
66-
67-
To modify the header and footer text using PlistBuddy, use the following commands:
68-
69-
.. code-block:: console
70-
71-
$ /usr/libexec/PlistBuddy -c "Set :UI:HEADER_TEXT 'Your Custom Header Text'" ~/Library/Application\ Support/Patcher/com.liquidzoo.patcher.plist
72-
$ /usr/libexec/PlistBuddy -c "Set :UI:FOOTER_TEXT 'Your Custom Footer Text'" ~/Library/Application\ Support/Patcher/com.liquidzoo.patcher.plist
73-
$ /usr/libexec/PlistBuddy -c "Set :UI:LOGO_PATH 'path/to/your/company/logo.png'" ~/Library/Application\ Support/Patcher/com.liquidzoo.patcher.plist
74-
75-
These commands will correctly update the ``HEADER_TEXT``, ``FOOTER_TEXT`` and ``LOGO_PATH`` keys within the ``UI`` dictionary.
76-
77-
.. note::
78-
The footer text will automatically append a ``|`` character followed by the page number to the end of the specified footer text.
7946
8047
Customizing the Font
81-
--------------------
82-
83-
To change the font, update the ``FONT_NAME``, ``FONT_REGULAR_PATH`` and ``FONT_BOLD_PATH`` values in the UI dictionary.
84-
85-
.. code-block:: console
48+
^^^^^^^^^^^^^^^^^^^^
8649

87-
$ /usr/libexec/PlistBuddy -c "Set :UI:FONT_NAME 'Helvetica'" ~/Library/Application\ Support/Patcher/com.liquidzoo.patcher.plist
88-
$ /usr/libexec/PlistBuddy -c "Set :UI:FONT_REGULAR_PATH '/path/to/Helvetica-Regular.ttf'" ~/Library/Application\ Support/Patcher/com.liquidzoo.patcher.plist
89-
$ /usr/libexec/PlistBuddy -c "Set :UI:FONT_BOLD_PATH '/path/to/Helvetica-Bold.ttf'" ~/Library/Application\ Support/Patcher/com.liquidzoo.patcher.plist
50+
You can specify a custom font to match your organization's branding. The font settings, including font name and paths to font files are stored in the property list.
9051

9152
.. important::
9253
The default font used in testing is `Google's Assistant Font <https://fonts.google.com/specimen/Assistant>`_. While you can specify a different font to match your organization's branding, be aware that doing so may cause formatting or alignment issues in the exported PDF reports. It is recommended to test the PDF export functionality thoroughly after changing the font to ensure the new font does not adversely affect the document's appearance.
9354

55+
.. code-block:: xml
56+
57+
<?xml version="1.0" encoding="UTF-8"?>
58+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
59+
<plist version="1.0">
60+
<dict>
61+
<key>UserInterfaceSettings</key>
62+
<dict>
63+
<key>font_name</key>
64+
<string>Assistant</string>
65+
<key>reg_font_path</key>
66+
<string>/Users/spesh/Library/Application Support/Patcher/fonts/Assistant-Regular.ttf</string>
67+
<key>bold_font_path</key>
68+
<string>/Users/spesh/Library/Application Support/Patcher/fonts/Assistant-Bold.ttf</string>
69+
</dict>
70+
</dict>
71+
</plist>
72+
9473
.. _customize_logo:
9574

9675
Adding a Company Logo
@@ -99,7 +78,7 @@ Adding a Company Logo
9978
.. admonition:: Added in version 2.0
10079
:class: tip
10180

102-
Patcher now allows you to include a company logo in your exported PDF reports. This can be helpful for ensuring unified branding for reports.
81+
Patcher allows you to include a company logo in your exported PDF reports. This can be helpful for ensuring unified branding for reports.
10382

10483
Supported Logo Requirements
10584
^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -135,17 +114,17 @@ Via ``reset``:
135114
$ Enter the path to the logo file: /path/to/logo.png
136115
137116
4. Patcher will validate the image file. If valid, it will copy the logo to the ``Application Support`` directory: ``$HOME/Library/Application Support/Patcher/logo.png``
138-
5. The logo path is then saved to the ``com.liquidzoo.patcher.plist`` file under the ``UI`` dictionary:
117+
5. The logo path is then saved to the ``com.liquidzoo.patcher.plist`` file under the ``UserInterface`` dictionary:
139118

140119
.. code-block:: xml
141120
142-
<key>LOGO_PATH</key>
121+
<key>logo_path</key>
143122
<string>/Users/jappleseed/Library/Application Support/Patcher/logo.png</string>
144123
145124
Via the property list:
146125
~~~~~~~~~~~~~~~~~~~~~~
147126

148-
Open the property list file in Xcode or use ``PlistBuddy`` to modify the property list file. (See :ref:`Modifying the Property List File <modify_plist>` above). For demonstration purposes, ``PlistBuddy`` will be used.
127+
Open the property list file in Xcode or use ``PlistBuddy`` to modify the property list file. (See :ref:`Modifying the Property List File <modify_plist>`). For demonstration purposes, ``PlistBuddy`` will be used.
149128

150129
.. tip::
151130
Absolute paths can be copied easily in macOS: Hold down the Option (⌥) symbol on the keyboard, right-click the logo file and select **Copy <filename> as Pathname**
@@ -155,40 +134,35 @@ Open the property list file in Xcode or use ``PlistBuddy`` to modify the propert
155134

156135
.. code-block:: console
157136
158-
$ /usr/libexec/PlistBuddy -c "Set :UI:LOGO_PATH '/path/to/logo.png'" ~/Library/Application\ Support/Patcher/com.liquidzoo.patcher.plist
137+
$ /usr/libexec/PlistBuddy -c "Set :UserInterfaceSettings:logo_path '/path/to/logo.png'" ~/Library/Application\ Support/Patcher/com.liquidzoo.patcher.plist
159138
160139
3. While it is not **required** to copy the logo file to Patcher's Application Support directory, it ensures the proper permissions are enabled to read the logo file.
161140

162-
Full Example Configuration
163-
==========================
141+
Example UI Settings Configuration
142+
=================================
164143

165-
Here is an example configuration with custom header, footer text, and a specified font:
144+
Here is an example configuration of **only** the ``UserInterfaceSettings`` dictionary with custom header, footer text, specified font, and custom logo:
166145

167146
.. code-block:: xml
168147
169148
<?xml version="1.0" encoding="UTF-8"?>
170149
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
171150
<plist version="1.0">
172151
<dict>
173-
<key>Setup</key>
174-
<dict>
175-
<key>first_run_done</key>
176-
<true/>
177-
</dict>
178-
<key>UI</key>
152+
<key>UserInterfaceSettings</key>
179153
<dict>
180-
<key>HEADER_TEXT</key>
181-
<string>Confidential Report</string>
182-
<key>FOOTER_TEXT</key>
183-
<string>© 2024 Your Company</string>
184-
<key>FONT_NAME</key>
185-
<string>Helvetica</string>
186-
<key>FONT_REGULAR_PATH</key>
187-
<string>/path/to/Helvetica-Regular.ttf</string>
188-
<key>FONT_BOLD_PATH</key>
189-
<string>/path/to/Helvetica-Bold.ttf</string>
190-
<key>LOGO_PATH</key>
191-
<string>/Users/jappleseed/Library/Application Support/Patcher/logo.png</string>
154+
<key>header_text</key>
155+
<string>AnyOrg Patch Report</string>
156+
<key>footer_text</key>
157+
<string>Made with &lt;3 from IT</string>
158+
<key>font_name</key>
159+
<string>Assistant</string>
160+
<key>reg_font_path</key>
161+
<string>/Users/spesh/Library/Application Support/Patcher/fonts/Assistant-Regular.ttf</string>
162+
<key>bold_font_path</key>
163+
<string>/Users/spesh/Library/Application Support/Patcher/fonts/Assistant-Bold.ttf</string>
164+
<key>logo_path</key>
165+
<string>/Users/spesh/Library/Application Support/Patcher/logo.png</string>
192166
</dict>
193167
</dict>
194168
</plist>

docs/user/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Follow detailed instructions to configure Patcher.
5959
6060
setup_assistant
6161
jamf_deployment
62+
plist
6263
schedulereports
6364
```
6465

0 commit comments

Comments
 (0)