TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

GitHub Collapsible Markdown

74 pointsby kantordabout 5 years ago

11 comments

gobengoabout 5 years ago
As others have pointed out, this has nothing to do with with markdown or github.<p>The details and summary elements are part of HTML5.<p>They&#x27;ve been implemented in WebKit and Gecko since at least 2016.<p><a href="https:&#x2F;&#x2F;html.spec.whatwg.org&#x2F;multipage&#x2F;interactive-elements.html#the-details-element" rel="nofollow">https:&#x2F;&#x2F;html.spec.whatwg.org&#x2F;multipage&#x2F;interactive-elements....</a><p><a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTML&#x2F;Element&#x2F;details" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTML&#x2F;Element&#x2F;de...</a><p>The more you know!
bluetideproabout 5 years ago
If you search around, there is a handful of specific GitHub markdown tricks that (for some reason) they don&#x27;t officially document on their own help docs. Here is a few I found quickly searching:<p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;mxstbr&#x2F;github-markdown-tricks" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mxstbr&#x2F;github-markdown-tricks</a><p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;shaunlebron&#x2F;github-markdown-hacks" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;shaunlebron&#x2F;github-markdown-hacks</a><p>- <a href="https:&#x2F;&#x2F;grantwinney.com&#x2F;cool-markdown-tricks-for-github&#x2F;" rel="nofollow">https:&#x2F;&#x2F;grantwinney.com&#x2F;cool-markdown-tricks-for-github&#x2F;</a><p>- <a href="https:&#x2F;&#x2F;ourcodeworld.com&#x2F;articles&#x2F;read&#x2F;162&#x2F;tips-and-tricks-that-you-probably-don-t-know-with-the-github-markdown-in-readme-md-files" rel="nofollow">https:&#x2F;&#x2F;ourcodeworld.com&#x2F;articles&#x2F;read&#x2F;162&#x2F;tips-and-tricks-t...</a><p>If you just search &quot;github markdown tricks&quot;, you&#x27;ll find some others, as well.
dwheelerabout 5 years ago
This is HTML5; this doesn&#x27;t have anything to do with GitHub or Markdown.<p>Markdown passes through HTML (by default), and HTML5 includes &quot;details&quot;. Almost all browsers support it, but IE (even IE 11) does not: <a href="https:&#x2F;&#x2F;caniuse.com&#x2F;#feat=details" rel="nofollow">https:&#x2F;&#x2F;caniuse.com&#x2F;#feat=details</a> - whether or not that matters depends on your users&#x2F;customers. (You may insert your complaints about IE here :-) ).
chadlaviabout 5 years ago
... you mean embedded HTML in a markdown file? that&#x27;s nothing new.
评论 #22496672 未加载
评论 #22495294 未加载
评论 #22495310 未加载
timdorrabout 5 years ago
Dependabot (owned by GitHub) uses this to great effect on their automated PRs.<p>Example: <a href="https:&#x2F;&#x2F;github.com&#x2F;timdorr&#x2F;tesla-trip&#x2F;pull&#x2F;107" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;timdorr&#x2F;tesla-trip&#x2F;pull&#x2F;107</a><p>The show the recent release notes, changelogs, and recent commit history behind what you&#x27;re about to upgrade. That&#x27;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.
评论 #22496109 未加载
superkuhabout 5 years ago
You know what Github markdown really needs? It needs for anchors defined in it to be <i>actual</i> html anchors after interpretation instead of javascript dependent false anchors that don&#x27;t work without code execution.
评论 #22496336 未加载
chriswwwebabout 5 years ago
I wish more people would actually use this to wrap their 5&#x27;000 lines of console output that they copy paste into a ticket when reporting a bug instead of using markdown &quot;format as code&quot;<p>Also yes it is a &quot;hack&quot; 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
评论 #22496217 未加载
mkchoi212about 5 years ago
This is cool but I would not use this at all. I think this might just decrease discoverability&#x2F;readability of READMEs that are already too long&#x2F;complicated.
评论 #22496146 未加载
koolbaabout 5 years ago
What’s really cool is this even works with JavaScript disabled. It’s all html5!
vasili111about 5 years ago
Anything similar for Gitlab?
评论 #22495411 未加载
globular-toastabout 5 years ago
This isn&#x27;t markdown, it&#x27;s HTML. For the love of God please don&#x27;t do this. We already have HTML.<p>Emacs has been able to collapse markdown for a long time now. There&#x27;s no reason why that can&#x27;t be implemented in other renderers.