Repository: hadoop
Updated Branches:
  refs/heads/HADOOP-12111 8ba9875eb -> 5e422ab37


HADOOP-12298. releasedocmaker isn't translating greater than/less than signs in 
releasenotes (aw)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/5e422ab3
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/5e422ab3
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/5e422ab3

Branch: refs/heads/HADOOP-12111
Commit: 5e422ab3719ef755ad29baf20dc591065c2a0a82
Parents: 8ba9875
Author: Allen Wittenauer <a...@apache.org>
Authored: Wed Sep 9 08:35:24 2015 -0700
Committer: Allen Wittenauer <a...@apache.org>
Committed: Wed Sep 9 08:35:24 2015 -0700

----------------------------------------------------------------------
 dev-support/docs/releasedocmaker.md |  6 ++++++
 dev-support/releasedocmaker.py      | 14 +++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/5e422ab3/dev-support/docs/releasedocmaker.md
----------------------------------------------------------------------
diff --git a/dev-support/docs/releasedocmaker.md 
b/dev-support/docs/releasedocmaker.md
index b39de2e..31eb8e0 100644
--- a/dev-support/docs/releasedocmaker.md
+++ b/dev-support/docs/releasedocmaker.md
@@ -61,6 +61,12 @@ $ releasedocmaker.py --project HBASE --version 1.2.0
 
 ... will create a 1.2.0 directory and inside that directory will be 
CHANGES.1.2.0.md and RELEASENOTES.1.2.0.md .
 
+By default, release notes are expected to be in plain text.  However, you can 
write them in markdown if you include a header at the top of your release note:
+
+```xml
+<!-- markdown -->
+remaining text
+```
 
 # Changing the Header
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/5e422ab3/dev-support/releasedocmaker.py
----------------------------------------------------------------------
diff --git a/dev-support/releasedocmaker.py b/dev-support/releasedocmaker.py
index 3c398be..d62c0d1 100755
--- a/dev-support/releasedocmaker.py
+++ b/dev-support/releasedocmaker.py
@@ -31,6 +31,7 @@ except ImportError:
 
 RELEASE_VERSION = {}
 NAME_PATTERN = re.compile(r' \([0-9]+\)')
+RELNOTE_PATTERN = re.compile('^\<\!\-\- ([a-z]+) \-\-\>')
 
 ASF_LICENSE = '''
 <!---
@@ -88,6 +89,17 @@ def notableclean(_str):
     _str = _str.rstrip()
     return _str
 
+# if release notes have a special marker,
+# we'll treat them as already in markdown format
+def processrelnote(_str):
+  fmt = RELNOTE_PATTERN.match(_str)
+  if fmt is None:
+      return notableclean(_str)
+  else:
+      return {
+        'markdown' : tableclean(_str),
+      }.get(fmt.group(1),notableclean(_str))
+
 # clean output dir
 def clean_output_dir(directory):
     files = os.listdir(directory)
@@ -519,7 +531,7 @@ def main():
             if len(jira.get_release_note()) > 0:
                 reloutputs.write_key_raw(jira.get_project(), "\n---\n\n")
                 reloutputs.write_key_raw(jira.get_project(), line)
-                line = '\n%s\n\n' % (tableclean(jira.get_release_note()))
+                line = '\n%s\n\n' % (processrelnote(jira.get_release_note()))
                 reloutputs.write_key_raw(jira.get_project(), line)
 
         if options.lint is True:

Reply via email to