From 93591380da2fbb6e6b50c9203a2f55ce730b8117 Mon Sep 17 00:00:00 2001
From: David Douard <david.douard@sdfa3.org>
Date: Thu, 16 Nov 2023 17:44:30 +0100
Subject: [PATCH] docs: include the README file in the main index page

Convert README from markdown to ReST to make it embeddable in
docs/index.rst
---
 README.md => README.rst | 11 ++++++-----
 docs/index.rst          |  5 +----
 setup.py                |  4 ++--
 3 files changed, 9 insertions(+), 11 deletions(-)
 rename README.md => README.rst (76%)

diff --git a/README.md b/README.rst
similarity index 76%
rename from README.md
rename to README.rst
index e6eae372..6b88ad0a 100644
--- a/README.md
+++ b/README.rst
@@ -1,13 +1,14 @@
-swh-model
-=========
+Software Heritage - Data model
+==============================
 
 Implementation of the Data model of the Software Heritage project, used to
 archive source code artifacts.
 
-This module defines the notion of SoftWare Heritage persistent IDentifiers
+This module defines the notion of SoftWare Hash persistent IDentifiers
 (SWHIDs) and provides tools to compute them:
 
-```sh
+.. code-block:: shell
+
    $ swh-identify fork.c kmod.c sched/deadline.c
    swh:1:cnt:2e391c754ae730bd2d8520c2ab497c403220c6e3    fork.c
    swh:1:cnt:0277d1216f80ae1adeed84a686ed34c9b2931fc2    kmod.c
@@ -15,4 +16,4 @@ This module defines the notion of SoftWare Heritage persistent IDentifiers
 
    $ swh-identify --no-filename /usr/src/linux/kernel/
    swh:1:dir:f9f858a48d663b3809c9e2f336412717496202ab
-```
+
diff --git a/docs/index.rst b/docs/index.rst
index 23ef1e45..d022ca1d 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,9 +1,6 @@
 .. _swh-model:
 
-Software Heritage - Data model
-==============================
-
-Implementation of the :ref:`data-model` to archive source code artifacts.
+.. include:: README.rst
 
 .. toctree::
    :caption: Overview:
diff --git a/setup.py b/setup.py
index c0d8af25..8698ecc1 100755
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ from setuptools import find_packages, setup
 here = path.abspath(path.dirname(__file__))
 
 # Get the long description from the README file
-with open(path.join(here, "README.md"), encoding="utf-8") as f:
+with open(path.join(here, "README.rst"), encoding="utf-8") as f:
     long_description = f.read()
 
 
@@ -39,7 +39,7 @@ setup(
     name="swh.model",
     description="Software Heritage data model",
     long_description=long_description,
-    long_description_content_type="text/markdown",
+    long_description_content_type="text/x-rst",
     python_requires=">=3.7",
     author="Software Heritage developers",
     author_email="swh-devel@inria.fr",
-- 
GitLab