Skip to content

Commit

Permalink
Fix make_docs.nu, adding generate docs for plugin commands support (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcer committed Apr 6, 2024
1 parent f8d0993 commit a92121f
Show file tree
Hide file tree
Showing 18 changed files with 92 additions and 73 deletions.
1 change: 1 addition & 0 deletions .vuepress/configs/sidebar/command_categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const commandCategories = [
'/commands/categories/network.md',
'/commands/categories/path.md',
'/commands/categories/platform.md',
'/commands/categories/prompt.md',
'/commands/categories/random.md',
'/commands/categories/removed.md',
'/commands/categories/shells.md',
Expand Down
2 changes: 1 addition & 1 deletion commands/categories/prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<th>Description</th>
</tr>
<tr v-for="command in commands">
<td><a :href="command.path">{{ command.title }}</a></td>
<td><a :href="$withBase(command.path)">{{ command.title }}</a></td>
<td style="white-space: pre-wrap;">{{ command.frontmatter.usage }}</td>
</tr>
</table>
10 changes: 5 additions & 5 deletions commands/docs/dfr_datepart.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ Creates an expression to capture multiple date parts
(dfr col datetime | dfr datepart minute | dfr as datetime_minute ),
(dfr col datetime | dfr datepart second | dfr as datetime_second ),
(dfr col datetime | dfr datepart nanosecond | dfr as datetime_ns ) ]
╭───┬──────────────────────────────────────────────────────────┬───────────────┬────────────────┬─────────────────┬─────────────╮
│ # │ datetime datetime_year datetime_month │ datetime_day │ datetime_hour │ datetime_minute │ datetime_second │ datetime_ns
├───┼──────────────────────────────────────────────────────────┼───────────────┼────────────────┼─────────────────┼─────────────┤
│ 0 │ 2 years ago 2021 │ 12 │ 30 1 2 3 │ 123456789
╰───┴──────────────────────────────────────────────────────────┴───────────────┴────────────────┴─────────────────┴─────────────╯
╭─────┬──────────────────────────────────────────────────┬───────────────┬────────────────┬──────────────────┬──────╮
# │ datetime datetime_year datetime_month │ datetime_day │ datetime_hour │ datetime_minute │ ...
├─────┼──────────────────────────────────────────────────┼───────────────┼────────────────┼──────────────────┼──────┤
0 │ 2 years ago 2021 │ 12 30 1 2 │ ...
╰─────┴──────────────────────────────────────────────────┴───────────────┴────────────────┴──────────────────┴──────╯
```
2 changes: 1 addition & 1 deletion commands/docs/dfr_join.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav

## Flags

- `--inner, -i`: inner joing between lazyframes (default)
- `--inner, -i`: inner join between lazyframes (default)
- `--left, -l`: left join between lazyframes
- `--outer, -o`: outer join between lazyframes
- `--cross, -c`: cross join between lazyframes
Expand Down
10 changes: 6 additions & 4 deletions commands/docs/from_eml.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: from eml
categories: |
formats
version: 0.91.0
version: 0.92.0
formats: |
Parse text as .eml and create record.
usage: |
Expand All @@ -11,14 +11,14 @@ feature: default
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# <code>{{ $frontmatter.title }}</code> for formats

<div class='command-title'>{{ $frontmatter.formats }}</div>
# `from eml` for [formats](/commands/categories/formats.md)

<div class='command-title'>Parse text as .eml and create record.</div>

::: warning
Command `from eml` resides in [plugin](/book/plugins.html) [`nu_plugin_formats`](https://crates.io/crates/nu_plugin_formats). To use this command, you must install/compile and register nu_plugin_formats
:::

## Signature

```> from eml {flags} ```
Expand All @@ -41,6 +41,7 @@ Convert eml structured data into record
> 'From: [email protected]
Subject: Welcome
To: [email protected]
Test' | from eml
╭─────────┬─────────────────────────────────────╮
│ Subject │ Welcome │
Expand All @@ -61,6 +62,7 @@ Convert eml structured data into record
> 'From: [email protected]
Subject: Welcome
To: [email protected]
Test' | from eml -b 1
╭─────────┬─────────────────────────────────────╮
│ Subject │ Welcome │
Expand Down
21 changes: 11 additions & 10 deletions commands/docs/from_ics.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: from ics
categories: |
formats
version: 0.91.0
version: 0.92.0
formats: |
Parse text as .ics and create table.
usage: |
Expand All @@ -11,14 +11,14 @@ feature: default
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# <code>{{ $frontmatter.title }}</code> for formats

<div class='command-title'>{{ $frontmatter.formats }}</div>
# `from ics` for [formats](/commands/categories/formats.md)

<div class='command-title'>Parse text as .ics and create table.</div>

::: warning
Command `from ics` resides in [plugin](/book/plugins.html) [`nu_plugin_formats`](https://crates.io/crates/nu_plugin_formats). To use this command, you must install/compile and register nu_plugin_formats
:::

## Signature

```> from ics {flags} ```
Expand All @@ -35,11 +35,12 @@ Command `from ics` resides in [plugin](/book/plugins.html) [`nu_plugin_formats`]
Converts ics formatted string to table
```nu
> 'BEGIN:VCALENDAR
END:VCALENDAR' | from ics
╭───┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────╮
│ # │ properties │ events │ alarms │ to-Dos │ journals │ free-busys │ timezones │
├───┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┤
│ 0 │ [list 0 items] │ [list 0 items] │ [list 0 items] │ [list 0 items] │ [list 0 items] │ [list 0 items] │ [list 0 items] │
╰───┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────╯
END:VCALENDAR' | from ics
╭───┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬───────────╮
│ # │ properties │ events │ alarms │ to-Dos │ journals │ free-busys │ timezones │
├───┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼───────────┤
│ 0 │ [list 0 items] │ [list 0 items] │ [list 0 items] │ [list 0 items] │ [list 0 items] │ [list 0 items] │ [list 0 │
│ │ │ │ │ │ │ │ items] │
╰───┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴───────────╯
```
8 changes: 4 additions & 4 deletions commands/docs/from_ini.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: from ini
categories: |
formats
version: 0.91.0
version: 0.92.0
formats: |
Parse text as .ini and create table.
usage: |
Expand All @@ -11,14 +11,14 @@ feature: default
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# <code>{{ $frontmatter.title }}</code> for formats

<div class='command-title'>{{ $frontmatter.formats }}</div>
# `from ini` for [formats](/commands/categories/formats.md)

<div class='command-title'>Parse text as .ini and create table.</div>

::: warning
Command `from ini` resides in [plugin](/book/plugins.html) [`nu_plugin_formats`](https://crates.io/crates/nu_plugin_formats). To use this command, you must install/compile and register nu_plugin_formats
:::

## Signature

```> from ini {flags} ```
Expand Down
8 changes: 4 additions & 4 deletions commands/docs/from_vcf.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: from vcf
categories: |
formats
version: 0.91.0
version: 0.92.0
formats: |
Parse text as .vcf and create table.
usage: |
Expand All @@ -11,14 +11,14 @@ feature: default
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# <code>{{ $frontmatter.title }}</code> for formats

<div class='command-title'>{{ $frontmatter.formats }}</div>
# `from vcf` for [formats](/commands/categories/formats.md)

<div class='command-title'>Parse text as .vcf and create table.</div>

::: warning
Command `from vcf` resides in [plugin](/book/plugins.html) [`nu_plugin_formats`](https://crates.io/crates/nu_plugin_formats). To use this command, you must install/compile and register nu_plugin_formats
:::

## Signature

```> from vcf {flags} ```
Expand Down
6 changes: 3 additions & 3 deletions commands/docs/gstat.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: gstat
categories: |
prompt
version: 0.91.0
version: 0.92.0
prompt: |
Get the git status of a repo
usage: |
Expand All @@ -11,9 +11,9 @@ feature: default
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# <code>{{ $frontmatter.title }}</code> for prompt
# `gstat` for [prompt](/commands/categories/prompt.md)

<div class='command-title'>{{ $frontmatter.prompt }}</div>
<div class='command-title'>Get the git status of a repo</div>

## Signature

Expand Down
12 changes: 6 additions & 6 deletions commands/docs/histogram.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ Compute a histogram for the types of files, with frequency column named freq
Compute a histogram for a list of numbers
```nu
> [1 2 1] | histogram
╭───┬───────┬───────┬──────────────────────┬────────────────────────────────────────────────────────────────────╮
│ # │ value │ count │ quantile │ percentage │ frequency │
├───┼───────┼───────┼──────────────────────┼────────────────────────────────────────────────────────────────────┤
│ 0 │ 1 │ 2 │ 0.67 │ 66.67% │ ****************************************************************** │
│ 1 │ 2 │ 1 │ 0.33 │ 33.33% │ ********************************* │
╰───┴───────┴───────┴──────────────────────┴────────────────────────────────────────────────────────────────────╯
╭───┬───────┬───────┬───────────┬─────────────┬────────────────────────────────────────────────────────────────────╮
# │ value │ count │ quantile │ percentage │ frequency │
├───┼───────┼───────┼───────────┼─────────────┼────────────────────────────────────────────────────────────────────┤
0 │ 1 │ 2 │ 0.67 │ 66.67% │ ****************************************************************** │
1 │ 2 │ 1 │ 0.33 │ 33.33% │ ********************************* │
╰───┴───────┴───────┴───────────┴─────────────┴────────────────────────────────────────────────────────────────────╯
```

Expand Down
6 changes: 3 additions & 3 deletions commands/docs/inc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: inc
categories: |
default
version: 0.91.0
version: 0.92.0
default: |
Increment a value or version. Optionally use the column of a table.
usage: |
Expand All @@ -11,9 +11,9 @@ feature: default
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# <code>{{ $frontmatter.title }}</code> for default
# `inc` for [default](/commands/categories/default.md)

<div class='command-title'>{{ $frontmatter.default }}</div>
<div class='command-title'>Increment a value or version. Optionally use the column of a table.</div>

## Signature

Expand Down
6 changes: 3 additions & 3 deletions commands/docs/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: query
categories: |
filters
version: 0.91.0
version: 0.92.0
filters: |
Show all the query commands
usage: |
Expand All @@ -11,9 +11,9 @@ feature: default
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# <code>{{ $frontmatter.title }}</code> for filters
# `query` for [filters](/commands/categories/filters.md)

<div class='command-title'>{{ $frontmatter.filters }}</div>
<div class='command-title'>Show all the query commands</div>

## Signature

Expand Down
6 changes: 3 additions & 3 deletions commands/docs/query_json.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: query json
categories: |
filters
version: 0.91.0
version: 0.92.0
filters: |
execute json query on json file (open --raw <file> | query json 'query string')
usage: |
Expand All @@ -11,9 +11,9 @@ feature: default
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# <code>{{ $frontmatter.title }}</code> for filters
# `query json` for [filters](/commands/categories/filters.md)

<div class='command-title'>{{ $frontmatter.filters }}</div>
<div class='command-title'>execute json query on json file (open --raw &lt;file&gt; | query json &#x27;query string&#x27;)</div>

## Signature

Expand Down
8 changes: 4 additions & 4 deletions commands/docs/query_web.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: query web
categories: |
network
version: 0.91.0
version: 0.92.0
network: |
execute selector query on html/web
usage: |
Expand All @@ -11,9 +11,9 @@ feature: default
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# <code>{{ $frontmatter.title }}</code> for network
# `query web` for [network](/commands/categories/network.md)

<div class='command-title'>{{ $frontmatter.network }}</div>
<div class='command-title'>execute selector query on html&#x2f;web</div>

## Signature

Expand Down Expand Up @@ -45,7 +45,7 @@ Retrieve all `<header>` elements from phoronix.com website
Retrieve a html table from Wikipedia and parse it into a nushell table using table headers as guides
```nu
> http get https://en.wikipedia.org/wiki/List_of_cities_in_India_by_population |
query web --as-table [City 'Population(2011)[3]' 'Population(2001)[3][a]' 'State or unionterritory' 'Ref']
query web --as-table [City 'Population(2011)[3]' 'Population(2001)[3][a]' 'State or unionterritory' 'Ref']
```

Expand Down
6 changes: 3 additions & 3 deletions commands/docs/query_xml.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: query xml
categories: |
filters
version: 0.91.0
version: 0.92.0
filters: |
execute xpath query on xml
usage: |
Expand All @@ -11,9 +11,9 @@ feature: default
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# <code>{{ $frontmatter.title }}</code> for filters
# `query xml` for [filters](/commands/categories/filters.md)

<div class='command-title'>{{ $frontmatter.filters }}</div>
<div class='command-title'>execute xpath query on xml</div>

## Signature

Expand Down
13 changes: 7 additions & 6 deletions commands/docs/registry_query.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
title: registry query
categories: |
system
version: 0.91.0
version: 0.92.0
system: |
Query the Windows registry.
usage: |
Query the Windows registry.
feature: default
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# <code>{{ $frontmatter.title }}</code> for system
# `registry query` for [system](/commands/categories/system.md)

<div class='command-title'>{{ $frontmatter.system }}</div>
<div class='command-title'>Query the Windows registry.</div>

## Signature

Expand All @@ -34,8 +35,8 @@ usage: |

## Parameters

- `key`: registry key to query
- `value`: optionally supply a registry value to query
- `key`: Registry key to query.
- `value`: Optionally supply a registry value to query.


## Input/output types:
Expand All @@ -59,4 +60,4 @@ Query the HKEY_LOCAL_MACHINE hive
```

## Notes
Currently supported only on Windows systems.
Currently supported only on Windows systems.
Loading

0 comments on commit a92121f

Please sign in to comment.