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

feat: add +no_margin to remove margin in code blocks #363

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

mfontanini
Copy link
Owner

@mfontanini mfontanini commented Sep 9, 2024

This adds a +no_margin attribute to code blocks which removes extra margins. For themes that specify a vertical/horizontal padding (like all built in themes), the padding is still present even when using this. This only removes the margin that typically extends a bit right if your code snippet's max line length is too short.

This is especially useful when using +exec_replace so you don't get any extra margin and instead get the executed program's output as-is. For example, the following now looks like this:

```bash +exec_replace +no_margin
echo "hello world" | qrencode -t utf8
```

image

Fixes #349

@mfontanini mfontanini merged commit 1d6c34a into master Sep 9, 2024
6 checks passed
@mfontanini mfontanini deleted the feat/no-margin branch September 9, 2024 16:10
mfontanini added a commit that referenced this pull request Sep 12, 2024
This renames the `no_margin` attribute added in #363 to `no_background`
and makes it do everything `no_margin` did but also prevents presenterm
from adding a background to the snippet. This currently doesn't play
well with `exec_replace` or `exec` meaning the snippet execution output
still gets background. I will address this separately as there's other
things I want to get to but I want to close this issue.

The following

~~~markdown
```text +no_background
.__    .__
|  |__ |__|   _____   ____   _____
|  |  \|  |  /     \ /  _ \ /     \
|   Y  \  | |  Y Y  (  <_> )  Y Y  \
|___|  /__| |__|_|  /\____/|__|_|  /
     \/           \/             \/
```
~~~

Currently renders like this after this change:


![image](https://github.com/user-attachments/assets/4b883337-f238-4d85-9420-50dc42002cbf)

Fixes #349
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

Successfully merging this pull request may close these issues.

Best way to display multi-line blocks?
1 participant