From 06e4e0e3192606adcfbb49408c62ce748df7e84b Mon Sep 17 00:00:00 2001 From: Justin Ross Date: Sat, 20 Jul 2024 09:09:47 -0400 Subject: [PATCH] WIP --- input/commands/index.md | 12 ++++++------ input/concepts/index.md | 24 ++++++++++++------------ input/resources/index.md | 12 ++++++------ python/commands.py | 28 +++++++++++++--------------- python/common.py | 6 +++--- python/concepts.py | 11 +++++------ python/resources.py | 8 ++++---- 7 files changed, 49 insertions(+), 52 deletions(-) diff --git a/input/commands/index.md b/input/commands/index.md index b212929..1481377 100644 --- a/input/commands/index.md +++ b/input/commands/index.md @@ -11,7 +11,7 @@ links: #### Site configuration - +
SiteOverview of site commands
Site commandsOverview of site commands
Site create

Create a site

Site status

Display the current status of a site

@@ -26,7 +26,7 @@ links: #### Site linking - +
TokenOverview of token commands
Token commandsOverview of token commands
Token issue

Issue a token file redeemable for a link to the current site

Token redeem

Redeem a token file in order to create a link to a remote site

@@ -34,7 +34,7 @@ links:
- +
LinkOverview of link commands
Link commandsOverview of link commands
Link create

Create a link

Link status

Display the status of links in the current site

@@ -49,7 +49,7 @@ links: #### Service exposure - +
ConnectorOverview of connector commands
Connector commandsOverview of connector commands
Connector create

Create a connector

Connector status

Display the status of connectors in the current site

@@ -61,7 +61,7 @@ links:
- +
ListenerOverview of listener commands
Listener commandsOverview of listener commands
Listener create

Create a listener

Listener status

Display the status of listeners in the current site

@@ -76,7 +76,7 @@ links: #### Debug operations - +
DebugOverview of debug commands
Debug commandsOverview of debug commands
Debug dump

Generate a debug dump file

diff --git a/input/concepts/index.md b/input/concepts/index.md index ac6453b..56450c1 100644 --- a/input/concepts/index.md +++ b/input/concepts/index.md @@ -11,33 +11,33 @@ links: #### Networks and sites - - + - - +
Network
Site

A place where components of your application are running

+
Network
Site

A place where components of your application are running

Platform

A system for running workloads

+
Platform

A system for running workloads

Namespace
Namespace
#### Site linking - - - + -
Link

A site-to-site communication channel

+
Link

A site-to-site communication channel

Link access
Access grant

Permission to redeem access tokens for links to the local site

+
Link access
Access grant

Permission to redeem access tokens for links to the local site

Access token

A transferrable token redeemable for a link to a remote site

+
Access token

A transferrable token redeemable for a link to a remote site

#### Service exposure - - + - - +
Service
Connector

Binds target workloads in the local site to listeners in remote sites

+
Service
Connector

Binds target workloads in the local site to listeners in remote sites

Listener

Binds a connection endpoint in the local site to target workloads in remote sites

+
Listener

Binds a connection endpoint in the local site to target workloads in remote sites

Routing key
Routing key
diff --git a/input/resources/index.md b/input/resources/index.md index 5887acc..a9069f6 100644 --- a/input/resources/index.md +++ b/input/resources/index.md @@ -11,26 +11,26 @@ links: #### Site configuration -
Site

A place where components of your application are running

+
Site

A place where components of your application are running

#### Site linking - - -
Link

A site-to-site communication channel

+
Link

A site-to-site communication channel

AccessGrant

Permission to redeem access tokens for links to the local site

+
AccessGrant

Permission to redeem access tokens for links to the local site

AccessToken

A transferrable token redeemable for a link to a remote site

+
AccessToken

A transferrable token redeemable for a link to a remote site

#### Service exposure - -
Connector

Binds a connection endpoint in the local site to target workloads in remote sites

+
Connector

Binds a connection endpoint in the local site to target workloads in remote sites

Listener

Binds target workloads in the local site to listeners in remote sites

+
Listener

Binds target workloads in the local site to listeners in remote sites

diff --git a/python/commands.py b/python/commands.py index 3ecc5d0..18059e4 100644 --- a/python/commands.py +++ b/python/commands.py @@ -31,25 +31,23 @@ def append(line=""): append() for command in group.commands: - if command.parent is None: - title = command.title.removesuffix(" commands") - title = title.removesuffix(" command") - description = f"Overview of {command.name} commands" + title = command.title.removesuffix(" command") + description = f"Overview of {command.name} commands" - append("") - append(f"") + append("
{title}{description}
") + append(f"") - for subcommand in command.subcommands: - title = subcommand.title.removesuffix(" commands") - title = title.removesuffix(" command") - description = nvl(subcommand.description, "").replace("\n", " ") - description = description.split(".")[0] - description = mistune.html(description) + for subcommand in command.subcommands: + title = subcommand.title.removesuffix(" commands") + title = title.removesuffix(" command") + description = nvl(subcommand.description, "").replace("\n", " ") + description = description.split(".")[0] + description = mistune.html(description) - append(f"") + append(f"") - append("
{title}{description}
{title}{description}
{title}{description}
") - append() + append("
") + append() append() diff --git a/python/common.py b/python/common.py index 952e10d..3adcce7 100644 --- a/python/common.py +++ b/python/common.py @@ -20,10 +20,10 @@ def add_link(other): if not other: return - type = other.__class__.__name__.lower() + href = other.href.removeprefix("{{site_prefix}}") lines.append(f" - name: {other.title}") - lines.append(f" url: {other.href}") + lines.append(f" url: {href}") for other in obj.corresponding_objects: add_link(other) @@ -170,7 +170,7 @@ def title(self): @property def href(self): type = self.__class__.__name__.lower() - return f"/{plural(type)}/{self.id}.html" + return f"{{{{site_prefix}}}}/{plural(type)}/{self.id}.html" @property def corresponding_objects(self): diff --git a/python/concepts.py b/python/concepts.py index ae1ae0a..8c3b811 100644 --- a/python/concepts.py +++ b/python/concepts.py @@ -30,21 +30,20 @@ def append(line=""): append("") for concept in group.concepts: - name = capitalize(concept.rename) + title = concept.title.removesuffix(" concept") description = nvl(concept.description, "").replace("\n", " ") description = description.split(".")[0] description = mistune.html(description) - append(f"") + append(f"") append("
{name}{description}
{title}{description}
") append() write("input/concepts/index.md", "\n".join(lines)) - for group in model.groups: - for concept in group.concepts: - generate_concept(concept) + for concept in model.concepts: + generate_concept(concept) def generate_concept(concept): debug(f"Generating {concept}") @@ -62,7 +61,7 @@ def append(line=""): append(generate_object_links(concept)) append("---") append() - append(f"# {capitalize(concept.rename)} concept") + append(f"# {concept.title}") append() append("
") append() diff --git a/python/resources.py b/python/resources.py index c8bc73b..d9fb02f 100644 --- a/python/resources.py +++ b/python/resources.py @@ -32,20 +32,20 @@ def append(line=""): append("") for resource in group.resources: + title = resource.title.removesuffix(" resource") description = nvl(resource.description, "").replace("\n", " ") description = description.split(".")[0] description = mistune.html(description) - append(f"") + append(f"") append("
{resource.rename}{description}
{title}{description}
") append() write("input/resources/index.md", "\n".join(lines)) - for group in model.groups: - for resource in group.resources: - generate_resource(resource) + for resource in model.resources: + generate_resource(resource) def generate_resource(resource): debug(f"Generating {resource}")