Skip to content

Commit

Permalink
Fix modules
Browse files Browse the repository at this point in the history
  • Loading branch information
goruha committed Nov 11, 2024
1 parent 4190b62 commit b127c8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
12 changes: 4 additions & 8 deletions scripts/docs-collator/ComponentRendererMD.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,19 @@ def render(self, docs_dir):
module_docs_dir = os.path.join(*path_components)
logging.info(f"Module docs dir: {module_docs_dir}")

# self._pre_rendering_fixes(self.component, module_download_dir)
self.__render_doc()
content = io.read_file_to_string(os.path.join(module_download_dir, README_MD))
# content = (
# rendering.replace_relative_links_with_github_links(
# repo, submodule_readme_content, rel_dir
# )
# )
rel_dir = "Test"

rel_dir = os.path.relpath(self.component.terraform_dir, self.component.repo.dir)

jenv = templating.init_templating(self.templates_dir)
self.doc_template = jenv.get_template("readme.md")

content = self.doc_template.render(
label=self.component.name,
title=self.component.name,
description=self.component.name,
github_edit_url=f"https://github.com/{self.component.repo.full_name}/blob/{self.component.repo.default_branch}/{rel_dir}",
github_edit_url=f"https://github.com/{self.component.repo.full_name}/blob/{self.component.repo.default_branch}/{rel_dir}/README.md",
content=content,
)

Expand Down
4 changes: 2 additions & 2 deletions scripts/docs-collator/templates/components/single/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
{{- $fullModuleName := (ds "config").name -}}
{{- $shortModuleName := ( conv.Default $fullModuleName (conv.Join (coll.GoSlice ($fullModuleName | strings.SplitN "-" 3) 1) "-")) -}}
---
title: {{ $shortModuleName }}
sidebar_label: {{ $shortModuleName }}
title: {{ $fullModuleName }}
sidebar_label: {{ $fullModuleName }}
sidebar_class_name: command
{{- if has (ds "config") "description" }}
description: |-
Expand Down

0 comments on commit b127c8d

Please sign in to comment.