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

  • e9eb27c
  • /
  • templates
  • /
  • view
  • /
  • view_general.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
content badge
swh:1:cnt:f5cbaace9f7faf9f589ca374ab059b1abba08843
directory badge
swh:1:dir:033038e60894f76e0c7a9d49ad505b8121f41ed2

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
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
view_general.js
/**
 * This function adds headings to the parent div
 * @param parent_div_id
 * @param heading_label
 */
function add_heading(parent_div_id, heading_label) {
    let div_heading = d3.select('#' + parent_div_id).append('div').attr('class', id_class_heading)
        .attr('id', parent_div_id + id_heading_ending);

    div_heading.append('svg').attr('id', parent_div_id + id_heading_ending + id_svg_endging)
        .style('width', '100%')
        .style('height', '100%')
        .style('x', 0)
        .append('text')
        .text(heading_label)
        .attr('font-size', '1.2em')
        .attr('text-anchor', 'start')
        .attr('transform', 'translate(0,'+33/2 +')');
}

function add_content_div(parent_div_id) {
    d3.select('#' + parent_div_id).append('div')
        .attr('id', parent_div_id + id_content_ending)
        .attr('class', id_content_class);
}

function objects_are_equivalent(a, b) {
// Create arrays of property names
    var aProps = Object.getOwnPropertyNames(a);
    var bProps = Object.getOwnPropertyNames(b);

    // If number of properties is different,
    // objects are not equivalent
    if (aProps.length != bProps.length) {
        return false;
    }

    for (var i = 0; i < aProps.length; i++) {
        var propName = aProps[i];

        // If values of same property are not equal,
        // objects are not equivalent
        if (a[propName] !== b[propName]) {
            return false;
        }
    }

    // If we made it this far, objects
    // are considered equivalent
    return true;
}

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