Your comment is accurate but I think its the fact that GitHub styles it in that way. I do wish it was possible to use markdown-types of elements in this way so that it could fallback on non-GitHub rendered web pages, or still look good in a text editor vs. HTML tags all over the place.
Maybe something like
^ Header
^^^
Collapsed
^^^
Similar to code blocks with the ``` syntax. I dunno.
The show the recent release notes, changelogs, and recent commit history behind what you're about to upgrade. That's immensely helpful when deciding what you want to update in your dependency list, especially if there are breaking changes. Dependency management is much less of a pain this way.
If you search around, there is a handful of specific GitHub markdown tricks that (for some reason) they don't officially document on their own help docs. Here is a few I found quickly searching:
This is HTML5; this doesn't have anything to do with GitHub or Markdown.
Markdown passes through HTML (by default), and HTML5 includes "details". Almost all browsers support it, but IE (even IE 11) does not: https://caniuse.com/#feat=details - whether or not that matters depends on your users/customers. (You may insert your complaints about IE here :-) ).
You know what Github markdown really needs? It needs for anchors defined in it to be actual html anchors after interpretation instead of javascript dependent false anchors that don't work without code execution.
Actual HTML anchors require code execution. Like I get that there is a culture of resentment of JS on this site, but the hyperbole is a little absurd. HTML and CSS engines execute code! They can also be made to behave poorly and slowly. JS can even be used to improve those behaviors for some things. One way that's relevant to the parent comment is that scrolling to anchors can be offset to accommodate flexible-height content that obscures them in normal HTML/CSS.
I wish more people would actually use this to wrap their 5'000 lines of console output that they copy paste into a ticket when reporting a bug instead of using markdown "format as code"
Also yes it is a "hack" and not official markdown, but for the use case I mention it has the huge advantage to not make tickets including all the comments excessively long
HTML blocks are part of the commonmark spec. The overlap between people who post too much in issues and know this feature is probably small though. Other platforms have JS that detects long code blocks and collapse all but the first few lines by default.
This is cool but I would not use this at all. I think this might just decrease discoverability/readability of READMEs that are already too long/complicated.
Reducing discoverability is it's entire purpose. I use them in comments when I veer off into a tangent. It keeps a code example from taking up a ton of vertical real estate, which is nice when threads get long and old comments become irrelevant.
26 comments
[ 3.2 ms ] story [ 70.8 ms ] threadhttps://jsbin.com/timafew/edit?html,output
Maybe something like
^ Header
^^^
Collapsed
^^^
Similar to code blocks with the ``` syntax. I dunno.
GitHub hardly styles it at all. It applies a margin-top on top of what normalize.css does. It's 99% your browser's default style sheet at work.
Example: https://github.com/timdorr/tesla-trip/pull/107
The show the recent release notes, changelogs, and recent commit history behind what you're about to upgrade. That's immensely helpful when deciding what you want to update in your dependency list, especially if there are breaking changes. Dependency management is much less of a pain this way.
- https://github.com/mxstbr/github-markdown-tricks
- https://github.com/shaunlebron/github-markdown-hacks
- https://grantwinney.com/cool-markdown-tricks-for-github/
- https://ourcodeworld.com/articles/read/162/tips-and-tricks-t...
If you just search "github markdown tricks", you'll find some others, as well.
Emacs has been able to collapse markdown for a long time now. There's no reason why that can't be implemented in other renderers.
Markdown passes through HTML (by default), and HTML5 includes "details". Almost all browsers support it, but IE (even IE 11) does not: https://caniuse.com/#feat=details - whether or not that matters depends on your users/customers. (You may insert your complaints about IE here :-) ).
The details and summary elements are part of HTML5.
They've been implemented in WebKit and Gecko since at least 2016.
https://html.spec.whatwg.org/multipage/interactive-elements....
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/de...
The more you know!
Also yes it is a "hack" and not official markdown, but for the use case I mention it has the huge advantage to not make tickets including all the comments excessively long