Skip to content

Commit d90c3f3

Browse files
authored
Remove "Edit this page" and contributors list from Command docs (#1729)
* Frontmatter to disable GitHub on command pages * Workaround for incorrect Vuepress warning
1 parent 927f15c commit d90c3f3

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

make_docs.nu

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ def make_docs [
7575
# Various commands for working with bits.
7676
# usage: |
7777
# Various commands for working with bits.
78+
# editLink: false # turns off the "Edit this page in GitHub for commands"
79+
# contributors: false # turns off the contributors list since it is not accurate for commands
7880
# ---
7981
# ```
8082
# - the `dfr min` command in `commands/docs/dfr_min.md`
@@ -92,6 +94,8 @@ def make_docs [
9294
# usage: |
9395
# Creates a min expression
9496
# Aggregates columns to their min value
97+
# editLink: false
98+
# contributors: false
9599
# ---
96100
# ```
97101
def command-frontmatter [commands_group, command_name] {
@@ -130,6 +134,8 @@ version: ($nu_version)
130134
($category_matter)
131135
usage: |
132136
($indented_usage)
137+
editLink: false
138+
contributors: false
133139
---"
134140
}
135141

@@ -375,7 +381,12 @@ def generate-category [category] {
375381
let safe_name = ($category | safe-path)
376382
let doc_path = (['.', 'commands', 'categories', $'($safe_name).md'] | path join)
377383

378-
$"# ($category | str title-case)
384+
$"---
385+
editLink: false
386+
contributors: false
387+
---
388+
389+
# ($category | str title-case)
379390
380391
<script>
381392
import pages from '@temp/pages'
@@ -392,14 +403,18 @@ $"# ($category | str title-case)
392403
</script>
393404
394405
<table>
395-
<tr>
396-
<th>Command</th>
397-
<th>Description</th>
398-
</tr>
399-
<tr v-for=\"command in commands\">
400-
<td><a :href=\"$withBase\(command.path\)\">{{ command.title }}</a></td>
401-
<td style=\"white-space: pre-wrap;\">{{ command.frontmatter.usage }}</td>
402-
</tr>
406+
<thead>
407+
<tr>
408+
<th>Command</th>
409+
<th>Description</th>
410+
</tr>
411+
</thead>
412+
<tbody>
413+
<tr v-for=\"command in commands\">
414+
<td><a :href=\"$withBase\(command.path\)\">{{ command.title }}</a></td>
415+
<td style=\"white-space: pre-wrap;\">{{ command.frontmatter.usage }}</td>
416+
</tr>
417+
</tbody>
403418
</table>
404419
"
405420
| save --raw --force $doc_path

0 commit comments

Comments
 (0)