docsify icon indicating copy to clipboard operation
docsify copied to clipboard

Docs Update: HTML Wrappers in markdown

Open jhildenbiddle opened this issue 4 years ago • 3 comments

Feature request

It may be worth adding a note to the docs that describes using HTML wrappers in markdown for targeting elements for CSS or JavaScript.

For example, wrapping a markdown table in a <div> element with a class:

<div class="highlight">

| Header | Header  |
| -------| ------- |
| Cell   | Cell    |
| Cell   | Cell    |

</div>

Will allow that specific table to be targeted with the following CSS:

.highlight table {
  border: 2px solid red;
}

The only concern is that while this works with docsify's current markdown processor, other markdown processors may not handle blocks of HTML & markdown the same way. If docsify decides to change markdown processors in the future, this functionality could break. Just something to consider.

What problem does this feature solve?

Docsify site owners often want to target specific elements, but markdown provides no standardized mechanism for adding attributes to elements and docsify only offers this functionality on a handful of elements via helpers. This addresses that problem without using docsify-specific markup that may be unintentionally rendered in other environments (GitHub, GitLab, etc.).

What does the proposed API look like?

Just a docs update.

How should this be implemented in your opinion?

Docs update.

Are you willing to work on this yourself?

Sure.

jhildenbiddle avatar Jul 19 '20 15:07 jhildenbiddle

This solution is something I was looking for a while.

+1 for this.

Also, I don't think we are going to change the markdown processor, yeah we do have an open issue for that discussion, but that is not the priority as the current one seems working seamlessly.

anikethsaha avatar Jul 27 '20 06:07 anikethsaha

Are there alternative solutions to this problem? Be good to have this feature to fine tune styles.

andrefox333 avatar Jun 08 '22 22:06 andrefox333

Any updates on this feature.

lbrusci1 avatar Mar 31 '23 13:03 lbrusci1