|
75 | 75 | ``` |
76 | 76 |
|
77 | 77 | - **`"alertsOptions"`**\ |
78 | | - Todo |
| 78 | + Options to customize [Alerts](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts) |
| 79 | + beyond the 5 default ones used by GitHub. You may also know this feature by the name of |
| 80 | + [Obsidian Callouts](https://help.obsidian.md/callouts). |
| 81 | + |
| 82 | + ```json |
| 83 | + "alertsOptions": { |
| 84 | + "icons": { |
| 85 | + "foo": "zap", |
| 86 | + "bar": "./icons/flower.svg", |
| 87 | + "baz": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path d='M0 0 10 5 0 10z' fill='currentColor'/></svg>" |
| 88 | + }, |
| 89 | + "titles": { |
| 90 | + "bar": "Tip of the day" |
| 91 | + }, |
| 92 | + "fallbackIcon": "alert" |
| 93 | + } |
| 94 | + ``` |
| 95 | + |
| 96 | + In more detail: |
| 97 | + |
| 98 | + - **`"icons"`** |
| 99 | + |
| 100 | + **Key:** Any custom marker name. Can also be a multi-word string. Has to be fully |
| 101 | + lowercased. |
| 102 | + |
| 103 | + **Value:** A custom svg to use in one of three formats: |
| 104 | + |
| 105 | + 1. Name of an [octicon](https://primer.style/octicons/) (in kebab-case) |
| 106 | + 2. Path to an svg file, either relative to Vivify's config directory, or an absolute path. |
| 107 | + Tilde (`~`) can be used in an absolute path. |
| 108 | + 3. A raw svg tag as a string. Note: must escape double quotes or use single quotes |
| 109 | + inside the string. |
| 110 | + |
| 111 | + > [!WARNING] |
| 112 | + > We're considering switching from octicons to lucide as the main icon provider, so |
| 113 | + > option 1 is subject to change. |
| 114 | +
|
| 115 | + - **`"fallbackIcon"`** |
| 116 | + |
| 117 | + Icon to fall back to for markers you have not explicitly set a custom icon for. Given |
| 118 | + in the same format as an entry in the `"icons"` table. |
| 119 | + |
| 120 | + The fallback icon defaults to the icon used by `[!NOTE]`, to match the default |
| 121 | + behavior in Obsidian. |
| 122 | + |
| 123 | + - **`"titles"`** |
| 124 | + |
| 125 | + If you want an alert to have a different title than the marker string itself, it can |
| 126 | + be mapped in this table. |
| 127 | + |
| 128 | + **Key:** Any custom marker name. Can also be a multi-word string. Has to be fully |
| 129 | + lowercased. |
| 130 | + |
| 131 | + **Value:** Any string. |
| 132 | + |
| 133 | + Note that custom titles can also be given with this markdown syntax, with no config |
| 134 | + required: |
| 135 | + |
| 136 | + ```md |
| 137 | + > [!NOTE] Nota bene |
| 138 | + ``` |
| 139 | + |
| 140 | + To customize alert colors, set in your custom stylesheet (see `"styles"` above): |
| 141 | + |
| 142 | + ```css |
| 143 | + .alert-foo { --color: #00ff00; } |
| 144 | + ``` |
| 145 | + |
| 146 | + To set the same color as a default marker, use one of these variables variables: |
| 147 | + - `--alert-note` |
| 148 | + - `--alert-tip` |
| 149 | + - `--alert-important` |
| 150 | + - `--alert-warning` |
| 151 | + - `--alert-caution` |
| 152 | + |
| 153 | + These would be used as follows: |
| 154 | + |
| 155 | + ```css |
| 156 | + .alert-bar { --color: var(--alert-tip); } |
| 157 | + ``` |
| 158 | + |
| 159 | + For customization of all unconfigured custom markers at once, we have a color variable: |
| 160 | + - `--fallback-alert` |
| 161 | + |
| 162 | + and a special class for the base alert div: |
| 163 | + - `.fallback-alert` |
79 | 164 |
|
80 | 165 | Vivify reads the config on startup, i.e. when you want it to reload the config, |
81 | 166 | you have to restart Vivify. You can do this for example by running |
|
0 commit comments