# Avoid Screenshots of Text/Code

**URL:** <https://ziggit.dev/t/avoid-screenshots-of-text-code/5369>\
**Category:** Site Feedback\
**Created:** [July 26, 2024, 12:46pm UTC](https://ziggit.dev/t/avoid-screenshots-of-text-code/5369 "2024-07-26T12:46:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sze](https://ziggit.dev/user_avatar/ziggit.dev/sze/32/496_2.png) [@Sze](https://ziggit.dev/u/Sze)\
**Post date:** [July 26, 2024, 12:46pm UTC](https://ziggit.dev/t/avoid-screenshots-of-text-code/5369/1 "2024-07-26T12:46:51Z")

</div>

## Why avoid Screenshots of Text/Code?

I dislike screenshots of text, because they are:

1. less accessible (text can be read via screen-readers, or braille displays)
2. less searchable (text recognition tools often aren’t easily available / not well integrated or may contain faults in their output)
3. annoying (you can’t easily/reliably copy the text out of a screenshot)

I think these are good reasons to keep the amount of screenshots of text low in the forum and only use them, when it can’t be avoided or if there is a good reason to use a screenshot of text, for example when you are explaining something with additional annotations like in this example: [Initial implementation of `zig build --watch` just landed in master branch - #4 by andrewrk](https://ziggit.dev/t/initial-implementation-of-zig-build-watch-just-landed-in-master-branch/5117/4)

## How do I highlight my Text/Code?

To post code you can use:

````zig
```
your_code_here
```

````

You also can select your code and press `ctrl+e`, this works both for **inline** and **multi-line code** snippets.

If your code is in a specific language you can add the language to a multiline code block:

````zig
```python
def factorial(x):
    if x <= 1:
        return 1
    return x * factorial(x - 1)
```

````

```python
def factorial(x):
    if x <= 1:
        return 1
    return x * factorial(x - 1)

```

Often adding the language isn’t strictly necessary, because `highlight.js` (which is used by discourse) has language detection features, however if you want to make sure that the language is specifically and accurately recognized you can add it explicitly. This forums default language is zig, unless `highlight.js` recognizes the code as a different language.

These are the [supported languages](https://highlightjs.readthedocs.io/en/latest/supported-languages.html) of `highlight.js`, only the ones not listing a package are part of the default distribution of `highlight.js` and thus should be bundled with discourse’s `highlight.js`, however not all of those may be activated in the site-setting of this discourse instance (forum), but you can ask whether we can activate those.

Additionally we have manually added highlight support via a theme component, that adds Zig highlighting.

## What are your reasons for using Screenshots?

If the reason is mostly not knowing that these highlighting options exist, please try out whether your highlighting is supported and if it works please convert your screenshot to highlighted text.

If it isn’t and you think your highlight language is used commonly enough in this forum to warrant highlight support, you can request it here and we can look into it.

Of course there are sometimes good reasons for using screenshots, this is mostly about keeping to a minimum the amount of screenshots that don’t have a good reason.

That said, I want to hear the reasons from people why they feel like using a screenshot was better in some situations, are there missing features from the forum, do we need to tweak syntax highlighting, etc?

---

<div class="post-metadata">

**Author:** ![dude\_the\_builder](https://ziggit.dev/user_avatar/ziggit.dev/dude_the_builder/32/557_2.png) [@dude\_the\_builder](https://ziggit.dev/u/dude_the_builder)\
**Post date:** [July 26, 2024, 1:24pm UTC](https://ziggit.dev/t/avoid-screenshots-of-text-code/5369/2 "2024-07-26T13:24:28Z")

</div>



---

<div class="post-metadata">

**Author:** ![insalt-glitch](https://ziggit.dev/letter_avatar_proxy/v4/letter/i/7feea3/32.png) [@insalt-glitch](https://ziggit.dev/u/insalt-glitch)\
**Post date:** [July 26, 2024, 11:06pm UTC](https://ziggit.dev/t/avoid-screenshots-of-text-code/5369/3 "2024-07-26T23:06:34Z")

</div>

I completely agree that code should (almost) never be posted as a screenshot. As someone who has made his first post today, I noticed that the option to insert code or format the text as code does not show in the little element that shows other tips like **bold** , _ **italic** _ or [hyperlinks](https://www.youtube.com/watch?v=dQw4w9WgXcQ).

tl;dr: In my opinion, since this is a forum for Zig-programming. The code-format option should be easily available in the menu bar!

---

<div class="post-metadata">

**Author:** ![Sze](https://ziggit.dev/user_avatar/ziggit.dev/sze/32/496_2.png) [@Sze](https://ziggit.dev/u/Sze)\
**Post date:** [July 27, 2024, 12:26am UTC](https://ziggit.dev/t/avoid-screenshots-of-text-code/5369/4 "2024-07-27T00:26:28Z")

</div>

It is there but it is called “Preformatted Text” `</>`

![codebutton](https://ziggit.dev/uploads/default/original/2X/6/62a4e3d2f7b87d2f07ffe2056cc1ea2ded480236.png)
