Skip to content

Commit

Permalink
Fix table indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
glen-anderson committed Oct 29, 2024
1 parent 91db2e0 commit 87b8dbf
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions Documentation/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import re
import shutil
import textwrap
from dataclasses import dataclass
from operator import attrgetter
from pathlib import Path
Expand Down Expand Up @@ -56,8 +57,9 @@ def generate_examples_md():
print("Searching for shared examples...")
for directory in examples_dir.glob("*"):
if directory.name in target_excludelist:
print(f"Skipping {directory.name}... (in exclude-list)")
print(f"Skipping {directory.name}... (in exclude-list)")
continue
print(f"-> {directory.name}")
target_micro = directory.name
all_target_micros.add(target_micro)
for main_file in directory.rglob("**/main.c"):
Expand Down Expand Up @@ -86,16 +88,17 @@ def generate_examples_md():
if len(e.supported_parts) > 1:
common_entries += f"| **{e.name}** | {e.description} | {'<br/>'.join(e.supported_parts)} |\n"

markdown_content = f"""
### Common Examples
The following common examples are supported across multiple microcontrollers.
markdown_content = textwrap.dedent(
"""
### Common Examples
| Example | Description | Supported Parts |
| ------- | ----------- | --------------- |
{common_entries}
The following common examples are supported across multiple microcontrollers.
"""
| Example | Description | Supported Parts |
| ------- | ----------- | --------------- |
"""
)
markdown_content += common_entries

# Generate markdown content for part-specific examples
all_target_micros = sorted(all_target_micros)
Expand All @@ -108,15 +111,17 @@ def generate_examples_md():
]

for target, examples in specific_examples.items():
markdown_content += f"""
### {target.upper()} Examples
markdown_content += textwrap.dedent(
f"""
### {target.upper()} Examples
In addition to the [Common Examples](#common-examples), the following examples
are available specifically for the {target.upper()}.
In addition to the [Common Examples](#common-examples), the following examples
are available specifically for the {target.upper()}.
| Example | Description | MSDK Location |
| ------- | ----------- | ------------- |
"""
| Example | Description | MSDK Location |
| ------- | ----------- | ------------- |
"""
)
for e in examples:
relative_path = e.folder.relative_to(repo).as_posix()
github = (
Expand Down

0 comments on commit 87b8dbf

Please sign in to comment.