Skip to content

Instantly share code, notes, and snippets.

@hbre
Created September 18, 2019 13:57
Show Gist options
  • Select an option

  • Save hbre/1d77e3793a8cda4af2e26b5f1844bb71 to your computer and use it in GitHub Desktop.

Select an option

Save hbre/1d77e3793a8cda4af2e26b5f1844bb71 to your computer and use it in GitHub Desktop.

Revisions

  1. hbre created this gist Sep 18, 2019.
    73 changes: 73 additions & 0 deletions better_wiki_print.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,73 @@
    @namespace url(http://www.w3.org/1999/xhtml);
    @-moz-document domain("gitlab.fm.db.de") {
    @media print {
    /* fix firefox print internal error (https://bugzilla.mozilla.org/show_bug.cgi?id=1308516) */

    html.turbolinks-progress-bar::before {
    display: none !important;
    }
    /* don't show target urls after non-wiki (i.e. navigational) links; it makes the content unreadable */

    a:link:after,
    a:visited:after {
    content: "";
    }
    /* re-enable showing href for external wiki links (target=_blank) */

    a[href][target]:not([href='']):link:after,
    a[href][target]:not([href='']):visited:after {
    content: " ("attr(href) ") ";
    text-decoration: none;
    font-weight: normal;
    font-style: italic;
    font-size: 90%;
    }
    /* otherwise try to show title (becomes data-original-title with javascript after tooltip hover) */

    a[title]:not([title='']):link:after,
    a[title]:not([title='']):visited:after {
    content: " ["attr(title) "] ";
    text-decoration: none;
    font-weight: normal;
    font-style: italic;
    font-size: 90%;
    }
    a[data-original-title]:not([data-original-title='']):link:after,
    a[data-original-title]:not([data-original-title='']):visited:after {
    content: " ["attr(data-original-title) "] ";
    text-decoration: none;
    font-weight: normal;
    font-style: italic;
    font-size: 90%;
    }
    /* unhide .file-holder (https://gitlab.com/gitlab-org/gitlab-ce/issues/17203) */

    article.file-holder {
    display: block !important;
    }
    /* hide various naviation / message areas */

    .page-with-sidebar {
    padding-top: 0px;
    }
    .page-with-layout-nav {
    margin-top: 0px;
    }
    div.top-area,
    div.alert-wrapper,
    div.context-header,
    header,
    aside,
    div.detail-page-header,
    section.issuable-discussion,
    small.edited-text,
    div.layout-nav,
    div.nav-links,
    li.project-repo-buttons-right,
    div.project-repo-buttons,
    div.project-action-buttons,
    div.flash-container {
    display: none !important;
    }
    }
    }