{% extends "layout.html" %}

{% comment %}
Copyright (C) 2017-2019  The Software Heritage developers
See the AUTHORS file at the top-level directory of this distribution
License: GNU Affero General Public License version 3, or any later version
See top-level LICENSE file for more information
{% endcomment %}

{% load static %}

{% block title %}Welcome to the Software Heritage archive{% endblock %}

{% block navbar-content %}

<h4>Welcome to the Software Heritage archive</h4>

{% endblock %}

{% block content %}

<h4>Overview</h4>

<p>
  The long term goal of the Software Heritage initiative is to <strong>collect</strong>
  all publicly available software in source code form together with its
  development history, replicate it massively to ensure its <strong>preservation</strong>,
  and <strong>share</strong> it with everyone who needs it.

  The Software Heritage archive is growing over time as we crawl new source code from software
  projects and development forges.
</p>

<p>
  <div class="row">
    <div class="col-md-4 swh-web-app-link" align="center">
      <a href="{% url 'browse-search' %}">
        <img alt="Browse the Software Heritage archive" src="{% static 'img/swh-browse.png' %}"/>
        <h5>Browse</h5>
        <p>Explore the archive using a dedicated web interface.</p>
      </a>
    </div>
    <div class="col-md-4 swh-web-app-link" align="center">
      <a href="{% url 'api-1-homepage' %}">
        <img alt="Software Heritage Web API" src="{% static 'img/swh-api.png' %}"/>
        <h5>Web API</h5>
        <p>Query the archive programmatically using a RESTful API.</p>
      </a>
    </div>
    <div class="col-md-4 swh-web-app-link" align="center">
      <a href="https://softwareheritage.org/support">
        <img alt="Support Software Heritage" src="{% static 'img/swh-support.png' %}"/>
        <h5>Support</h5>
        <p>You can help build the Great Library of Source Code!</p>
      </a>
    </div>
  </div>
</p>

<h4>Content</h4>

<p>
  A significant amount of source code has already been ingested in the Software Heritage
  archive. It currently includes:
</p>
<iframe class="swh-coverage-list" src="{% url 'swh-coverage' %}"></iframe>

<h4>Size</h4>

<p>
  As of today the archive already contains and keeps safe for you the following amount
  of objects:

  <div class="row">
    <div class="col-md-4" align="center">
      <h5>Source files</h5>
      <span id="swh-contents-count" class="swh-counter"></span>
      <div class='d3-wrapper' id="swh-contents-count-history"></div>
    </div>
    <div class="col-md-4 swh-counter-container" align="center">
      <h5>Commits</h5>
      <span id="swh-revisions-count" class="swh-counter"></span>
      <div class='d3-wrapper' id="swh-revisions-count-history"></div>
    </div>
    <div class="col-md-4 swh-counter-container" align="center">
      <h5>Projects</h5>
      <span id="swh-origins-count" class="swh-counter"></span>
      <div class='d3-wrapper' id="swh-origins-count-history"></div>
    </div>
  </div>

  <div class="row mt-3">
    <div class="col-md-4" align="center">
      <h5>Directories</h5>
      <span id="swh-directories-count" class="swh-counter"></span>
    </div>
    <div class="col-md-4 swh-counter-container" align="center">
      <h5>Authors</h5>
      <span id="swh-persons-count" class="swh-counter"></span>
    </div>
    <div class="col-md-4 swh-counter-container" align="center">
      <h5>Releases</h5>
      <span id="swh-releases-count" class="swh-counter"></span>
    </div>
  </div>

  <p class="mt-3" style="font-size: 13px">
    Note: the counters and graphs above are based on heuristics that might not reflect the exact
    size of the archive. While the long-term trends shown and ballpark figures are reliable,
    individual point-in-time values might not be.
  </p>

</p>

<script>
  swh.webapp.initHomePage();
</script>
{% endblock %}
