Skip to content
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

Remove "Edit this page" and contributors list from Command docs #1729

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading