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

Create shortcode for bash commands #221

Closed
smythp opened this issue Aug 21, 2023 · 0 comments · Fixed by #218
Closed

Create shortcode for bash commands #221

smythp opened this issue Aug 21, 2023 · 0 comments · Fixed by #218
Labels
enhancement New feature or request

Comments

@smythp
Copy link
Collaborator

smythp commented Aug 21, 2023

This was raised in PR #218.

When giving examples of bash (or other REPL) commands, often you want to include the $ or prompt for context to distinguish from output, but then the $ or prompt must be manually removed before pasting.

It might make sense to create a Hugo shortcode to handle this. It could use pseudo-elements to show the $, which would make them visible but not (by default on most browsers) copyable. On screen readers the content would appear as it does now (most screen readers treat pseudo-elements as elements), which I think is acceptable.

I think the potential downsides here are a lack of simplicity, and also making future migrations more difficult, as we'd be using more Hugo-specific features. However, I think this would improve the user experience. I'd be happy to write the shortcode if we think it's a good idea.

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

Successfully merging a pull request may close this issue.

1 participant