Open l0b0 opened 7 months ago
It's due to the borked formatting of the manpage itself:
$ gzip -d $(nix-build '<nixpkgs>' -A xdg-user-dirs)/share/man/man1/xdg-user-dir.1.gz -c | bat -r 40:43 -p
This command expects the name of an XDG user dir as argument\&. The possible names are:
.RS 4 DESKTOP .RE .RS 4 DOWNLOAD .RE .RS 4 TEMPLATES .RE .RS 4 PUBLICSHARE .RE .RS 4 DOCUMENTS .RE .RS 4 MUSIC .RE .RS 4 PICTURES .RE .RS 4 VIDEOS .RE
.SH "FILES"
.PP
Each macro should be on its own line, i.e.:
.RS 4
DESKTOP
.RE
.RS 4
DOWNLOAD
.RE
It has nothing to do with any "parser". Arch for example correctly puts each macro on its own line.
$ gzip -d /usr/share/man/man1/xdg-user-dir.1.gz -c | bat -r 40:43 -p
This command expects the name of an XDG user dir as argument\&. The possible names are:
.RS 4
DESKTOP
Something's borked on the DocBook XSLT side of things.
Though the stylesheet has the newlines, same as Arch:
$ bat $(nix-build '<nixpkgs>' -A docbook_xsl)/xml/xsl/docbook/manpages/lists.xsl -r 344:356 -p
<xsl:template match="simplelist">
<xsl:for-each select="member">
<xsl:text>.RS</xsl:text>
<xsl:if test="not($list-indent = '')">
<xsl:text> </xsl:text>
<xsl:value-of select="$list-indent"/>
</xsl:if>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
<xsl:text> </xsl:text>
<xsl:text>.RE </xsl:text>
</xsl:for-each>
</xsl:template>
so I gave up figuring out what's going on.
The man page for xdg-mime
is completely borked:
XDG-MIME(1) xdg-mime Manual XDG-MIME(1)
.SH "NAME" xdg-mime - command line tool for querying information about file type handling and adding descriptions for new file types
.SH "SYNOPSIS"
.HP 216u
xdg-mime
query
{ | filetype FILE | default mimetype
}
.HP 216u
xdg-mime
default
application
mimetype(s)
.HP 216u
xdg-mime
install
[--mode mode]
[--novendor]
mimetypes-file
.HP 216u
xdg-mime
uninstall
[--mode mode]
I compared the version in NixOS with a version on Nobara (Fedora-based distro) and for some reason the NixOS version has some kind of indentation applied which I guess makes the source file not valid (not familiar with source format). It's also curious that the build dates are not set in the NixOS version.
--- (nix-build '<nixpkgs>' -A xdg-utils)/share/man/man1/xdg-mime.1.gz 2024-08-02 21:34:19.537426668 +0200
+++ /mnt/nobara-root/usr/share/man/man1/xdg-mime.1.gz 2024-08-02 21:34:19.540081461 +0200
@@ -1,13 +1,13 @@
'\" t
.\" Title: xdg-mime
.\" Author: Kevin Krammer
-.\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
-.\" Date: 01/01/1980
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 02/11/2024
.\" Manual: xdg-mime Manual
.\" Source: xdg-utils 1.0
.\" Language: English
.\"
-.TH "XDG\-MIME" "1" "01/01/1980" "xdg-utils 1.0" "xdg-mime Manual"
+.TH "XDG\-MIME" "1" "02/11/2024" "xdg-utils 1.0" "xdg-mime Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -27,95 +27,35 @@
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-
-
-
-
-
- .SH "NAME"
+.SH "NAME"
xdg-mime \- command line tool for querying information about file type handling and adding descriptions for new file types
-
-
- .SH "SYNOPSIS"
-
- .HP \w'\fBxdg\-mime\fR\ 'u
-
- \fBxdg\-mime\fR
- query
- {
- | filetype\ \fIFILE\fR
- | default\ \fImimetype\fR
- }
-
-
- .HP \w'\fBxdg\-mime\fR\ 'u
-
- \fBxdg\-mime\fR
- default
- \fIapplication\fR
- \fImimetype(s)\fR
-
-
- .HP \w'\fBxdg\-mime\fR\ 'u
-
- \fBxdg\-mime\fR
- install
- [\fB\-\-mode\ \fR\fB\fImode\fR\fR]
- [\fB\-\-novendor\fR]
- \fImimetypes\-file\fR
-
-
- .HP \w'\fBxdg\-mime\fR\ 'u
-
- \fBxdg\-mime\fR
- uninstall
- [\fB\-\-mode\ \fR\fB\fImode\fR\fR]
- \fImimetypes\-file\fR
-
-
- .HP \w'\fBxdg\-mime\fR\ 'u
-
- \fBxdg\-mime\fR
- {
- | \fB\-\-help\fR
- | \fB\-\-manual\fR
- | \fB\-\-version\fR
- }
-
-
-
-
- .SH "DESCRIPTION"
-
-
- .PP
+.SH "SYNOPSIS"
+.HP \w'\fBxdg\-mime\fR\ 'u
+\fBxdg\-mime\fR query {filetype\ \fIFILE\fR | default\ \fImimetype\fR}
+.HP \w'\fBxdg\-mime\fR\ 'u
+\fBxdg\-mime\fR default \fIapplication\fR \fImimetype(s)\fR
+.HP \w'\fBxdg\-mime\fR\ 'u
+\fBxdg\-mime\fR install [\fB\-\-mode\ \fR\fB\fImode\fR\fR] [\fB\-\-novendor\fR] \fImimetypes\-file\fR
+.HP \w'\fBxdg\-mime\fR\ 'u
+\fBxdg\-mime\fR uninstall [\fB\-\-mode\ \fR\fB\fImode\fR\fR] \fImimetypes\-file\fR
+.HP \w'\fBxdg\-mime\fR\ 'u
+\fBxdg\-mime\fR {\fB\-\-help\fR | \fB\-\-manual\fR | \fB\-\-version\fR}
+.SH "DESCRIPTION"
+.PP
The xdg\-mime program can be used to query information about file types and to add descriptions for new file types\&.
-
-
- .SH "COMMANDS"
-
-
-
-
- .PP
+.SH "COMMANDS"
+.PP
query file
.RS 4
-
-
-
- Returns the file type of
+Returns the file type of
\fIFILE\fR
in the form of a MIME type\&.
.sp
-
- Please note that
+Please note that
\fIFILE\fR
names starting with a
\-
will be rejected, this can be mitigated:
-
-
-
.sp
.RS 4
.ie n \{\
@@ -129,7 +69,6 @@
\fBrealpath\fR
as a preprocessor\&.
.RE
-
.sp
.RS 4
.ie n \{\
@@ -144,81 +83,55 @@
sed \-E \*(Aqs|^[^/]|\&./\e0|\*(Aq
as a preprocessor\&.
.RE
- .sp
-
- The
+.sp
+The
\fIquery file\fR
option is for use inside a desktop session only\&. It is not recommended to use xdg\-mime query file as root\&.
-
-
- .RE
-
- .PP
+.RE
+.PP
query default
.RS 4
<snip>
Issue description
This is the entire man page as shown on nixos-unstable:
After "The possible names are:" the list of names as shown for example here is missing.
Steps to reproduce
man xdg-user-dir
Technical details
"x86_64-linux"
Linux 6.6.22, NixOS, 24.05 (Uakari), 24.05pre601756.44d0940ea560
yes
yes
nix-env (Nix) 2.18.1
"nixos"
""
/nix/var/nix/profiles/per-user/root/channels/nixos