Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

swh:1:snp:bdc19e867479541d0f4994ceaa711217d0dc28ed
  • Code
  • Branches (17)
  • Releases (0)
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/tags/1.0.0
    • refs/tags/1.1.0
    • refs/tags/1.2.0
    • refs/tags/1.3.0
    • refs/tags/1.4.0
    • refs/tags/1.4.1
    • refs/tags/1.5.0
    • refs/tags/1.5.1
    • refs/tags/1.6.0
    • refs/tags/1.6.1
    • refs/tags/2.0.0
    • refs/tags/2.0.1
    • refs/tags/2.0.2
    • refs/tags/2.0.3
    • refs/tags/2.0.4
    • refs/tags/2.0.5
    No releases to show
  • b842844
  • /
  • inst
  • /
  • assets
  • /
  • pkgdown.js
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
content badge
swh:1:cnt:087a76227251d084449b3512dfe9ff20b680c371
directory badge
swh:1:dir:45f029f444dc10483d1f8f3fd7ad4dfc8a40f87b
revision badge
swh:1:rev:651be9df176377fc2008a1e0990db54e7e2f0daf
snapshot badge
swh:1:snp:bdc19e867479541d0f4994ceaa711217d0dc28ed

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 651be9df176377fc2008a1e0990db54e7e2f0daf authored by Hadley Wickham on 14 September 2019, 23:10:08 UTC
version 1.4.1
Tip revision: 651be9d
pkgdown.js
/* http://gregfranko.com/blog/jquery-best-practices/ */
(function($) {
  $(function() {

    $('.navbar-fixed-top').headroom();

    $('body').css('padding-top', $('.navbar').height() + 10);
    $(window).resize(function(){
      $('body').css('padding-top', $('.navbar').height() + 10);
    });

    $('body').scrollspy({
      target: '#sidebar',
      offset: 60
    });

    $('[data-toggle="tooltip"]').tooltip();

    var cur_path = paths(location.pathname);
    var links = $("#navbar ul li a");
    var max_length = -1;
    var pos = -1;
    for (var i = 0; i < links.length; i++) {
      if (links[i].getAttribute("href") === "#")
        continue;
      // Ignore external links
      if (links[i].host !== location.host)
        continue;

      var nav_path = paths(links[i].pathname);

      var length = prefix_length(nav_path, cur_path);
      if (length > max_length) {
        max_length = length;
        pos = i;
      }
    }

    // Add class to parent <li>, and enclosing <li> if in dropdown
    if (pos >= 0) {
      var menu_anchor = $(links[pos]);
      menu_anchor.parent().addClass("active");
      menu_anchor.closest("li.dropdown").addClass("active");
    }
  });

  function paths(pathname) {
    var pieces = pathname.split("/");
    pieces.shift(); // always starts with /

    var end = pieces[pieces.length - 1];
    if (end === "index.html" || end === "")
      pieces.pop();
    return(pieces);
  }

  // Returns -1 if not found
  function prefix_length(needle, haystack) {
    if (needle.length > haystack.length)
      return(-1);

    // Special case for length-0 haystack, since for loop won't run
    if (haystack.length === 0) {
      return(needle.length === 0 ? 0 : -1);
    }

    for (var i = 0; i < haystack.length; i++) {
      if (needle[i] != haystack[i])
        return(i);
    }

    return(haystack.length);
  }

  /* Clipboard --------------------------*/

  function changeTooltipMessage(element, msg) {
    var tooltipOriginalTitle=element.getAttribute('data-original-title');
    element.setAttribute('data-original-title', msg);
    $(element).tooltip('show');
    element.setAttribute('data-original-title', tooltipOriginalTitle);
  }

  if(ClipboardJS.isSupported()) {
    $(document).ready(function() {
      var copyButton = "<button type='button' class='btn btn-primary btn-copy-ex' type = 'submit' title='Copy to clipboard' aria-label='Copy to clipboard' data-toggle='tooltip' data-placement='left auto' data-trigger='hover' data-clipboard-copy><i class='fa fa-copy'></i></button>";

      $(".examples, div.sourceCode").addClass("hasCopyButton");

      // Insert copy buttons:
      $(copyButton).prependTo(".hasCopyButton");

      // Initialize tooltips:
      $('.btn-copy-ex').tooltip({container: 'body'});

      // Initialize clipboard:
      var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', {
        text: function(trigger) {
          return trigger.parentNode.textContent;
        }
      });

      clipboardBtnCopies.on('success', function(e) {
        changeTooltipMessage(e.trigger, 'Copied!');
        e.clearSelection();
      });

      clipboardBtnCopies.on('error', function() {
        changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy');
      });
    });
  }
})(window.jQuery || window.$)

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API