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
  • 8c1c0b5
  • /
  • 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:5588f10cff63167851e67c83410e740e799e3e38
revision badge
swh:1:rev:6b764c2b41fb92ee99c386c0b91fb2ac206be173
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: 6b764c2b41fb92ee99c386c0b91fb2ac206be173 authored by Hadley Wickham on 06 December 2018, 23:50:07 UTC
version 1.3.0
Tip revision: 6b764c2
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