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
  • 1323ef6
  • /
  • inst
  • /
  • assets
  • /
  • docsearch.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:b35504cd3a282816130a16881f3ebeead9c1bcb4
directory badge
swh:1:dir:b1cdd2a785242f9ea8b88041762422490030ba2f
revision badge
swh:1:rev:ba93f092d777b1d40f9dfca5a0b804b46b7dee5b
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: ba93f092d777b1d40f9dfca5a0b804b46b7dee5b authored by Hadley Wickham on 20 November 2018, 19:00:03 UTC
version 1.2.0
Tip revision: ba93f09
docsearch.js
$(function() {

  // register a handler to move the focus to the search bar
  // upon pressing shift + "/" (i.e. "?")
  $(document).on('keydown', function(e) {
    if (e.shiftKey && e.keyCode == 191) {
      e.preventDefault();
      $("#search-input").focus();
    }
  });

  $(document).ready(function() {
    // do keyword highlighting
    /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */
    var mark = function() {

      var referrer = document.URL ;
      var paramKey = "q" ;

      if (referrer.indexOf("?") !== -1) {
        var qs = referrer.substr(referrer.indexOf('?') + 1);
        var qs_noanchor = qs.split('#')[0];
        var qsa = qs_noanchor.split('&');
        var keyword = "";

        for (var i = 0; i < qsa.length; i++) {
          var currentParam = qsa[i].split('=');

          if (currentParam.length !== 2) {
            continue;
          }

          if (currentParam[0] == paramKey) {
            keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20"));
          }
        }

        if (keyword !== "") {
          $(".contents").unmark({
            done: function() {
              $(".contents").mark(keyword);
            }
          });
        }
      }
    };

    mark();
  });
});

/* Search term highlighting ------------------------------*/

function matchedWords(hit) {
  var words = [];

  var hierarchy = hit._highlightResult.hierarchy;
  // loop to fetch from lvl0, lvl1, etc.
  for (var idx in hierarchy) {
    words = words.concat(hierarchy[idx].matchedWords);
  }

  var content = hit._highlightResult.content;
  if (content) {
    words = words.concat(content.matchedWords);
  }

  // return unique words
  var words_uniq = [...new Set(words)];
  return words_uniq;
}

function updateHitURL(hit) {

  var words = matchedWords(hit);
  var url = "";

  if (hit.anchor) {
    url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor;
  } else {
    url = hit.url + '?q=' + escape(words.join(" "));
  }

  return url;
}

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