From 0221e9825c22e6079536a66a97fc39752ff625ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Traizet?= <cedric.traizet@c-s.fr>
Date: Mon, 6 May 2019 11:53:02 +0200
Subject: [PATCH] DOC: added a status string for deprecated applications in the
 cookbook

---
 .../Cookbook/Scripts/otbGenerateWrappersRstDoc.py          | 7 +++++++
 Documentation/Cookbook/rst/templates/application.rst       | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py b/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py
index 8cd9ab8ed7..644f9a78c5 100755
--- a/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py
+++ b/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py
@@ -356,6 +356,12 @@ def make_links(text, allapps):
     rep = {appname: ":ref:`{}`".format(appname) for appname in allapps}
     return multireplace(text, rep)
 
+def render_deprecation_string(app):
+    if app.IsDeprecated():
+        return ("This application is deprecated and will be removed in a future release.")
+    else:
+        return("")
+
 def render_application(appname, allapps):
     "Render app to rst"
 
@@ -368,6 +374,7 @@ def render_application(appname, allapps):
 
     output = template_application.format(
         label=appname,
+        deprecation_string=render_deprecation_string(app),
         heading=rst_section(app.GetName(), '='),
         description=app.GetDescription(),
         longdescription=make_links(app.GetDocLongDescription(), allapps),
diff --git a/Documentation/Cookbook/rst/templates/application.rst b/Documentation/Cookbook/rst/templates/application.rst
index 68db4a8b3c..bbe15bceff 100644
--- a/Documentation/Cookbook/rst/templates/application.rst
+++ b/Documentation/Cookbook/rst/templates/application.rst
@@ -1,6 +1,9 @@
 .. _{label}:
 
 {heading}
+
+{deprecation_string}
+
 {description}
 
 Description
-- 
GitLab