Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ssorj committed Jul 20, 2024
1 parent 8aa4720 commit 06e4e0e
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 52 deletions.
12 changes: 6 additions & 6 deletions input/commands/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ links:
#### Site configuration

<table class="objects">
<tr><th><a href="/commands/site/index.html">Site</a></th><td>Overview of site commands</td></tr>
<tr><th><a href="/commands/site/index.html">Site commands</a></th><td>Overview of site commands</td></tr>
<tr><th><a href="/commands/site/create.html">Site create</a></th><td><p>Create a site</p>
</td></tr>
<tr><th><a href="/commands/site/status.html">Site status</a></th><td><p>Display the current status of a site</p>
Expand All @@ -26,15 +26,15 @@ links:
#### Site linking

<table class="objects">
<tr><th><a href="/commands/token/index.html">Token</a></th><td>Overview of token commands</td></tr>
<tr><th><a href="/commands/token/index.html">Token commands</a></th><td>Overview of token commands</td></tr>
<tr><th><a href="/commands/token/issue.html">Token issue</a></th><td><p>Issue a token file redeemable for a link to the current site</p>
</td></tr>
<tr><th><a href="/commands/token/redeem.html">Token redeem</a></th><td><p>Redeem a token file in order to create a link to a remote site</p>
</td></tr>
</table>

<table class="objects">
<tr><th><a href="/commands/link/index.html">Link</a></th><td>Overview of link commands</td></tr>
<tr><th><a href="/commands/link/index.html">Link commands</a></th><td>Overview of link commands</td></tr>
<tr><th><a href="/commands/link/create.html">Link create</a></th><td><p>Create a link</p>
</td></tr>
<tr><th><a href="/commands/link/status.html">Link status</a></th><td><p>Display the status of links in the current site</p>
Expand All @@ -49,7 +49,7 @@ links:
#### Service exposure

<table class="objects">
<tr><th><a href="/commands/connector/index.html">Connector</a></th><td>Overview of connector commands</td></tr>
<tr><th><a href="/commands/connector/index.html">Connector commands</a></th><td>Overview of connector commands</td></tr>
<tr><th><a href="/commands/connector/create.html">Connector create</a></th><td><p>Create a connector</p>
</td></tr>
<tr><th><a href="/commands/connector/status.html">Connector status</a></th><td><p>Display the status of connectors in the current site</p>
Expand All @@ -61,7 +61,7 @@ links:
</table>

<table class="objects">
<tr><th><a href="/commands/listener/index.html">Listener</a></th><td>Overview of listener commands</td></tr>
<tr><th><a href="/commands/listener/index.html">Listener commands</a></th><td>Overview of listener commands</td></tr>
<tr><th><a href="/commands/listener/create.html">Listener create</a></th><td><p>Create a listener</p>
</td></tr>
<tr><th><a href="/commands/listener/status.html">Listener status</a></th><td><p>Display the status of listeners in the current site</p>
Expand All @@ -76,7 +76,7 @@ links:
#### Debug operations

<table class="objects">
<tr><th><a href="/commands/debug/index.html">Debug</a></th><td>Overview of debug commands</td></tr>
<tr><th><a href="/commands/debug/index.html">Debug commands</a></th><td>Overview of debug commands</td></tr>
<tr><th><a href="/commands/debug/dump.html">Debug dump</a></th><td><p>Generate a debug dump file</p>
</td></tr>
</table>
Expand Down
24 changes: 12 additions & 12 deletions input/concepts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,33 @@ links:
#### Networks and sites

<table class="objects">
<tr><th><a href="network.html">Network</a></th><td></td></tr>
<tr><th><a href="site.html">Site</a></th><td><p>A place where components of your application are running</p>
<tr><th><a href="{{site_prefix}}/concepts/network.html">Network</a></th><td></td></tr>
<tr><th><a href="{{site_prefix}}/concepts/site.html">Site</a></th><td><p>A place where components of your application are running</p>
</td></tr>
<tr><th><a href="platform.html">Platform</a></th><td><p>A system for running workloads</p>
<tr><th><a href="{{site_prefix}}/concepts/platform.html">Platform</a></th><td><p>A system for running workloads</p>
</td></tr>
<tr><th><a href="namespace.html">Namespace</a></th><td></td></tr>
<tr><th><a href="{{site_prefix}}/concepts/namespace.html">Namespace</a></th><td></td></tr>
</table>

#### Site linking

<table class="objects">
<tr><th><a href="link.html">Link</a></th><td><p>A site-to-site communication channel</p>
<tr><th><a href="{{site_prefix}}/concepts/link.html">Link</a></th><td><p>A site-to-site communication channel</p>
</td></tr>
<tr><th><a href="link-access.html">Link access</a></th><td></td></tr>
<tr><th><a href="access-grant.html">Access grant</a></th><td><p>Permission to redeem access tokens for links to the local site</p>
<tr><th><a href="{{site_prefix}}/concepts/link-access.html">Link access</a></th><td></td></tr>
<tr><th><a href="{{site_prefix}}/concepts/access-grant.html">Access grant</a></th><td><p>Permission to redeem access tokens for links to the local site</p>
</td></tr>
<tr><th><a href="access-token.html">Access token</a></th><td><p>A transferrable token redeemable for a link to a remote site</p>
<tr><th><a href="{{site_prefix}}/concepts/access-token.html">Access token</a></th><td><p>A transferrable token redeemable for a link to a remote site</p>
</td></tr>
</table>

