retype icon indicating copy to clipboard operation
retype copied to clipboard

Additions to highlighted line numbers

Open DannyBen opened this issue 2 years ago • 1 comments

Two suggestions:

With regular code fence blocks, we can nicely highlight a line:

```ruby #3
# ...
```

but when adding this, the code block is automatically also receiving line numbers on the left, which is not always desired - like for example, when I want to highlight line an output and not actual code.

I wonder if this can be controlled somehow.

More importantly, I would love to also have the ability to highlight lines in the imported code snippets:

:::code source="../../code/usage.runfile" line="2" language="ruby" :::

DannyBen avatar Jan 28 '23 11:01 DannyBen

You can disable the default line numbering by using !#3 instead of #3.

See docs at https://retype.com/components/code-block/#with-no-line-numbers

```ruby !#3
...
```

More importantly, I would love to also have the ability to highlight lines in the imported code snippets:

Yes, good point. I'm surprised this wasn't already supported within Retype. I will mark this as a feature request and we will try to add the functionality.

geoffreymcgill avatar Mar 04 '23 06:03 geoffreymcgill