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

Feature request: add ability to highlight command name #63

Open
MustCodeAl opened this issue Feb 27, 2024 · 2 comments
Open

Feature request: add ability to highlight command name #63

MustCodeAl opened this issue Feb 27, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@MustCodeAl
Copy link

add ability to highlight command name text differently from the style of the example

like this:
Screenshot 2024-02-26 at 7 53 37 PM

config option could look like this:

[style.command_name]
color = {rgb = [96, 174, 239]} # command name is blue
background = "default"
bold = true
underline = false
italic = false
dim = false
strikethrough = false
@kbdharun kbdharun added the enhancement New feature or request label Feb 27, 2024
@kbdharun kbdharun changed the title add ability to highlight command name Feature request: add ability to highlight command name Feb 27, 2024
@MustCodeAl
Copy link
Author

after experimenting all day i kinda figured it out, but my code is quite ugly and i couldnt fix the styling for the rest of example text highlighting

Screenshot 2024-02-27 at 3 37 54 AM

@acuteenvy
Copy link
Member

This is more complicated than just splitting the string in half on first whitespace and highlighting the first part. There are pages like sha256sum, where the command is at the end instead:

- Calculate a SHA256 checksum from `stdin`:

`{{command}} | sha256sum`

That makes it harder, but not impossible. You can take the string to highlight from the title or from the filename. But there are still pages where you just can't reliably infer what the command is. Take a look at ::

We need to infer that the command to highlight is :, but:

  • The filename is colon.md,
  • The title is colon,
  • The client has no idea where exactly is the command, so highlighting by position like you tried to do is also out of the picture.

So even if we implement it, there are going to be pages where it doesn't work (unless there's some other way I haven't thought of).

What's the client from the first screenshot?

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

No branches or pull requests

3 participants