Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context aware indentation in VS Code #629

Open
daeh opened this issue Jan 4, 2025 · 1 comment
Open

Context aware indentation in VS Code #629

daeh opened this issue Jan 4, 2025 · 1 comment

Comments

@daeh
Copy link

daeh commented Jan 4, 2025

Is there a way for VS Code to apply context-aware indentations in qmd files? For instance, I need the python blocks to be indented with 4 spaces. But if 4-space indentation gets applied to everything, then <div class="author">In a Div</div> renders as a code block and the callout (which with 2 spaces correctly appears as a child of the first list item) is broken.

---
title: TEST
jupyter: python3
---

## Evaluated python cell

```{python}
def f():
    print("output")

f()
```

## Code block

```python
def f():
    print("output")
```

## HTML

<div class="container">
  <div class="author">In a Div</div>
</div>

## List

- unordered list

  ::: {.callout-note}
  A Callout
  :::

  - sub-item 1
  - sub-item 2
    - sub-sub-item 1

Thanks!!

quarto: 1.6.39
VSCode: 1.96.2
OS: Darwin arm64 23.6.0
quarto plugin: 1.118.0

@daeh
Copy link
Author

daeh commented Jan 4, 2025

Is the current best solution to set the document to 4-spaces and use raw for html

```{=html}
<div class="container">
    <div class="author">In a Div</div>
</div>
```

and extra space after bullet item?

-   unordered list

    ::: {.callout-note}
    A Callout
    :::

    -   sub-item 1
    -   sub-item 2
        -   sub-sub-item 1

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant