Documentation/content/improving-documentation/screenshots.md
crapStone da1b77aa6a Add woodpecker ci & many linters (and their required fixes) (#377)
closes #238

Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-authored-by: Patrick Schratz <pat-s@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/Codeberg/Documentation/pulls/377
Co-authored-by: crapStone <crapstone01@gmail.com>
Co-committed-by: crapStone <crapstone01@gmail.com>
2024-06-11 07:51:22 +00:00

2.7 KiB

eleventyNavigation
key title parent order
HowToMakeScreenshots How to make screenshots for Codeberg Documentation? ImprovingTheDocumentation 15

Screenshots for Codeberg Documentation should follow the guidelines explained in Kesi Parker's excellent article.

They should be created using the "Knut" demo account on codeberg-test.org. If you're a regular, trusted contributor to Documentation, you can find its credentials in a private repository in the knut organization on codeberg.org.

Otherwise, feel free to request screenshots being added when merging your PR. For that, please include TODO SCREENSHOT [of foo] in your article.

On the technical side, screenshots should ideally be available in both the WebP and PNG formats (WebP and JPEG for photographs), they should be in a large enough resolution so that text is clearly readable and their filenames should follow Codeberg Documentation's naming conventions.

Please put screenshots under assets/images/[section]/[article]/... where [section] and [article] are the kebab-cased names of the section or your article, respectively.

Codeberg Documentation uses the WebP format wherever possible, in order to increase page loading speed and reduce traffic due to its powerful compression.

To convert a screenshot to WebP, you can use the cwebp command line utility like this:

cwebp -lossless screenshot.png -o screenshot.webp

{% admonition "Note" "How to install cwebp" %}

As cwebp cli-tool is part of libwebp the package name might be different between different repositories, here's some tips how to install this tool:

  • On Debian/Ubuntu in apt repository by sudo apt install webp
  • On VoidLinux xbps repository by sudo xbps-install libwebp
  • On ArchLinux aur repository by sudo pacman -S libwebp

{% endadmonition %}

If you prefer a GUI, there are a number of options available, but please be sure that your GUI doesn't add thumbnails into the WebP file, which would inflate its size, rendering its key advantage meaningless.

At the time of writing, there is no support for webP images in Safari browsers. As a workaround, all images (except SVG) in Codeberg documentation are currently to be included using a <picture> tag, like so:

<picture>
  <source srcset="/assets/images/getting-started/issue-tracking-basics/issues-list.webp" type="image/webp" />
  <img src="/assets/images/getting-started/issue-tracking-basics/issues-list.png" alt="Issues List" />
</picture>