defold / defold.github.io

www.defold.com
Other
11 stars 13 forks source link

Consistent indentation on Examples pages (tab size of 4 spaces) #87

Closed mikatuo closed 10 months ago

mikatuo commented 10 months ago

Problem

For code blocks on Manuals pages tab size of 4/2 spaces is used, on API Reference pages - 4 spaces. The Examples pages however use tabs.

Manuals - 4 spaces (https://defold.com/manuals/message-passing/#message-chains): (looks good) image

Examples - tabs (https://defold.com/examples/basics/message_passing/): (tabs take a bit too much space) image

Examples - tabs and spaces (https://defold.com/examples/basics/parent_child/): (it looks even worse when there is a mix of both) image

Fix

There are a lot of examples and they could be written by different people so it will take lot of efforts to fix and maintain consistent indentations manually. The fix replaces each tab with 4 spaces when html is generated.

Demo

Examples - 4 spaces (instead of tabs): image

Examples - 4 spaces (instead of tabs and spaces): image

britzl commented 10 months ago

NIce! Thank you.