INNER CODE UNIT · Python
setup_vals
pluralsh/plural · bin/docgen.py:52
def setup_vals(section):
return "\n\n".join(f"`{c['name']}`: {c.get('longform') or c['documentation']}" for c in section['configuration'])
@click.command()
@click.argument("repo")
def docgen(repo):
client = gql_client()
recipes = client.execute(query=recipes_q, variables={'repoName': repo})
recipes = [r['node'] for r in recipes['data']['recipes']['edges']]
recipe = client.execute(query=recipe_q, variables={'id': recipes[0]['id']})['data']['recipe']
tabs = " ".join(tab_content(repo, r) for r in recipes)
repo_name = repo.capitalize()
setup = "\n\n".join(setup_vals(section) for section in recipe['recipeSections'])
click.echo(f"""
# {repo_name}
## Description
Plural will install {repo_name} in a dependency-aware manner onto a Plural-managed Kubernetes cluster with one CLI command.