Skip to content

Commit

Permalink
🐛 Don't use angle brackets in replicate's long description
Browse files Browse the repository at this point in the history
it breaks markdown and manpage outputs
  • Loading branch information
ewen-lbh committed Apr 22, 2024
1 parent e3d5ca3 commit 139e93a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 18 deletions.
6 changes: 3 additions & 3 deletions cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ func init() {
var buildCmd = &cobra.Command{
Use: "build <to-filepath> [include-works]",
Short: "Build the database",
Long: heredoc.Doc(`Scan in the projects directory for folders with description.md files (and potential media files) and compile the whole database into a JSON file at <to-filepath>.
Long: heredoc.Doc(`Scan in the projects directory for folders with description.md files (and potential media files) and compile the whole database into a JSON file at to-filepath.
If <to-filepath> is "-", the output will be written to stdout.
If to-filepath is "-", the output will be written to stdout.
If [include-works] is provided, only works that match the pattern will be included in the database.
If include-works is provided, only works that match the pattern will be included in the database.
`),
Args: cobra.RangeArgs(1, 2),
Run: func(cmd *cobra.Command, args []string) {
Expand Down
7 changes: 3 additions & 4 deletions cmd/replicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ var force bool
var replicateCmd = &cobra.Command{
Use: "replicate <from-filepath> <to-filepath>",
Short: "Replicate a database directory from a built database file.",
Long: heredoc.Doc(`Replicate a database from <from-filepath> to <to-filepath>. Note that <to-filepath> must be an empty directory.
Example: ortfodb replicate ./database.json ./replicated-database/
Long: heredoc.Doc(`Replicate a database from from-filepath to to-filepath. Note that to-filepath must be an empty directory.
WARNING: This command is still kind-of a WIP, it works but there's minimal logging and error handling.
`),
Args: cobra.ExactArgs(2),
Example: "Example: ortfodb replicate ./database.json ./replicated-database/",
Args: cobra.ExactArgs(2),
Run: func(cmd *cobra.Command, args []string) {
database, err := ortfodb.LoadDatabase(args[0], force)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions docs/commands/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Build the database

Scan in the projects directory for folders with description.md files (and potential media files) and compile the whole database into a JSON file at <to-filepath>.

If <to-filepath> is "-", the output will be written to stdout.
If to-filepath is "-", the output will be written to stdout.

If [include-works] is provided, only works that match the pattern will be included in the database.
If include-works is provided, only works that match the pattern will be included in the database.


```
Expand Down
10 changes: 7 additions & 3 deletions docs/commands/replicate.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ Replicate a database directory from a built database file.

## Synopsis

Replicate a database from <from-filepath> to <to-filepath>. Note that <to-filepath> must be an empty directory.

Example: ortfodb replicate ./database.json ./replicated-database/
Replicate a database from from-filepath to to-filepath. Note that to-filepath must be an empty directory.

WARNING: This command is still kind-of a WIP, it works but there's minimal logging and error handling.

Expand All @@ -19,6 +17,12 @@ WARNING: This command is still kind-of a WIP, it works but there's minimal loggi
ortfodb replicate <from-filepath> <to-filepath> [flags]
```

## Examples

```ansi
Example: ortfodb replicate ./database.json ./replicated-database/
```

## Options

| Shorthand | Flag | Argument | Description | Default value |
Expand Down
4 changes: 2 additions & 2 deletions manpages/ortfodb-build.1
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ ortfodb-build - Build the database
Scan in the projects directory for folders with description.md files (and potential media files) and compile the whole database into a JSON file at \&.

.PP
If is "-", the output will be written to stdout.
If to-filepath is "-", the output will be written to stdout.

.PP
If [include-works] is provided, only works that match the pattern will be included in the database.
If include-works is provided, only works that match the pattern will be included in the database.


.SH OPTIONS
Expand Down
12 changes: 8 additions & 4 deletions manpages/ortfodb-replicate.1
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ ortfodb-replicate - Replicate a database directory from a built database file.

.SH DESCRIPTION
.PP
Replicate a database from to \&. Note that must be an empty directory.

.PP
Example: ortfodb replicate ./database.json ./replicated-database/
Replicate a database from from-filepath to to-filepath. Note that to-filepath must be an empty directory.

.PP
WARNING: This command is still kind-of a WIP, it works but there's minimal logging and error handling.
Expand All @@ -42,6 +39,13 @@ WARNING: This command is still kind-of a WIP, it works but there's minimal loggi
Operate in scattered mode. In scattered mode, the description.md files are searched inside `.ortfo' folders in every folder of the database directory, instead of directly in the database directory's folders. See https://github.com/ortfo/


.SH EXAMPLE
.EX
Example: ortfodb replicate ./database.json ./replicated-database/
.EE


.SH SEE ALSO
.PP
\fBortfodb(1)\fP
Expand Down

0 comments on commit 139e93a

Please sign in to comment.