convert remaining man1 pages to pandoc

This commit is contained in:
nick black 2020-01-14 16:20:24 -05:00
parent a419e866fe
commit adf808110d
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
6 changed files with 137 additions and 69 deletions

View File

@ -122,32 +122,38 @@ iF(NOT PANDOC)
message(WARNING "pandoc not found, won't generate documentation")
else()
foreach(m ${MANSOURCE3} ${MANSOURCE1})
get_filename_component(me ${m} NAME_WLE)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${me}
DEPENDS ${m}
COMMAND ${PANDOC}
ARGS --to man --standalone ${m} > ${CMAKE_CURRENT_BINARY_DIR}/${me}
COMMENT "Building man page ${me}"
)
add_custom_target(${me}.man
ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${me}
)
file(GLOB ANALHTML doc/analytics-header.html)
set(MANPAGES3 ${MANPAGES3} ${CMAKE_CURRENT_BINARY_DIR}/${me})
set(MANPAGES1 ${MANPAGES1} ${CMAKE_CURRENT_BINARY_DIR}/${me})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${me}.html
DEPENDS ${m} ${ANALHTML}
COMMAND ${PANDOC}
ARGS -H ${ANALHTML} --to html --standalone ${m} > ${CMAKE_CURRENT_BINARY_DIR}/${me}.html
COMMENT "Building HTML5 ${me}.html"
)
add_custom_target(${me}.html5
ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${me}.html
)
get_filename_component(me ${m} NAME_WLE)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${me}
DEPENDS ${m}
COMMAND ${PANDOC}
ARGS --to man --standalone ${m} > ${CMAKE_CURRENT_BINARY_DIR}/${me}
COMMENT "Building man page ${me}"
)
add_custom_target(${me}.man
ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${me}
)
file(GLOB ANALHTML doc/analytics-header.html)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${me}.html
DEPENDS ${m} ${ANALHTML}
COMMAND ${PANDOC}
ARGS -H ${ANALHTML} --to html --standalone ${m} > ${CMAKE_CURRENT_BINARY_DIR}/${me}.html
COMMENT "Building HTML5 ${me}.html"
)
add_custom_target(${me}.html5
ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${me}.html
)
endforeach()
foreach(m ${MANSOURCE3})
get_filename_component(me ${m} NAME_WLE)
set(MANPAGES3 ${MANPAGES3} ${CMAKE_CURRENT_BINARY_DIR}/${me})
endforeach()
foreach(m ${MANSOURCE1})
get_filename_component(me ${m} NAME_WLE)
set(MANPAGES1 ${MANPAGES1} ${CMAKE_CURRENT_BINARY_DIR}/${me})
endforeach()
endif()
@ -294,7 +300,6 @@ install(FILES
DESTINATION ${NOTCURSES_SHARE}
)
file(GLOB MANPAGES1 CONFIGURE_DEPENDS doc/man/man1/*.1)
install(FILES
${MANPAGES1}
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1

View File

@ -1,11 +0,0 @@
.TH notcurses-input 1 "v1.0.2"
.SH NAME
notcurses-input \- Display and decode input
.SH SYNOPSIS
.B notcurses-input
.SH DESCRIPTION
.B notcurses-input
Reads from stdin and decodes the input to stdout, including synthesized events
and mouse events.
.SH SEE ALSO
notcurses(3notcurses), terminfo(5)

View File

@ -0,0 +1,24 @@
% notcurses-input(1)
% nick black <nickblack@linux.com>
% v1.0.2
# NAME
notcurses-input - Read and display input events
# SYNOPSIS
**notcurses-input**
# DESCRIPTION
**notcurses-input** reads from stdin and decodes the input to stdout, including
synthesized events and mouse events. To exit, generate EOF (usually Ctrl+'d').
# OPTIONS
# NOTES
# SEE ALSO
notcurses(3notcurses), notcurses_input(3)

View File

@ -1,31 +0,0 @@
.TH notcurses-planereel 1 "v1.0.2"
.SH NAME
notcurses-planereel \- Experiment with panelreels
.SH SYNOPSIS
.B notcurses-planereel
[ \fB\-\-ob \fIbottomoffset \fR]
[ \fB\-\-ot \fItopoffset \fR]
[ \fB\-\-ol \fIleftoffset \fR]
[ \fB\-\-or \fIrightoffset \fR]
[ \fB\-t \fItabletmask \fR]
[ \fB\-b \fIbordermask \fR]
.SH OPTIONS
.TP
.BR \-\-ob \fIbottomoffset\fR
Offset the panelreel some number of rows from the bottom.
.TP
.BR \-\-ot \fItopoffset\fR
Offset the panelreel some number of rows from the top.
.TP
.BR \-\-ol \fIleftoffset\fR
Offset the panelreel some number of columns from the left.
.TP
.BR \-\-or \fIrightoffset\fR
Offset the panelreel some number of columns from the right.
.SH DESCRIPTION
.B notcurses-planereel
A testing and exploration tool for notcurses panelreels. With the program open, press 'a' to create a new panel, or 'd' to delete the focused panel. 'q' quits at any time.
.SH NOTES
Proper display requires a terminal advertising the RGB terminfo(5) capability (necessary for specification of arbitrary 24bpp colors), and a monospaced font with good Unicode support.
.SH SEE ALSO
notcurses(3notcurses), terminfo(5)

View File

@ -0,0 +1,28 @@
% notcurses-planereel(1)
% nick black <nickblack@linux.com>
% v1.0.2
# NAME
notcurses-planereel - Experiment with panelreels
# SYNOPSIS
**notcurses-planereel** [**-t tabletbordermask**] [**-b bordermask**] [**-ob bottomoffset**] [**-ot topoffset**] [**-ol leftoffset**] [**-or rightoffset**]
# DESCRIPTION
**notcurses-planereel** generates a panelreel to experiment with. With the
program open, press 'a' to create a new tablet, or 'd' to delete the focused
tablet (if one exists). 'q' quits at any time.
# OPTIONS
# NOTES
Optimal display requires a terminal advertising the **rgb** terminfo(5)
capability, or that the environment variable **COLORTERM** is defined to
**24bit** (and that the terminal honors this variable), along with a good
monospaced font supporting the Unicode Block Drawing Characters.
# SEE ALSO
notcurses(3notcurses), notcurses_panelreel(3), terminfo(5)

53
src/poc/blocks.cpp Normal file
View File

@ -0,0 +1,53 @@
#include <cstdio>
#include <cstdlib>
#include <clocale>
#include <cassert>
#include <unistd.h>
#include <notcurses.h>
int main(int argc, char** argv){
setlocale(LC_ALL, "");
notcurses_options opts{};
opts.inhibit_alternate_screen = true;
struct notcurses* nc;
if((nc = notcurses_init(&opts, stdout)) == nullptr){
return EXIT_FAILURE;
}
struct ncplane* n = notcurses_stdplane(nc);
int dimx, dimy;
ncplane_dim_yx(n, &dimy, &dimx);
const int HEIGHT = 5;
const int WIDTH = 20;
struct ncplane* na = ncplane_aligned(n, HEIGHT, WIDTH,
dimy - (HEIGHT + 1),
NCALIGN_CENTER,
nullptr);
uint64_t channels = 0;
if(na == nullptr){
goto err;
}
ncplane_set_fg(n, 0x00ff00);
ncplane_set_fg(na, 0x00ff00);
if(ncplane_cursor_move_yx(na, 0, 0)){
goto err;
}
if(ncplane_rounded_box_sized(na, 0, channels, HEIGHT, WIDTH, 0) < 0){
goto err;
}
if(ncplane_printf_yx(n, 0, 0, "arrrrp?") < 0){
goto err;
}
if(ncplane_rounded_box_sized(n, 4, channels, HEIGHT, WIDTH, 0) < 0){
goto err;
}
if(notcurses_render(nc)){
goto err;
}
sleep(1);
return notcurses_stop(nc) ? EXIT_FAILURE : EXIT_SUCCESS;
err:
notcurses_stop(nc);
return EXIT_FAILURE;
}