GitHub Collapse Markdown

A userscript that collapses markdown headers

目前為 2016-07-30 提交的版本,檢視 最新版本

作者
Mottie
評價
0 0 0
版本
1.1.0
建立日期
2016-06-27
更新日期
2016-07-30
尺寸
9.0 KB
授權條款
https://creativecommons.org/licenses/by-sa/4.0/
腳本執行於

A userscript that collapses markdown headers

  • This script makes all markdown headers clickable and toggles the view of all content between same level headers (e.g. between H2 headers).
  • It works on readme, issues, markdown preview, wiki & gist pages. Pretty much everywhere on GitHub.
  • Click on any header to toggle the view of the content below it.
  • Use Shift + Click to toggle the view of all same level header content.
  • When the content of a header is expanded, all sub-headers are also expanded.
  • Links within the header are still clickable.
  • Can be used along with the [[GitHub-table-of-contents]] & the [[GitHub-collapse-in-comment]] userscripts.
  • Use the userscript addon to change these settings (see screenshot below):

    • "Set collapse markdown state" to true (false by default) which collapses all header content initially.
    • "Set collapse markdown colors" to an JSON array with six color values (accepts named, hex, rgb, hsl, etc). For example:
     // palette generated by http://tools.medialab.sciences-po.fr/iwanthue/
     // (colorblind friendly; soft)
     ["#6778d0", "#ac9c3d", "#b94a73", "#56ae6c", "#9750a1", "#ba543d"]
    

    These six colors apply to the H1 through H6 header arrows respectively.

github-collapse-markdown-settings

github-collapse-markdown

Hosted with ♥ at GitHub

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址