#### Service exposure

<table class="objects">
<tr><th><a href="service.html">Service</a></th><td></td></tr>
<tr><th><a href="connector.html">Connector</a></th><td><p>Binds target workloads in the local site to listeners in remote sites</p>
<tr><th><a href="{{site_prefix}}/concepts/service.html">Service</a></th><td></td></tr>
<tr><th><a href="{{site_prefix}}/concepts/connector.html">Connector</a></th><td><p>Binds target workloads in the local site to listeners in remote sites</p>
</td></tr>
<tr><th><a href="listener.html">Listener</a></th><td><p>Binds a connection endpoint in the local site to target workloads in remote sites</p>
<tr><th><a href="{{site_prefix}}/concepts/listener.html">Listener</a></th><td><p>Binds a connection endpoint in the local site to target workloads in remote sites</p>
</td></tr>
<tr><th><a href="routing-key.html">Routing key</a></th><td></td></tr>
<tr><th><a href="{{site_prefix}}/concepts/routing-key.html">Routing key</a></th><td></td></tr>
</table>
12 changes: 6 additions & 6 deletions input/resources/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ links:
#### Site configuration

<table class="objects">
<tr><th><a href="site.html">Site</a></th><td><p>A place where components of your application are running</p>
<tr><th><a href="{{site_prefix}}/resources/site.html">Site</a></th><td><p>A place where components of your application are running</p>
</td></tr>
</table>

#### Site linking

<table class="objects">
<tr><th><a href="link.html">Link</a></th><td><p>A site-to-site communication channel</p>
<tr><th><a href="{{site_prefix}}/resources/link.html">Link</a></th><td><p>A site-to-site communication channel</p>
</td></tr>
<tr><th><a href="accessgrant.html">AccessGrant</a></th><td><p>Permission to redeem access tokens for links to the local site</p>
<tr><th><a href="{{site_prefix}}/resources/accessgrant.html">AccessGrant</a></th><td><p>Permission to redeem access tokens for links to the local site</p>
</td></tr>
<tr><th><a href="accesstoken.html">AccessToken</a></th><td><p>A transferrable token redeemable for a link to a remote site</p>
<tr><th><a href="{{site_prefix}}/resources/accesstoken.html">AccessToken</a></th><td><p>A transferrable token redeemable for a link to a remote site</p>
</td></tr>
</table>

#### Service exposure

<table class="objects">
<tr><th><a href="connector.html">Connector</a></th><td><p>Binds a connection endpoint in the local site to target workloads in remote sites</p>
<tr><th><a href="{{site_prefix}}/resources/connector.html">Connector</a></th><td><p>Binds a connection endpoint in the local site to target workloads in remote sites</p>
</td></tr>
<tr><th><a href="listener.html">Listener</a></th><td><p>Binds target workloads in the local site to listeners in remote sites</p>
<tr><th><a href="{{site_prefix}}/resources/listener.html">Listener</a></th><td><p>Binds target workloads in the local site to listeners in remote sites</p>
</td></tr>
</table>
28 changes: 13 additions & 15 deletions python/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("<table class=\"objects\">")
append(f"<tr><th><a href=\"{command.href}\">{title}</a></th><td>{description}</td></tr>")
append("<table class=\"objects\">")
append(f"<tr><th><a href=\"{command.href}\">{title}</a></th><td>{description}</td></tr>")

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"<tr><th><a href=\"{subcommand.href}\">{title}</a></th><td>{description}</td></tr>")
append(f"<tr><th><a href=\"{subcommand.href}\">{title}</a></th><td>{description}</td></tr>")

append("</table>")
append()
append("</table>")
append()

append()

Expand Down
6 changes: 3 additions & 3 deletions python/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down
11 changes: 5 additions & 6 deletions python/concepts.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,20 @@ def append(line=""):
append("<table class=\"objects\">")

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"<tr><th><a href=\"{concept.id}.html\">{name}</a></th><td>{description}</td></tr>")
append(f"<tr><th><a href=\"{concept.href}\">{title}</a></th><td>{description}</td></tr>")

append("</table>")
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}")
Expand All @@ -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("<section>")
append()
Expand Down
8 changes: 4 additions & 4 deletions python/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ def append(line=""):
append("<table class=\"objects\">")

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"<tr><th><a href=\"{resource.id}.html\">{resource.rename}</a></th><td>{description}</td></tr>")
append(f"<tr><th><a href=\"{resource.href}\">{title}</a></th><td>{description}</td></tr>")

append("</table>")
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}")
Expand Down

0 comments on commit 06e4e0e

Please sign in to comment.