Re: demandoc(1)

From: Graham Perrin <grahamperrin_at_freebsd.org>
Date: Sun, 06 Aug 2023 12:36:20 UTC
On 06/08/2023 11:12, Yuri wrote:

> … sample usr.bin/demandoc/Makefile attached.

Success, thanks:

% man -P less 1 demandoc
% which demandoc
/usr/bin/demandoc
% file /usr/bin/demandoc
/usr/bin/demandoc: ELF 64-bit LSB pie executable, x86-64, version 1 
(FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for 
FreeBSD 14.0 (1400093), FreeBSD-style, stripped
% demandoc -w /usr/src/share/man/man9/intro.9 | spell -b | less
% demandoc -w /usr/src/share/man/man9/intro.9 | aspell list --encoding 
utf-8 | sort | uniq | less
%


Re: 
<https://docs.freebsd.org/en/books/fdp-primer/book/#manual-pages-testing> 
– where the '--mode=nroff' part of the aspell(1) example will have 
little or no effect in most cases – it will be preferable to have aspell 
present everyday language, without markup.

For as long as there'll be no aspell filter mode for mdoc, demandoc 
might be the best workaround. I can, for example:

demandoc /usr/src/share/man/man9/intro.9 | xclip

– and then use the context menu of the system tray icon for my local 
LanguageTool server. The result, pictured: 
<https://i.imgur.com/aPSu57G.png>.


I spent a few hours searching, can't find a way to make combined use of 
demandoc with the check command of aspell; for aspell to be interactive 
with a markup-free, human-friendly view of an mdoc page (not a word 
list). If anyone has a solution in mind, I'll raise the question in 
Stack Exchange.

<https://man.freebsd.org/cgi/man.cgi?query=aspell&sektion=1&manpath=freebsd-ports>