-
Notifications
You must be signed in to change notification settings - Fork 105
docs: refresh icon guidance #2809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jahn-junior
wants to merge
1
commit into
main
Choose a base branch
from
work/icon-docs/CHARMCRAFT-718
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,6 +134,7 @@ URIs? | |
| URL | ||
| utils | ||
| uv | ||
| validator | ||
| Valkey | ||
| venv | ||
| VM's | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| .. meta:: | ||
| :description: How to create, validate, and add an icon to a charm's Charmhub page. | ||
| Includes a demo of using Inkscape to draw the icon. | ||
|
|
||
| .. _manage-icons: | ||
| .. _how-to-add-an-icon: | ||
|
|
||
| Add an icon to Charmhub | ||
| ======================= | ||
|
|
||
| Creating a custom icon for your charm is a great way to make it stand out on Charmhub. | ||
| This guide works through creating, validating, and adding an icon to your charm's | ||
| Charmhub page. | ||
|
|
||
|
|
||
| Install prerequisites | ||
| --------------------- | ||
|
|
||
| You can create the icon with any vector graphics editor, but this guide works through | ||
| the process with Inkscape. If you're following along step by step, `install Inkscape | ||
| <https://inkscape-manuals.readthedocs.io/en/latest/installing-on-linux.html>`__. | ||
|
Comment on lines
+19
to
+21
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably better for us to suggest the snap and then provide this link if the user doesn't want to use that (which like... they're already using Charmcraft as a snap, so...) |
||
|
|
||
| Next, right-click on the following link to save the `icon template | ||
| <https://assets.ubuntu.com/v1/fc0260eb-icon.svg>`__ to your machine. Leave the file name | ||
| as ``icon.svg``. | ||
|
|
||
|
|
||
| Draw the icon in Inkscape | ||
| ------------------------- | ||
|
|
||
| Open Inkscape and load the icon template you downloaded in the previous step. | ||
|
|
||
| To change the icon's background color, start by pressing :kbd:`Ctrl` + :kbd:`Shift` + | ||
| :kbd:`L` and clicking on :guilabel:`BACKGROUND` in the resulting tab. | ||
|
|
||
| .. figure:: images/add-an-icon/layer-select.png | ||
| :alt: Layer selection interface in the Inkscape editor | ||
|
|
||
| With the background layer selected, press :kbd:`Ctrl` + :kbd:`Shift` + :kbd:`F` to open | ||
| the Fill and Stroke interface. You can then select a color for the background. | ||
|
|
||
| .. figure:: images/add-an-icon/color-select.png | ||
| :alt: Fill and stroke selection interface in Inkscape | ||
|
|
||
| Next, go back to the layer selection window and select the :guilabel:`PLACE LOGO HERE` | ||
| layer. If you already have a vector image icon, drag it into this layer. If you have | ||
| a bitmap image, you'll need to convert it into a vector file first. | ||
|
|
||
| If you don't have an existing logo, you can use the drawing tools in Inkscape to create | ||
| one from scratch. | ||
|
|
||
| Once everything is to your liking, rename this layer to something more meaningful, like | ||
| :guilabel:`LOGO` or :guilabel:`ICON`. | ||
|
|
||
| .. figure:: images/add-an-icon/import-logo.png | ||
| :alt: Draw something | ||
|
|
||
| Once you're happy with your icon, press :kbd:`Ctrl` + :kbd:`Shift` + :kbd:`S` and save | ||
| the file as ``icon.svg`` in the directory containing your charm's project file. | ||
|
|
||
|
|
||
| Validate the icon | ||
| ----------------- | ||
|
|
||
| Go to the `Charmhub icon validator <https://charmhub.io/icon-validator>`_ and upload | ||
| your icon to check for any issues with its file type or dimensions. If you used the | ||
| provided template, this should pass without any issues. | ||
|
|
||
| To fix issues related to the icon's size, go back into Inkscape, press :kbd:`Ctrl` + | ||
| :kbd:`Shift` + :kbd:`D`, and set the height and width to 100 pixels. | ||
|
|
||
|
|
||
| .. _how-to-pack-the-icon-in-the-charm: | ||
|
|
||
| Pack the icon in the charm | ||
| -------------------------- | ||
|
|
||
| For the icon to be displayed on Charmhub, it needs to be packed into the final charm | ||
| artifact. Ensure that the ``icon.svg`` file is present in the directory containing your | ||
| charm's project file. | ||
|
|
||
| If your charm's main part uses the Charm plugin, the icon will be packed in the final | ||
| charm by default. | ||
|
|
||
| For every other plugin, you need to explicitly add the ``icon.svg`` file to the charm | ||
| by adding a new part using the :ref:`craft_parts_dump_plugin` to your project file. | ||
|
|
||
| .. code-block:: yaml | ||
| :caption: charmcraft.yaml | ||
|
|
||
| parts: | ||
| icon: | ||
| plugin: dump | ||
| source: . | ||
| stage: | ||
| - icon.svg | ||
|
|
||
| The next time you :ref:`publish the charm <publish-a-charm>` to its default track's | ||
| ``stable`` channel, the icon will be displayed on Charmhub. Charmhub only updates the | ||
| charm's metadata on releases to the ``stable`` channel. | ||
|
|
||
| If you aren't ready for a ``stable`` release, you can add the icon by releasing and | ||
| then rolling back a revision. However, it's generally recommended you wait until | ||
| the charm is ready for a true ``stable`` release. | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.