iterative / dvc.org

📖 DVC website and documentation
https://dvc.org
Apache License 2.0
335 stars 392 forks source link

Broken indentation in indented code blocks #1509

Open skshetry opened 4 years ago

skshetry commented 4 years ago

Expand the section Expand to see what happens under the hood. on https://dvc.org/doc/start/data-pipelines#pipeline-stages. The params.yaml is incorrectly rendered (indentation that is).

https://github.com/iterative/dvc.org/blob/befb19b5debaf47137d3507e1be919640211cc78/content/docs/start/data-pipelines.md#L76-L80

It seems to be correctly written. Maybe something wrong with rendering it?

UPDATE See https://github.com/iterative/dvc.org/issues/1509#issuecomment-837007355

shcheklein commented 4 years ago

Fixed, had to un-indent the whole block for this to work. Weird. Will keep this as a doc engine bug.

If yaml code block is indented to be under a bullet item rendering breaks.

jorgeorpinel commented 4 years ago

That code block was correctly indented though, it's part of a bullet. Now it's uneven (compare to the next block):

image

shcheklein commented 4 years ago

This is a temporary workaround. This engine bug.

jorgeorpinel commented 3 years ago

I changed the workaround in #2458 so the block is rendered aligned.

jorgeorpinel commented 3 years ago

Expand the section Expand to see what happens under the hood. on https://dvc.org/doc/start/data-pipelines#pipeline-stages.

BTW this also happens in the git block under that YAML block too:

image

So this probably applies to indentation with many all kinds of code blocks that are indented themselves.

UPDATE: Another place where this if currently manifested is in the remote add/modify refs per-type sections. Some of them are using workarounds to render correctly, some others not.

jorgeorpinel commented 3 years ago

Cc @rogermparent @julieg18 here's a docs-engine bug that I think would be the most useful to target next, whenever you guys are planning to look towards dvc.org/doc .

rogermparent commented 3 years ago

I believe this has to do with code blocks nested inside custom components not being handled correctly. All the instances I've seen at the top level are fine.

jorgeorpinel commented 3 years ago

Yep

jorgeorpinel commented 2 years ago

Just a note that this is still a bug. Not a common thing we run into but the workaround (adding extra spaces) conflicts with the linter in some cases.