document how to include= a path with a space in it

POSIX character classes allowed in globs was a surprise, but just
happened to fall out of the implementation in a way that seems
to behave correctly.

mdwn2man has to be tweaked to render the example properly.
The line I modified is the one that strips ikiwiki wikilinks out of the
man page.

Sponsored-by: Graham Spencer on Patreon
This commit is contained in:
Joey Hess 2023-05-15 16:00:30 -04:00
parent 0da0e2efcc
commit 96c372ac85
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 30 additions and 1 deletions

View file

@ -7,7 +7,7 @@ my $section=shift;
print ".TH $prog $section\n"; print ".TH $prog $section\n";
while (<>) { while (<>) {
s{(\\?)\[\[([^\s\|\]]+)(\|[^\s\]]+)?\]\]}{$1 ? "[[$2]]" : $2}eg; s{(\\?)\[\[([^:\s\|\]]+)(\|[^\s\]]+)?\]\]}{$1 ? "[[$2]]" : $2}eg;
s/\`([^\`]*)\`/\\fB$1\\fP/g; s/\`([^\`]*)\`/\\fB$1\\fP/g;
s/\`//g; s/\`//g;
s/^ *\./\\&./g; s/^ *\./\\&./g;

View file

@ -29,3 +29,5 @@ upgrade supported from repository versions: 0 1 2 4
The only workaround I found is to use a glob for the filepath which only works for the first space: *include='pictures/dir\*'*. The only workaround I found is to use a glob for the filepath which only works for the first space: *include='pictures/dir\*'*.
[[!tag confirmed]] [[!tag confirmed]]
> [[fixed|done]] by documenting the `[[:space:]]` workaround. --[[Joey]]

View file

@ -0,0 +1,13 @@
[[!comment format=mdwn
username="joey"
subject="""comment 4"""
date="2023-05-15T19:40:59Z"
content="""
Thanks @aurtzy, that is a great observation! And a feature I was not
actually aware of.
So, I think that documenting this should be sufficient.
(The `glob(7)` man page does document POSIX character classes as working in
globs, so this is a fairly standard thing.)
"""]]

View file

@ -40,6 +40,13 @@ elsewhere to allow removing it).
files relative to the current directory, preferred content expressions files relative to the current directory, preferred content expressions
match files relative to the top of the git repository. match files relative to the top of the git repository.
A glob is something like `foo.*` or `b?r`.
Globs can also contain character classes,
like `foo[Bb]ar`, as well as additional POSIX character classes like
`[[:space:]]`. Which is useful, since a glob in a preferred content
expression cannot contain spaces. See the `glob(7)` man page for more
about globs.
For example, suppose you put files into `archive` directories For example, suppose you put files into `archive` directories
when you're done with them. Then you could configure your laptop to prefer when you're done with them. Then you could configure your laptop to prefer
to not retain those files, like this: `exclude=*/archive/*` to not retain those files, like this: `exclude=*/archive/*`
@ -130,6 +137,13 @@ elsewhere to allow removing it).
matches the glob. The values of metadata fields are matched case matches the glob. The values of metadata fields are matched case
insensitively. insensitively.
A glob is something like `foo.*` or `b?r`.
Globs can also contain character classes,
like `foo[Bb]ar`, as well as additional POSIX character classes like
`[[:space:]]`. Which is useful, since a glob in a preferred content
expression cannot contain spaces. See the `glob(7)` man page for more
about globs.
To match a tag "done", use `metadata=tag=done` To match a tag "done", use `metadata=tag=done`
To match author metadata, use `metadata=author=*Smith` To match author metadata, use `metadata=author=*Smith`