Skip to content

Commit

Permalink
[Doc] Switch to pandoc and remove generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
lbonn committed Mar 2, 2024
1 parent 8061e4e commit 8e10ce1
Show file tree
Hide file tree
Showing 20 changed files with 37 additions and 5,946 deletions.
18 changes: 9 additions & 9 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,15 @@ EXTRA_DIST+=\
# Indent
##

update-manpage: $(top_srcdir)/doc/rofi-theme-selector.1.markdown $(top_srcdir)/doc/rofi.1.markdown $(top_srcdir)/doc/rofi-theme.5.markdown $(top_srcdir)/doc/rofi-script.5.markdown ${top_srcdir}/doc/rofi-sensible-terminal.1.markdown ${top_srcdir}/doc/rofi-keys.5.markdown ${top_srcdir}/doc/rofi-dmenu.5.markdown $(top_srcdir)/doc/rofi-debugging.5.markdown
go-md2man -in $(top_srcdir)/doc/rofi.1.markdown -out $(top_srcdir)/doc/rofi.1
go-md2man -in $(top_srcdir)/doc/rofi-theme-selector.1.markdown -out $(top_srcdir)/doc/rofi-theme-selector.1
go-md2man -in $(top_srcdir)/doc/rofi-theme.5.markdown -out $(top_srcdir)/doc/rofi-theme.5
go-md2man -in $(top_srcdir)/doc/rofi-debugging.5.markdown -out $(top_srcdir)/doc/rofi-debugging.5
go-md2man -in $(top_srcdir)/doc/rofi-keys.5.markdown -out $(top_srcdir)/doc/rofi-keys.5
go-md2man -in $(top_srcdir)/doc/rofi-script.5.markdown -out $(top_srcdir)/doc/rofi-script.5
go-md2man -in $(top_srcdir)/doc/rofi-dmenu.5.markdown -out $(top_srcdir)/doc/rofi-dmenu.5
go-md2man -in $(top_srcdir)/doc/rofi-sensible-terminal.1.markdown -out $(top_srcdir)/doc/rofi-sensible-terminal.1
generate-manpage: $(top_srcdir)/doc/rofi-theme-selector.1.markdown $(top_srcdir)/doc/rofi.1.markdown $(top_srcdir)/doc/rofi-theme.5.markdown $(top_srcdir)/doc/rofi-script.5.markdown ${top_srcdir}/doc/rofi-sensible-terminal.1.markdown ${top_srcdir}/doc/rofi-keys.5.markdown ${top_srcdir}/doc/rofi-dmenu.5.markdown $(top_srcdir)/doc/rofi-debugging.5.markdown
pandoc --standalone --to=man -f markdown-tedxt_math_dollars $(top_srcdir)/doc/rofi.1.markdown -o $(top_srcdir)/doc/rofi.1
pandoc --standalone --to=man -f markdown-tedxt_math_dollars $(top_srcdir)/doc/rofi-theme-selector.1.markdown -o $(top_srcdir)/doc/rofi-theme-selector.1
pandoc --standalone --to=man -f markdown-tedxt_math_dollars $(top_srcdir)/doc/rofi-theme.5.markdown -o $(top_srcdir)/doc/rofi-theme.5
pandoc --standalone --to=man -f markdown-tedxt_math_dollars $(top_srcdir)/doc/rofi-debugging.5.markdown -o $(top_srcdir)/doc/rofi-debugging.5
pandoc --standalone --to=man -f markdown-tedxt_math_dollars $(top_srcdir)/doc/rofi-keys.5.markdown -o $(top_srcdir)/doc/rofi-keys.5
pandoc --standalone --to=man -f markdown-tedxt_math_dollars $(top_srcdir)/doc/rofi-script.5.markdown -o $(top_srcdir)/doc/rofi-script.5
pandoc --standalone --to=man -f markdown-tedxt_math_dollars $(top_srcdir)/doc/rofi-dmenu.5.markdown -o $(top_srcdir)/doc/rofi-dmenu.5
pandoc --standalone --to=man -f markdown-tedxt_math_dollars $(top_srcdir)/doc/rofi-sensible-terminal.1.markdown -o $(top_srcdir)/doc/rofi-sensible-terminal.1

##
# Rofi test program
Expand Down
4 changes: 2 additions & 2 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Manpages are build using [go-md2man](https://github.com/cpuguy83/go-md2man)
Manpages are build using [pandoc](https://pandoc.org/)

Manpages can be updated using the following make command:

```
make update-manpage
make generate-manpage
```
28 changes: 17 additions & 11 deletions doc/meson.build
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
gomd2man = find_program('go-md2man', required: false)
if gomd2man.found()
pandoc = find_program('pandoc', required: false)
if pandoc.found()
man_targets = []
foreach f: [
'rofi.1',
'rofi-theme-selector.1',
'rofi-theme.5',
'rofi-dmenu.5',
'rofi-sensible-terminal.1',
'rofi-debugging.5',
'rofi-dmenu.5',
'rofi-keys.5',
'rofi-script.5',
'rofi-sensible-terminal.1'
'rofi-theme-selector.1',
'rofi-theme.5',
]
section_number = f.split('.')[1]
install_dest = join_paths(get_option('prefix'), get_option('mandir'), 'man' + section_number)

man_targets += custom_target(f,
input: '.'.join([f, 'markdown']),
output: f,
command: [ 'go-md2man',
'-in', files('.'.join([f,'markdown'])),
'-out', files(f)
])
command: [ 'pandoc', '--standalone', '--to=man',
'-f', 'markdown-tex_math_dollars',
'@INPUT@', '-o', '@OUTPUT@' ],
install: true,
install_dir: install_dest,
build_by_default: true,
)
endforeach
run_target('update-manpage', command: ['true'], depends: man_targets)
run_target('generate-manpage', command: ['true'], depends: man_targets)
endif

doxy_conf = configuration_data()
Expand Down
256 changes: 0 additions & 256 deletions doc/rofi-debugging.5

This file was deleted.

4 changes: 2 additions & 2 deletions doc/rofi-debugging.5.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ROFI DEBUGGING 5 rofi debugging
% rofi-debugging(5) rofi | File Formats Manual

## NAME

Expand Down Expand Up @@ -169,7 +169,7 @@ backtrace via `coredumpctl`.

## SEE ALSO

rofi-sensible-terminal(1), dmenu(1), rofi-debugging(5), rofi-theme(5),
rofi-sensible-terminal(1), dmenu(1), rofi-theme(5),
rofi-script(5), rofi-keys(5),rofi-theme-selector(1)

## AUTHOR
Expand Down
Loading

0 comments on commit 8e10ce1

Please sign in to comment.