diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Theme development/Creating an icon pack.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Theme development/Creating an icon pack.html
index dc303d918..e3a76c42d 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Theme development/Creating an icon pack.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Theme development/Creating an icon pack.html
@@ -1,7 +1,7 @@
Supported formats
The first step is to analyze if the icon set being packed can be integrated
@@ -45,13 +45,13 @@
Unsupported formats
Trilium does not support the following formats:
-
SVG-based fonts.
-
Individual SVGs.
-
.eot fonts (legacy and proprietary).
+
SVG-based fonts.
+
Individual SVGs.
+
.eot fonts (legacy and proprietary).
Duotone icons, since it requires a special CSS format that Trilium doesn't
+ data-list-item-id="e67532d402708b0d266f438de7afc617b">Duotone icons, since it requires a special CSS format that Trilium doesn't
support.
-
Any other font format not specified in the Supported formats section.
+
Any other font format not specified in the Supported formats section.
In this case, the font must be manually converted to one of the supported
formats (ideally .woff2).
@@ -59,8 +59,8 @@
In order to create a new icon pack from a set of icons, it must meet the
following criteria:
-
It must have a web font of the supported format (see above).
-
It must have some kind of list, containing the name of each icon and the
+
It must have a web font of the supported format (see above).
+
It must have some kind of list, containing the name of each icon and the
corresponding Unicode code point. If this is missing, icon fonts usually
ship with a .css file that can be used to
extract the icon names from.
@@ -71,7 +71,7 @@
Creating the manifest
This is the most difficult part of creating an icon pack, since it requires
processing of the icon list to match Trilium's format.
-
The icon pack manifest is a JSON file with the following structure:
{
+
The icon pack manifest is a JSON file with the following structure:
The JSON example is a sample from the Boxicons font.
-
This is simply a mapping between the CSS classes (bx-ball),
+
The JSON example is a sample from the Boxicons font.
+
This is simply a mapping between the CSS classes (bx-ball),
to its corresponding code point in the font (\ue9c2)
and the terms/aliases used for search purposes.
-
Note that it's also possible to use the unescaped glyph inside the JSON.
+
Note that it's also possible to use the unescaped glyph inside the JSON.
It will appear strange (e.g. ), but it will be rendered properly regardless.
The first term is also considered the “name” of the icon, which is displayed
+ data-list-item-id="ec4b9b5ac1609500d36d35e659d61b61f">The first term is also considered the “name” of the icon, which is displayed
while hovering over it in the icon selector.
In order to generate this manifest, generally a script is needed that
@@ -163,28 +163,28 @@ console.log(processIconPack("light"));
Creating the icon pack
-
Create a note of type Code.
-
Set the language to JSON.
-
Copy and paste the manifest generated in the previous step as the content
+
Create a note of type Code.
+
Set the language to JSON.
+
Copy and paste the manifest generated in the previous step as the content
of this note.
-
Go to the note attachment and
- upload the font file (in .woff2, .woff,
+
Go to the note attachment and upload the
+ font file (in .woff2, .woff,
.ttf) format.
-
Trilium identifies the font to use from attachments via the MIME type,
+
Trilium identifies the font to use from attachments via the MIME type,
make sure the MIME type is displayed correctly after uploading the attachment
(for example font/woff2).
-
Make sure the role appears as file,
+
Make sure the role appears as file,
otherwise the font will not be identified.
-
Multiple attachments are supported, but only one font will actually be
+
Multiple attachments are supported, but only one font will actually be
used in Trilium's order of preference: .woff2,
.woff, .ttf. As such, there's not
much reason to upload more than one font per icon pack.
-
Go back to the note and rename it. The name of the note will also be the
+
Go back to the note and rename it. The name of the note will also be the
name of the icon pack as displayed in the list of icons.
For our example with Phosphor Icons, we can use the ph prefix
since it also matches the prefix set in the original CSS. So in this case
it would be #iconPack=ph.
Change the icon of the note and look for the Filter icon in the
+
Change the icon of the note and look for the Filter icon in the
top-right side.
-
Check if the new icon pack is displayed there and click on it to see the
+
Check if the new icon pack is displayed there and click on it to see the
full list of icons.
-
Go through most of the items to look for issues such as missing icon,
+
Go through most of the items to look for issues such as missing icon,
wrong names (some icons have aliases/terms that can cause issues).
-
Optionally, assign an icon from the new icon pack to this note. This icon
+
Optionally, assign an icon from the new icon pack to this note. This icon
will be used in the icon pack filter for a visual distinction.
The icon pack can then be exported as ZIP in
+ data-list-item-id="e9b5f41994bb6beae98a2d9a1e396fba0">The icon pack can then be exported as ZIP in
order to be distributed to other users.
-
It's important to note that icon packs are considered “unsafe” by default,
+
It's important to note that icon packs are considered “unsafe” by default,
so “Safe mode” must be disabled when importing the ZIP.
-
Consider linking new users to the Icon Packs documentation
+
Consider linking new users to the Icon Packs documentation
in order to understand how to import and use an icon pack.
Troubleshooting
If the icon pack doesn't show up, look through the Backend (server) logs for
- clues.
+ href="#root/_help_bnyigUA2UK7s">Backend (server) logs for clues.
-
One example is if the font could not be retrieved: ERROR: Icon pack is missing WOFF/WOFF2/TTF attachment: Boxicons v3 400 (dup) (XRzqDQ67fHEK).
+
One example is if the font could not be retrieved: ERROR: Icon pack is missing WOFF/WOFF2/TTF attachment: Boxicons v3 400 (dup) (XRzqDQ67fHEK).
Make sure the prefix is unique and not already taken by some other icon
+ data-list-item-id="ec83897ba2caaeb0d906b29e9e4f52a77">Make sure the prefix is unique and not already taken by some other icon
pack. When there are two icon packs with the same prefix, only one is used.
The server logs will indicate if this situation occurs.
+
Make sure the prefix consists only of alphanumeric characters, hyphens
+ and underscore.
\ No newline at end of file
diff --git a/docs/User Guide/User Guide/Theme development/Creating an icon pack.md b/docs/User Guide/User Guide/Theme development/Creating an icon pack.md
index 427b6595a..218c21b21 100644
--- a/docs/User Guide/User Guide/Theme development/Creating an icon pack.md
+++ b/docs/User Guide/User Guide/Theme development/Creating an icon pack.md
@@ -155,6 +155,9 @@ In order for an icon pack to be recognized, the prefix must be specified in the
For our example with Phosphor Icons, we can use the `ph` prefix since it also matches the prefix set in the original CSS. So in this case it would be `#iconPack=ph`.
+> [!IMPORTANT]
+> The prefix must consist of only alphanumeric characters, hyphens and underscore. If the prefix doesn't match these constraints, the icon pack will be ignored and an error will be logged in Backend (server) logs.
+
### Final steps
* [Refresh the client](../Troubleshooting/Refreshing%20the%20application.md)
@@ -171,4 +174,5 @@ For our example with Phosphor Icons, we can use the `ph` prefix since it also ma
If the icon pack doesn't show up, look through the Backend (server) logs for clues.
* One example is if the font could not be retrieved: `ERROR: Icon pack is missing WOFF/WOFF2/TTF attachment: Boxicons v3 400 (dup) (XRzqDQ67fHEK)`.
-* Make sure the prefix is unique and not already taken by some other icon pack. When there are two icon packs with the same prefix, only one is used. The server logs will indicate if this situation occurs.
\ No newline at end of file
+* Make sure the prefix is unique and not already taken by some other icon pack. When there are two icon packs with the same prefix, only one is used. The server logs will indicate if this situation occurs.
+* Make sure the prefix consists only of alphanumeric characters, hyphens and underscore.
\ No newline at end of file