Skip to content

Commit

Permalink
Remove "Edit this page" and contributors list from Command docs (#1729)
Browse files Browse the repository at this point in the history
* Frontmatter to disable GitHub on command pages

* Workaround for incorrect Vuepress warning
  • Loading branch information
NotTheDr01ds authored Jan 6, 2025
1 parent 927f15c commit d90c3f3
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions make_docs.nu
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def make_docs [
# Various commands for working with bits.
# usage: |
# Various commands for working with bits.
# editLink: false # turns off the "Edit this page in GitHub for commands"
# contributors: false # turns off the contributors list since it is not accurate for commands
# ---
# ```
# - the `dfr min` command in `commands/docs/dfr_min.md`
Expand All @@ -92,6 +94,8 @@ def make_docs [
# usage: |
# Creates a min expression
# Aggregates columns to their min value
# editLink: false
# contributors: false
# ---
# ```
def command-frontmatter [commands_group, command_name] {
Expand Down Expand Up @@ -130,6 +134,8 @@ version: ($nu_version)
($category_matter)
usage: |
($indented_usage)
editLink: false
contributors: false
---"
}

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

$"# ($category | str title-case)
$"---
editLink: false
contributors: false
---
# ($category | str title-case)
<script>
import pages from '@temp/pages'
Expand All @@ -392,14 +403,18 @@ $"# ($category | str title-case)
</script>
<table>
<tr>
<th>Command</th>
<th>Description</th>
</tr>
<tr v-for=\"command in commands\">
<td><a :href=\"$withBase\(command.path\)\">{{ command.title }}</a></td>
<td style=\"white-space: pre-wrap;\">{{ command.frontmatter.usage }}</td>
</tr>
<thead>
<tr>
<th>Command</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr v-for=\"command in commands\">
<td><a :href=\"$withBase\(command.path\)\">{{ command.title }}</a></td>
<td style=\"white-space: pre-wrap;\">{{ command.frontmatter.usage }}</td>
</tr>
</tbody>
</table>
"
| save --raw --force $doc_path
Expand Down

0 comments on commit d90c3f3

Please sign in to comment.