docs: add refs to port titles, fix readme files

This commit is contained in:
Milanka Ringwald 2017-12-22 23:50:30 +01:00
parent 41026ca603
commit 42c38c4a96
3 changed files with 18 additions and 12 deletions

View File

@ -6,8 +6,8 @@ import fnmatch
blacklist = [] blacklist = []
example_item = """ port_item = """
- [PORT_TITLE](#sec:PORT_LABELPort): PORT_PATH""" - [PORT_TITLE](#sec:PORT_LABELPort)"""
def get_readme_title(example_path): def get_readme_title(example_path):
title = '' title = ''
@ -39,11 +39,11 @@ def process_readmes(intro_file, ports_folder, ports_file):
for readme_dir, readme_file in matches.items(): for readme_dir, readme_file in matches.items():
with open(readme_file, 'rb') as fin: with open(readme_file, 'rb') as fin:
for line in fin: for line in fin:
#increase level of indetation # find title, add reference
parts = re.match('(#\s+)(.*)\n',line) title_parts = re.match('(#\s+)(.*)\n',line)
if parts: if title_parts:
title = parts.group(2) title = title_parts.group(2)
ports.write(example_item.replace("PORT_TITLE", title).replace("PORT_PATH", readme_file).replace("PORT_LABEL", readme_dir)) ports.write(port_item.replace("PORT_TITLE", title).replace("PORT_LABEL", readme_dir))
break break
fin.close() fin.close()
ports.write("\n\n") ports.write("\n\n")
@ -52,11 +52,17 @@ def process_readmes(intro_file, ports_folder, ports_file):
with open(readme_file, 'rb') as fin: with open(readme_file, 'rb') as fin:
for line in fin: for line in fin:
#increase level of indetation #increase level of indetation
parts = re.match('#(.*\n)',line) parts = re.match('#(.*)\n',line)
title_parts = re.match('(#\s+)(.*)\n',line)
if parts: if parts:
ports.write("#" + line + "{#sec:"+ readme_dir + "Port}") if title_parts:
ports.write("#" + title_parts.group(2) + " {" + "#sec:" + readme_dir + "Port}\n" )
else:
ports.write("#" + line)
else: else:
ports.write(line) ports.write(line)
fin.close() fin.close()
ports.close() ports.close()

View File

@ -2,13 +2,13 @@
This port allows to use the ATWILC3000 connected via UART with BTstack running on a POSIX host system, see test setup below (which lacks a proper RESET button). This port allows to use the ATWILC3000 connected via UART with BTstack running on a POSIX host system, see test setup below (which lacks a proper RESET button).
# Compilation ## Compilation
$ make $ make
The Makefile downloads the wilc3000_bt_firmware.bin firmware from the [GitHub atwilc3000/firmware](https://github.com/atwilc3000/firmware) repo. The Makefile downloads the wilc3000_bt_firmware.bin firmware from the [GitHub atwilc3000/firmware](https://github.com/atwilc3000/firmware) repo.
# Usage ## Usage
Just run any of the provided examples, e.g. Just run any of the provided examples, e.g.

View File

@ -8,7 +8,7 @@ To create all example projects in the example folder, you can run:
$ make $ make
# Compile Example ## Compile Example
In one of the example folders: In one of the example folders: