diff options
author | Yuxuan 'fishy' Wang <fishywang@google.com> | 2016-08-22 15:46:24 -0700 |
---|---|---|
committer | David Pursehouse <dpursehouse@collab.net> | 2016-09-16 09:47:08 +0200 |
commit | 13737a286a8bdf998af4eb7d9b8c934fadd398b1 (patch) | |
tree | 0b497fb7b88a4a79a1ec14ee4b04a500b7a56741 | |
parent | 4feb667bf718972a90bb7147218d7b92dc24b042 (diff) |
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
-rwxr-xr-x | Documentation/gen_licenses.py | 23 |
1 files 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 <<Apache2_0,Apache License 2.0>>. 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(""" |