godotengine / godotengine/godot-docs

Unwanted styles are being applied to code blocks by the `.highlight` class

Open
#6,931 9 comments 0 reactions 0 assignees View on GitHub
content:website enhancement
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

#### **Your Godot version:**
Latest (4.0)

#### **Issue description:**
The current `.highlight` styles appear to be applying styles for a specific lexer/language (presumably `shell`) to all code-blocks regardless of their language. Instead, language specific styles should be set in their language specific highlight class (e.g. `.highlight-shell` and `.highlight-powershell`).
- This issue is why the `batch` and `powershell` lexers also have drawbacks. They both are having unwanted styles applied to them from the blanket `.highlight` class.
- Until this issue is addressed, a good solution to prevent unwanted styling is to utilize `.. code-block:: none` which will prevent any styling from being applied to a code-block.

### Example: `.. code-block:: batch` command treated as comment.
![image](https://user-images.githubusercontent.com/1691061/226147912-7e9e3809-ce11-41c1-883f-3fe1c602ea28.png)
``` html



      C:\godot> scons platform=windows target=template_debug arch=x86_32

C:\godot> scons platform=windows target=template_release arch=x86_32
C:\godot> scons platform=windows target=template_debug arch=x86_64
C:\godot> scons platform=windows target=template_release arch=x86_64



```
![image](https://user-images.githubusercontent.com/1691061/226148025-05865b89-959e-464b-8951-07774717aab3.png)

### The highlight class and child classes
https://github.com/godotengine/godot-docs/blob/361bdfc6d000172df5d46913cce4fbcaaba0f0e5/_static/css/custom.css#L820-L924

#### **URL to the documentation page (if already existing):**
[This section is shown in the above example.](https://docs.godotengine.org/en/latest/contributing/development/compiling/compiling_for_windows.html#creating-windows-export-templates)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.