pulumi / docs

All things Pulumi docs!
https://pulumi.com
Apache License 2.0
128 stars 221 forks source link

add indentation guides to codeblocks. #11662

Open dixler opened 2 years ago

dixler commented 2 years ago

Hello!

Issue details

for some languages(python, yaml) it's hard to identify the nesting of different expressions. Indentation guides(the | on the left) can clarify these. Can we style codefences to have indentation guides?

2022-08-15-080045_788x560_scrot

cc @susanev

Affected area/feature

susanev commented 2 years ago

@kimberleyamackenzie do you think this would be possible to do in a reasonable amount of time?

kimberleyamackenzie commented 2 years ago

off the cuff looking at the code we have now (caveat that i don't have a ton of familiarity with the internals of the code blocks in docs, so i'm just looking at the rendered markup) i do not think this would be feasible to easily build + maintain. it looks like we get our syntax highlighting from hugo's built-in functionality, which is driven by chroma: https://gohugo.io/content-management/syntax-highlighting, which doesn't offer any indentation guides as far as i can tell. a quick search didn't turn up any packages we could add just to get the indentation functionality, so if that's the case, the easiest thing would probably be to swap out for a package that does both syntax highlighting and the guides, and that would be a pretty big chunk of work, i'm guessing.

if we did decide to take on this work at some point, i think it would be worth a 1-day spike to more deeply understand the current state and options.

susanev commented 2 years ago

thx for taking a look, gonna keep it on our backlog for now.