Skip to content

DEV: restructure command pages #1648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 7 additions & 12 deletions build/components/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@ def _get_misc(self) -> None:
self._checkout(branch, repo, misc)
Component._dump_payload(repo, self._root._content, payload, misc.get('git_uri'), branch)
return

def _repo_env_dir(self) -> str:
if os.getenv(f'REPO_DIR'):
return os.getenv(f'REPO_DIR')
return ''

def _repo_uri(self) -> str:
if(os.getenv('REPOSITORY_URL')):
return os.getenv('REPOSITORY_URL')
Expand All @@ -225,7 +225,7 @@ def _skip_checkout(self, obj) -> bool:
if obj.get('git_uri') == self._repo_uri() and self._preview_mode():
return True
return False

def _checkout(self, ref, dest, obj):
if not self._skip_checkout(obj):
run(f'git checkout {ref}', cwd=dest)
Expand Down Expand Up @@ -303,15 +303,10 @@ def _make_repos(self) -> None:
def _process_commands(self) -> None:
logging.info(f'Processing {self._id} commands')
for name in self._commands:
path = f'{self._content}/commands/{command_filename(name)}'
mkdir_p(path)
run(f'mv {path}.md {path}/index.md')
md = Markdown(f'{path}/index.md')
path = f'{self._content}/commands/{command_filename(name)}.md'
md = Markdown(path)
md.process_command(name, self._commands)
c = Command(name, self._commands.get(name))
d = c.diagram()
with open(f'{path}/syntax.svg', 'w+') as f:
f.write(d)
# Note: SVG generation removed as part of directory structure simplification

def _process_docs(self) -> None:
logging.info(f'Processing {self._id} docs')
Expand Down Expand Up @@ -500,7 +495,7 @@ def _get_example_id_from_file(self, path):

def _copy_examples(self):
if ex := self.get('examples'):
repo = self._git_clone(ex)
repo = self._git_clone(ex)
dev_branch = ex.get('dev_branch')
self._checkout(dev_branch, repo, ex)
path = ex.get('path', '')
Expand Down
4 changes: 2 additions & 2 deletions build/update_cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
v = j.get(k)
c = Command(k, v)
sf = c.syntax()
path = f'content/commands/{k.lower().replace(" ", "-")}/'
md = Markdown(f'{path}index.md')
path = f'content/commands/{k.lower().replace(" ", "-")}.md'
md = Markdown(path)
md.fm_data |= v
md.fm_data.update({
'syntax_str': str(c),
Expand Down
File renamed without changes.
10 changes: 0 additions & 10 deletions content/commands/acl-cat/syntax.svg

This file was deleted.

File renamed without changes.
10 changes: 0 additions & 10 deletions content/commands/acl-deluser/syntax.svg

This file was deleted.

File renamed without changes.
14 changes: 0 additions & 14 deletions content/commands/acl-dryrun/syntax.svg

This file was deleted.

File renamed without changes.
10 changes: 0 additions & 10 deletions content/commands/acl-genpass/syntax.svg

This file was deleted.

File renamed without changes.
8 changes: 0 additions & 8 deletions content/commands/acl-getuser/syntax.svg

This file was deleted.

File renamed without changes.
7 changes: 0 additions & 7 deletions content/commands/acl-help/syntax.svg

This file was deleted.

File renamed without changes.
7 changes: 0 additions & 7 deletions content/commands/acl-list/syntax.svg

This file was deleted.

File renamed without changes.
7 changes: 0 additions & 7 deletions content/commands/acl-load/syntax.svg

This file was deleted.

File renamed without changes.
12 changes: 0 additions & 12 deletions content/commands/acl-log/syntax.svg

This file was deleted.

File renamed without changes.
7 changes: 0 additions & 7 deletions content/commands/acl-save/syntax.svg

This file was deleted.

File renamed without changes.
13 changes: 0 additions & 13 deletions content/commands/acl-setuser/syntax.svg

This file was deleted.

File renamed without changes.
7 changes: 0 additions & 7 deletions content/commands/acl-users/syntax.svg

This file was deleted.

File renamed without changes.
7 changes: 0 additions & 7 deletions content/commands/acl-whoami/syntax.svg

This file was deleted.

File renamed without changes.
7 changes: 0 additions & 7 deletions content/commands/acl/syntax.svg

This file was deleted.

File renamed without changes.
9 changes: 0 additions & 9 deletions content/commands/append/syntax.svg

This file was deleted.

File renamed without changes.
7 changes: 0 additions & 7 deletions content/commands/asking/syntax.svg

This file was deleted.

File renamed without changes.
Loading