Skip to content

Commit a4f3ff6

Browse files
authored
DEV: restructure command pages (#1648)
1 parent 2c085f0 commit a4f3ff6

File tree

1,020 files changed

+49
-7248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,020 files changed

+49
-7248
lines changed

build/components/component.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ def _get_misc(self) -> None:
205205
self._checkout(branch, repo, misc)
206206
Component._dump_payload(repo, self._root._content, payload, misc.get('git_uri'), branch)
207207
return
208-
208+
209209
def _repo_env_dir(self) -> str:
210210
if os.getenv(f'REPO_DIR'):
211211
return os.getenv(f'REPO_DIR')
212212
return ''
213-
213+
214214
def _repo_uri(self) -> str:
215215
if(os.getenv('REPOSITORY_URL')):
216216
return os.getenv('REPOSITORY_URL')
@@ -225,7 +225,7 @@ def _skip_checkout(self, obj) -> bool:
225225
if obj.get('git_uri') == self._repo_uri() and self._preview_mode():
226226
return True
227227
return False
228-
228+
229229
def _checkout(self, ref, dest, obj):
230230
if not self._skip_checkout(obj):
231231
run(f'git checkout {ref}', cwd=dest)
@@ -303,15 +303,10 @@ def _make_repos(self) -> None:
303303
def _process_commands(self) -> None:
304304
logging.info(f'Processing {self._id} commands')
305305
for name in self._commands:
306-
path = f'{self._content}/commands/{command_filename(name)}'
307-
mkdir_p(path)
308-
run(f'mv {path}.md {path}/index.md')
309-
md = Markdown(f'{path}/index.md')
306+
path = f'{self._content}/commands/{command_filename(name)}.md'
307+
md = Markdown(path)
310308
md.process_command(name, self._commands)
311-
c = Command(name, self._commands.get(name))
312-
d = c.diagram()
313-
with open(f'{path}/syntax.svg', 'w+') as f:
314-
f.write(d)
309+
# Note: SVG generation removed as part of directory structure simplification
315310

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

501496
def _copy_examples(self):
502497
if ex := self.get('examples'):
503-
repo = self._git_clone(ex)
498+
repo = self._git_clone(ex)
504499
dev_branch = ex.get('dev_branch')
505500
self._checkout(dev_branch, repo, ex)
506501
path = ex.get('path', '')

build/update_cmds.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
v = j.get(k)
1313
c = Command(k, v)
1414
sf = c.syntax()
15-
path = f'content/commands/{k.lower().replace(" ", "-")}/'
16-
md = Markdown(f'{path}index.md')
15+
path = f'content/commands/{k.lower().replace(" ", "-")}.md'
16+
md = Markdown(path)
1717
md.fm_data |= v
1818
md.fm_data.update({
1919
'syntax_str': str(c),
File renamed without changes.

content/commands/acl-cat/syntax.svg

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/commands/acl-deluser/syntax.svg

Lines changed: 0 additions & 10 deletions
This file was deleted.
File renamed without changes.

content/commands/acl-dryrun/syntax.svg

Lines changed: 0 additions & 14 deletions
This file was deleted.

content/commands/acl-genpass/syntax.svg

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)