Skip to content

Commit

Permalink
💡 (docs): Add code comments to chart readme filter
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Mar 24, 2023
1 parent db38111 commit 2fcfc59
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/plugins/filter_readmes.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@ def filter_repo_readme(markdown: str, page: Page, config: Config):


def filter_chart_readme(markdown: str, page: Page, config: Config):
# Remove homepage section
homepage_re = re.compile(r"^\*\*Homepage:\*\*.*$", re.MULTILINE)
markdown = homepage_re.sub("", markdown)

# Change YAML link targets to point to the repo
yaml_re = re.compile(r"\(\./(.*\.yaml)\)")
markdown = yaml_re.sub(f"({config.repo_url}/blob/main/{page.url}\\1)", markdown)

# Set metadata from Chart.yaml
yaml_file = os.path.join(os.path.dirname(page.file.abs_src_path), "Chart.yaml")
with open(yaml_file) as f:
contents = yaml.load(f)
Expand Down

0 comments on commit 2fcfc59

Please sign in to comment.