You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know how to write or extend a markdown processor so that's the best solution I could come up with. One that requires no html to write a post would be great.
Thanks.
The text was updated successfully, but these errors were encountered:
ianmuchina
changed the title
Shell prompts & Title bars in code blocks??
Shell prompts & Title bars in code blocks
Jun 7, 2020
Hi... 👋️ @ianmuchina, jekyll-klise using kramdown for processing markdown files, it has a feature called IAL you can pass anythings HTML attributes, for example
```ruby
def what?
42
end
```
{: data-label="home/documents/test.rb"}
Result:
You can select all the attributes via CSS using selector attribute([data-label]) and adding ::before/::after pseudo-element, give property content: attr(label-data).
I think will solve the problems, I still open the issue may some people have a better solution.
1. Shell prompt
When sharing code blocks, I want to make it easy for the reader to know wether it is a snippet or, a Terminal command. Adding a $ sign works okay.
Making the $ unselectable would make copying commands easier.
2. Top Bar
Having a title bar with a label adds context for readers. It also makes skimming through a long post easy .
Solution
I've made a quick and dirty solution in html and css. You can find it here
Title Bar
To add a title bar, I add html content and give it the
window-bar
classThen I add a code snippet in markown with the '`' below the element
Shell prompt
For this I use html
CSS
In syntax.scss I added this:
Links
Digital ocean custom markdown processor with some good features all in markdown.
Blog post I found adressing this
I don't know how to write or extend a markdown processor so that's the best solution I could come up with. One that requires no html to write a post would be great.
Thanks.
The text was updated successfully, but these errors were encountered: