From c6e82aa6375c343f7577fedd07bd2a1e50704cf6 Mon Sep 17 00:00:00 2001
From: Christoph Groth <christoph.groth@cea.fr>
Date: Tue, 3 Feb 2015 17:47:59 +0100
Subject: [PATCH] add rst-extension to README (and similar files), expand
 README.rst into a PyPI-"homepage"

---
 AUTHORS => AUTHORS.rst        |  0
 CITING => CITING.rst          |  0
 CONTRIBUTE => CONTRIBUTE.rst  |  0
 INSTALL => INSTALL.rst        |  0
 LICENSE => LICENSE.rst        |  0
 README                        | 11 -----------
 README.rst                    | 37 +++++++++++++++++++++++++++++++++++
 README_WINDOWS.txt            |  4 ++--
 doc/source/pre/about.rst      |  4 ++--
 doc/source/pre/authors.rst    |  2 +-
 doc/source/pre/citing.rst     |  2 +-
 doc/source/pre/contribute.rst |  2 +-
 doc/source/pre/install.rst    |  2 +-
 doc/source/pre/license.rst    |  2 +-
 setup.py                      |  9 ++++++---
 15 files changed, 52 insertions(+), 23 deletions(-)
 rename AUTHORS => AUTHORS.rst (100%)
 rename CITING => CITING.rst (100%)
 rename CONTRIBUTE => CONTRIBUTE.rst (100%)
 rename INSTALL => INSTALL.rst (100%)
 rename LICENSE => LICENSE.rst (100%)
 delete mode 100644 README
 create mode 100644 README.rst

diff --git a/AUTHORS b/AUTHORS.rst
similarity index 100%
rename from AUTHORS
rename to AUTHORS.rst
diff --git a/CITING b/CITING.rst
similarity index 100%
rename from CITING
rename to CITING.rst
diff --git a/CONTRIBUTE b/CONTRIBUTE.rst
similarity index 100%
rename from CONTRIBUTE
rename to CONTRIBUTE.rst
diff --git a/INSTALL b/INSTALL.rst
similarity index 100%
rename from INSTALL
rename to INSTALL.rst
diff --git a/LICENSE b/LICENSE.rst
similarity index 100%
rename from LICENSE
rename to LICENSE.rst
diff --git a/README b/README
deleted file mode 100644
index 5e6f2df0..00000000
--- a/README
+++ /dev/null
@@ -1,11 +0,0 @@
-Kwant is a Python package for numerical quantum transport calculations. It
-exposes the natural concepts of the theory of quantum transport (lattices,
-symmetries, electrodes, orbital/spin/electron-hole degrees of freedom) in a
-simple and transparent way. Kwant offers direct support for calculations of
-transport properties (conductance, noise, scattering matrix), dispersion
-relations, modes, wave functions, various Green’s functions, and
-out-of-equilibrium local quantities. Other computations involving tight-binding
-Hamiltonians can be implemented easily.
-
-See also the files INSTALL, LICENSE, AUTHORS, CITING, and CONTRIBUTE
-in this directory.
diff --git a/README.rst b/README.rst
new file mode 100644
index 00000000..b6e6882a
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,37 @@
+Kwant is a free (open source) Python package for numerical calculations on
+tight-binding models with a strong focus on quantum transport. It is designed to
+be flexible and easy to use. Thanks to the use of innovative algorithms, Kwant
+is often faster than other available codes, even those entirely written in the
+low level FORTRAN and C/C++ languages.
+
+Tight-binding models can describe a vast variety of systems and phenomena in
+quantum physics. Therefore, Kwant can be used to simulate
+
+* metals,
+* graphene,
+* topological insulators,
+* quantum Hall effect,
+* superconductivity,
+* spintronics,
+* molecular electronics,
+* any combination of the above, and many other things.
+
+Kwant can calculate
+
+* transport properties (conductance, noise, scattering matrix),
+* dispersion relations,
+* modes,
+* wave functions,
+* various Green’s functions,
+* out-of-equilibrium local quantities.
+
+Other computations involving tight-binding Hamiltonians can be implemented
+easily.
+
+See the `Kwant web site <http://kwant-project.org/>`_ for the latest version.  A
+`mailing list <http://kwant-project.org/community>`_ is available for
+discussions, questions, and reporting bugs. The development of Kwant can be
+followed via the `public git repository <http://git.kwant-project.org/kwant>`_.
+
+See also the files INSTALL.rst, LICENSE.rst, AUTHORS.rst, CITING.rst, and
+CONTRIBUTE.rst in this directory.
diff --git a/README_WINDOWS.txt b/README_WINDOWS.txt
index d6d8833a..413a596f 100644
--- a/README_WINDOWS.txt
+++ b/README_WINDOWS.txt
@@ -1,6 +1,6 @@
 A note for users of Microsoft Windows
 -------------------------------------
 
-To read the text files in this directory (README, LICENSE, INSTALL, etc.),
-right-click, choose "Open", and open with "WordPad".  ("Notepad" will not
+To read the text files in this directory (README.rst, LICENSE.rst, INSTALL.rst,
+etc.), right-click, choose "Open", and open with "WordPad".  ("Notepad" will not
 display the files properly.)
diff --git a/doc/source/pre/about.rst b/doc/source/pre/about.rst
index bdf7916a..7962024e 100644
--- a/doc/source/pre/about.rst
+++ b/doc/source/pre/about.rst
@@ -1,5 +1,5 @@
 About Kwant
 ===========
 
-.. include:: ../../../README
-   :end-before: See also the files
+.. include:: ../../../README.rst
+   :end-before: See the
diff --git a/doc/source/pre/authors.rst b/doc/source/pre/authors.rst
index 48164d6b..35655805 100644
--- a/doc/source/pre/authors.rst
+++ b/doc/source/pre/authors.rst
@@ -1 +1 @@
-.. include:: ../../../AUTHORS
+.. include:: ../../../AUTHORS.rst
diff --git a/doc/source/pre/citing.rst b/doc/source/pre/citing.rst
index 257c39ef..8f56de2d 100644
--- a/doc/source/pre/citing.rst
+++ b/doc/source/pre/citing.rst
@@ -1 +1 @@
-.. include:: ../../../CITING
+.. include:: ../../../CITING.rst
diff --git a/doc/source/pre/contribute.rst b/doc/source/pre/contribute.rst
index 3aa17bcb..eccd2e4c 100644
--- a/doc/source/pre/contribute.rst
+++ b/doc/source/pre/contribute.rst
@@ -1 +1 @@
-.. include:: ../../../CONTRIBUTE
+.. include:: ../../../CONTRIBUTE.rst
diff --git a/doc/source/pre/install.rst b/doc/source/pre/install.rst
index 30687c99..c7fd0b21 100644
--- a/doc/source/pre/install.rst
+++ b/doc/source/pre/install.rst
@@ -1 +1 @@
-.. include:: ../../../INSTALL
+.. include:: ../../../INSTALL.rst
diff --git a/doc/source/pre/license.rst b/doc/source/pre/license.rst
index 6c40a061..8bf92c0b 100644
--- a/doc/source/pre/license.rst
+++ b/doc/source/pre/license.rst
@@ -1 +1 @@
-.. include:: ../../../LICENSE
+.. include:: ../../../LICENSE.rst
diff --git a/setup.py b/setup.py
index bbafc619..b8a3c6d8 100755
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,8 @@
 # http://kwant-project.org/authors.
 
 CONFIG_FILE = 'build.conf'
-README_FILE = 'README'
+README_FILE = 'README.rst'
+README_END_BEFORE = 'See also the files'
 STATIC_VERSION_FILE = 'kwant/_static_version.py'
 REQUIRED_CYTHON_VERSION = (0, 17, 1)
 NO_CYTHON_OPTION = '--no-cython'
@@ -75,7 +76,7 @@ class kwant_build_ext(build_ext):
             print >>sys.stderr, \
 """{0}
 The compilation of Kwant has failed.  Please examine the error message
-above and consult the installation instructions in README.
+above and consult the installation instructions in README.rst.
 You might have to customize {1}.
 {0}
 Build configuration was:
@@ -281,9 +282,11 @@ def long_description():
     try:
         with open(README_FILE) as f:
             for line in f:
-                if line == "\n":
+                if line.startswith(README_END_BEFORE):
                     break
                 text.append(line.rstrip())
+            while text[-1] == "":
+                text.pop()
     except:
         return ''
     return '\n'.join(text)
-- 
GitLab