aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-08-24 05:22:49 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-08-24 05:23:34 +0200
commit9fb90607ad6888b23b3ec578620a9d5b9cbb6221 (patch)
treef09c670432ae70f43b5aa291ba72a907f00b135e
parentdd09af34b791def2ef370232922d968f5176d1e1 (diff)
downloadfiv-9fb90607ad6888b23b3ec578620a9d5b9cbb6221.tar.gz
fiv-9fb90607ad6888b23b3ec578620a9d5b9cbb6221.tar.xz
fiv-9fb90607ad6888b23b3ec578620a9d5b9cbb6221.zip
Add a traditional manual page for fiv
-rw-r--r--README.adoc2
-rw-r--r--docs/fiv.adoc74
-rw-r--r--meson.build31
3 files changed, 103 insertions, 4 deletions
diff --git a/README.adoc b/README.adoc
index 40fc97c..218ba82 100644
--- a/README.adoc
+++ b/README.adoc
@@ -38,7 +38,7 @@ a package with the latest development version from Archlinux's AUR.
Building and Running
--------------------
-Build dependencies: Meson, pkg-config +
+Build-only dependencies: Meson, pkg-config, asciidoctor or asciidoc +
Runtime dependencies: gtk+-3.0, glib>=2.64, pixman-1, shared-mime-info,
libturbojpeg, libwebp +
Optional dependencies: lcms2, LibRaw, librsvg-2.0, xcursor, libheif, libtiff,
diff --git a/docs/fiv.adoc b/docs/fiv.adoc
new file mode 100644
index 0000000..f7f992e
--- /dev/null
+++ b/docs/fiv.adoc
@@ -0,0 +1,74 @@
+fiv(1)
+======
+:doctype: manpage
+:manmanual: fiv Manual
+:mansource: fiv {release-version}
+
+Name
+----
+fiv - Image browser and viewer
+
+Synopsis
+--------
+*fiv* [_OPTION_]... [_PATH_ | _URI_]...
+
+Description
+-----------
+*fiv* is a general-purpose image browser and viewer: pass it a directory path
+or URI to open it for browsing, or pass an image to open it for viewing.
+In case that multiple arguments are passed, they'll be opened as a virtual
+directory containing all of them.
+
+For more information concerning usage, press *F1* in the application to open
+the _User Guide_.
+
+// TODO(p): Try to merge the two, though this one focuses on command line usage.
+
+Options
+-------
+*--invalidate-cache*::
+ Invalidate the wide thumbnail cache, removing thumbnails for files that can
+ no longer be found.
+
+*--list-supported-media-types*::
+ Output supported media types and exit. This is used by a script to update
+ the list of MIME types within *fiv*'s desktop file when the list
+ of GdkPixbuf loaders changes.
+
+*--browse*::
+ When an image is passed, start in browsing mode, and preselect that
+ image in its containing directory. This is used by *fiv*'s inode/directory
+ handler to implement the "Open Containing Folder" feature of certain
+ applications.
+
+*--thumbnail*=_SIZE_::
+ Generate thumbnails for the first argument, in all sizes not exceeding
+ _SIZE_, and present the largest of them on the standard output
+ in an application-specific bitmap format. Available sizes follow directory
+ names in the _Thumbnail Managing Standard_.
+
+*--extract-thumbnail*::
+ Present any embedded thumbnail of the first argument on the standard output
+ in an application-specific bitmap format. When both *--thumbnail*
+ and *--extract-thumbnail* are passed, this option takes precedence,
+ exiting early if successful. This is used to enhance responsivity
+ of thumbnail procurement.
+
+*-V*, *--version*::
+ Output version information and exit.
+
+*--help-all*::
+ Show the full list of options, including those provided by GTK+.
+
+Reporting bugs
+--------------
+Use https://git.janouch.name/p/fiv to report bugs, request features,
+or submit pull requests.
+
+See also
+--------
+_Desktop Entry Specification_,
+https://specifications.freedesktop.org/desktop-entry-spec/latest/[].
+
+_Thumbnail Managing Standard_,
+https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html[].
diff --git a/meson.build b/meson.build
index 4591a67..6f6d156 100644
--- a/meson.build
+++ b/meson.build
@@ -16,6 +16,8 @@ add_project_arguments(
# add_project_link_arguments(flags, language : ['c'])
#endif
+win32 = host_machine.system() == 'windows'
+
# The likelihood of this being installed is nearly zero. Enable the wrap.
libjpegqs = dependency('libjpegqs', required : get_option('libjpegqs'),
allow_fallback : true)
@@ -77,7 +79,7 @@ conf.set_quoted('PROJECT_NAME', meson.project_name())
conf.set_quoted('PROJECT_VERSION', '@VCS_TAG@')
conf.set_quoted('PROJECT_NS', application_ns)
conf.set_quoted('PROJECT_DOCDIR', get_option('prefix') / docdir)
-if host_machine.system() == 'windows'
+if win32
conf.set_quoted('PROJECT_DOCDIR', docdir)
endif
@@ -98,7 +100,7 @@ config = vcs_tag(
)
rc = []
-if host_machine.system() == 'windows'
+if win32
windows = import('windows')
rsvg_convert = find_program('rsvg-convert')
icotool = find_program('icotool')
@@ -211,7 +213,30 @@ install_data('fiv.svg',
install_subdir('docs',
install_dir : docdir, strip_directory : true)
-if host_machine.system() != 'windows'
+if not win32
+ asciidoctor = find_program('asciidoctor', required : false)
+ a2x = find_program('a2x', required : false)
+ if not asciidoctor.found() and not a2x.found()
+ error('Neither asciidoctor nor a2x were found')
+ endif
+ foreach page : [meson.project_name()]
+ if asciidoctor.found()
+ command = [asciidoctor, '-b', 'manpage',
+ '-a', 'release-version=' + meson.project_version(),
+ '-o', '@OUTPUT@', '@INPUT@']
+ elif a2x.found()
+ command = [a2x, '--doctype', 'manpage', '--format', 'manpage',
+ '-a', 'release-version=' + meson.project_version(),
+ '-D', '@OUTDIR@', '@INPUT@']
+ endif
+ custom_target('manpage for ' + page,
+ input : 'docs' / page + '.adoc',
+ output : page + '.1',
+ command : command,
+ install : true,
+ install_dir : get_option('mandir') / 'man1')
+ endforeach
+
foreach desktop : desktops
install_data(desktop,
rename : application_ns + desktop,