您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Pull sidebar info and readme above files on repository page
当前为
- /* ==UserStyle==
- @name GitHub - single column with important info on the top
- @namespace myfonj
- @version 1.8.1
- @description Pull sidebar info and readme above files on repository page
- @author myf
- ==/UserStyle== */
- @-moz-document domain("github.com") {
- /* just for categorization */
- /* … and this little photo zoom */
- .Popover .avatar-user {
- min-width: 240px;
- min-height: 240px;
- /* image-rendering: crisp-edges */
- }
- }
- @-moz-document regexp("^https?://github.com/(?!password_reset|settings)([^#?/]+)/([^#?/]+)/?([#?].*)?$") {
- /*
- GitHub - single column with important info on the top
- https://greasyfork.org/en/scripts/406729/versions/new
- examples
- https://github.com/mmulet/code-relay
- few contributors, many columns
- https://github.com/mozilla/readability
- used by ..
- https://github.com/GoogleChromeLabs/dark-mode-toggle
- many tags, much everything
- https://github.com/WebReflection/sqlite-worker
- five columns
- https://github.com/rilwis/bamboo
- fork, just two columns
- https://github.com/mozilla/standards-positions
- no about, no tags
- https://github.com/mcmilk/7-Zip-zstd/
- sponsor
- https://github.com/mdn/mdn-minimalist
- no readme TOC
- */
- /* unify main max width and centering
- */
- main > div {
- max-width: none !important;
- max-width: 80rem !important;
- max-width: 90rem !important;
- margin-left: auto;
- margin-right: auto;
- }
- /* Header row with name, description for mobile, tabs, etc */
- main > div:first-child {
- display: flex;
- flex-direction: column;
- background-color: transparent !important;
- padding-top: 0 !important;
- }
- /* "Tabs" (Code , PRs, Actions, ... ) pull above main heading */
- main > div:first-child > nav {
- order: -1;
- margin-bottom: 1rem;
- }
- /* main "columns" wrapper (files | sidebar) - convert to reversed rows */
- .repository-content .Layout {
- display: flex !important;
- flex-direction: column-reverse !important;
- }
- /* Files, Sidebar - now rows*/
- .repository-content .Layout > div {
- width: auto;
- }
- /*
- main column - wrapper of:
- - file navigation (branches, tags left, goto, file right)
- - files (moved to bottom, except for 1. "row" with latest commit positioned to file navigation)
- - readme (moved under file navigation)
- */
- .repository-content .Layout > .Layout-main {
- position: relative;
- display: flex;
- flex-direction: column;
- }
- .repository-content .Layout > .Layout-main > .file-navigation {
- order: -2;
- }
- /*
- Readme - move before files files
- there are two kinds of readme blocks:
- - "fancy" readme-toc component with kebab menu of headings (introduced around 2021-03-26)
- - see e.g. https://github.com/SerenityOS/serenity
- - "normal" div#readme
- - see e.g. https://github.com/mozilla/readability
- */
- .repository-content .Layout > .Layout-main > readme-toc,
- .repository-content .Layout > .Layout-main > #readme {
- order: -1;
- }
- /* sticky "README.md" heading / TOC box make simple button */
- .repository-content .Layout > .Layout-main > readme-toc > #readme > :first-child {
- display: inline-flex !important;
- border: none !important;
- background-color: transparent !important
- /**/
- }
- /* "readme.md" label/link heading after TOC button: hide */
- .repository-content .Layout > .Layout-main > readme-toc > #readme > :first-child h2{ display: none; }
- /* actual readme box: push up into place freed by heading / TOC box */
- .repository-content .Layout > .Layout-main > readme-toc > #readme > :last-child{
- margin-top: -3rem
- }
- /*
- sidebar - now top content
- for god's sake, THIS div should be MAIN and should be near H1 or something
- not suffocated at the end of the document in sidebar
- */
- .repository-content .Layout > .Layout-sidebar > div {
- display: flex;
- flex-direction: row;
- /* let's try without
- flex-wrap: wrap;
- now */
- padding-bottom: 1rem;
- }
- /* all main flex items (about .. languages)*/
- .repository-content .Layout > .Layout-sidebar > div > * {
- flex-grow: 1;
- flex-shrink: 10;
- border-left: 1px solid var(--color-border-secondary);
- border-left: none;
- padding-left: .5rem;
- padding-right: .5rem;
- padding-bottom: 1rem;
- }
- /*
- first "about" cell
- */
- .repository-content .Layout > .Layout-sidebar > div:first-child > div:first-child {
- flex-basis: 25rem;
- flex-grow: 50;
- flex-shrink: 1;
- border-left: none;
- padding-left: 0;
- }
- /* 📖 Readme ⚖️ License : condense */
- .repository-content .Layout > .Layout-sidebar > div:first-child > div:first-child > div > h3 + div {
- display: inline-block;
- margin-right: 1em;
- }
- /* unnecessary link icon, may cause wrap, hide */
- .repository-content .Layout > .Layout-sidebar > div:first-child > div:first-child .octicon-link {
- display: none;
- }
- /* last "(programming) languages" cell */
- .repository-content .Layout > .Layout-sidebar > div:first-child > div:last-child {
- flex-shrink: 100;
- /* let's try without limiting */
- }
- /* no border nor paddings */
- .repository-content .Layout > .Layout-sidebar > div > div > div {
- border: none;
- padding: 0;
- }
- /* headings */
- .repository-content .Layout > .Layout-sidebar > div > div > div > h2 ,
- .repository-content .Layout > .Layout-sidebar > div > div > div > h2 > a {
- white-space: nowrap !important;
- }
- /* tags in about cell - restack and dim */
- .repository-content .Layout > .Layout-sidebar > div:first-child > div .f6:not(:hover) {
- opacity: 0.5;
- }
- .repository-content .Layout > .Layout-sidebar > div:first-child > div .f6 {
- display: flex;
- flex-wrap: wrap;
- }
- .repository-content .Layout > .Layout-sidebar > div:first-child > div .f6 > * {
- flex-grow: 1;
- text-align: center;
- }
- /* "used by 108" - make 8 avatars wrap */
- .hx_flex-avatar-stack {
- flex-wrap: wrap;
- max-width: 10rem;
- padding-right: .8rem;
- }
- /* allowing wrap of counter under "used by" avatars */
- .repository-content .Layout > .Layout-sidebar > div:first-child > div .d-flex.flex-items-center {
- flex-wrap: wrap;
- }
- /*
- un-truncating everything to allow wrapping of long (esp. in "releases" cell
- affects "releases", but whatever
- */
- .repository-content .Layout > .Layout-sidebar > div > * * {
- white-space: normal !important;
- }
- /* un-flexing latest release */
- .repository-content .Layout > .Layout-sidebar > div > * .Link--primary.d-flex * { display: block !important}
- /* superfluous link icon in "sponsor this project" */
- .repository-content .Layout > .Layout-sidebar > div > * [style="min-width:32px;height:32px;"] {
- display: none !important;
- }
- /* environments "active" tag below text */
- .repository-content .Layout > .Layout-sidebar > div > * h2 + .list-style-none li .Label {
- display: block;
- }
- /*
- last commit & "commits" link
- normally above files table, moving into file navigation
- */
- .repository-content .Layout > .Layout-main > *:not([id]) > .Box-header {
- position: absolute !important;
- padding: 0;
- top: .33rem;
- border: none;
- left: 16rem; /* space for branch selector, branches, tags */
- right: 21rem; /* space for Go to file, Add file, Code/clone */
- background-color: transparent !important;
- z-index: 90; /* for "..." unfolding */
- }
- /* unnecesary non-TOC "readme.md" heading box */
- .repository-content .Layout > .Layout-main > [id="readme"] > .Box-header:first-child { display: none !important; }
- /* hide hash */
- .repository-content .Layout > .Layout-main .Box-header .text-mono {
- display: none !important
- }
- /* reverse order so commit count ends up beside tag count */
- .repository-content .Layout > .Layout-main .Box-header > div > :last-child {
- order: -1;
- padding-right: 1rem;
- }
- /* hide "commits" text (lave icon) (more space for last commit msg) */
- .repository-content .Layout > .Layout-main .Box-header > div > :last-child .color-text-secondary {
- display: none !important;
- }
- /* hide "branches" and "tags" text (lave icons) (more space for last commit msg) */
- .file-navigation .color-text-tertiary{
- display: none;
- }
- }