From 13737a286a8bdf998af4eb7d9b8c934fadd398b1 Mon Sep 17 00:00:00 2001 From: Yuxuan 'fishy' Wang Date: Mon, 22 Aug 2016 15:46:24 -0700 Subject: [PATCH] Cleanups in gen_licenses.py Changes include: - Using asciidoctor's heading style - (Issue 4424) Add extra \n before closing blockquote so that an imported LICENSE file without \n at the end won't screw up the rest of the file - Change the license anchor to something more distinguishable - Use '----' instead of '[verse]\n--' for license blockquote, as we have some hack inside lib/LICENSE-prologcafe using '----' as blockquote. We could also just change lib/LICENSE-prologcafe file to use '--' instead, but I feel under asciidoctor's default css, '----' blockquotes has a slightly grey background, which is easier to read. Change-Id: I8260c47ffa66cd303b97f78c590cdfd97a8626d4 --- Documentation/gen_licenses.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/Documentation/gen_licenses.py b/Documentation/gen_licenses.py index bc2d6577e1..15f470c026 100755 --- a/Documentation/gen_licenses.py +++ b/Documentation/gen_licenses.py @@ -95,16 +95,14 @@ used = sorted(licenses.keys()) if args.asciidoc: print("""\ -Gerrit Code Review - Licenses -============================= += Gerrit Code Review - Licenses Gerrit open source software is licensed under the <>. Executable distributions also include other software components that are provided under additional licenses. [[cryptography]] -Cryptography Notice -------------------- +== Cryptography Notice This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, @@ -139,8 +137,7 @@ and/or the link:http://www.bouncycastle.org/java.html[Bouncy Castle Crypto API] to be installed by the end-user. -Licenses --------- +== Licenses """) for n in used: @@ -149,13 +146,13 @@ for n in used: if args.asciidoc: print() print('[[%s]]' % name.replace('.', '_')) - print(name) - print('~' * len(name)) + print("=== " + name) print() else: print() print(name) - print('--') + print() + print('----') for d in libs: if d.startswith('//lib:') or d.startswith('//lib/'): p = d[len('//lib:'):] @@ -166,12 +163,12 @@ for n in used: print('* ' + p) if args.asciidoc: print() - print('[[license]]') - print('[verse]') - print('--') + print('[[%s_license]]' % name.replace('.', '_')) + print('----') with open(n[2:].replace(':', '/')) as fd: copyfileobj(fd, stdout) - print('--') + print() + print('----') if args.asciidoc: print("""