From 97d4c97c52ac7b7763acca426b1ec2fc15f5efee Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Thu, 21 Aug 2014 04:29:15 -0400 Subject: [PATCH] Generate man pages from asciidoc Working directly with g/roff is a pain. Also changed the formatting of toxic.conf.5 a bit. Signed-off-by: Loui Chang --- build/Makefile | 15 +++- cfg/targets/help.mk | 1 + cfg/targets/install.mk | 11 ++- doc/toxic.1.asc | 91 +++++++++++++++++++++ doc/toxic.conf.5.asc | 179 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 290 insertions(+), 7 deletions(-) create mode 100644 doc/toxic.1.asc create mode 100644 doc/toxic.conf.5.asc diff --git a/build/Makefile b/build/Makefile index 4c85d7d..93c5fd1 100644 --- a/build/Makefile +++ b/build/Makefile @@ -4,12 +4,15 @@ VERSION = $(TOXIC_VERSION)_r$(REV) BASE_DIR = $(shell cd .. && pwd -P) CFG_DIR = $(BASE_DIR)/cfg +DOC_DIR = $(BASE_DIR)/doc SRC_DIR = $(BASE_DIR)/src PREFIX = /usr/local BINDIR = $(PREFIX)/bin DATADIR = $(PREFIX)/share/toxic MANDIR = $(PREFIX)/share/man +MANFILES = toxic.1 toxic.conf.5 + LIBS = libtoxcore ncursesw libconfig CFLAGS = -std=gnu99 -pthread -Wall -g @@ -53,7 +56,7 @@ endif -include $(CFG_DIR)/checks/check_features.mk # Targets -all: toxic +all: toxic doc toxic: $(OBJ) @echo " LD $@" @@ -64,8 +67,18 @@ toxic: $(OBJ) @$(CC) $(CFLAGS) -o $*.o -c $(SRC_DIR)/$*.c @$(CC) -MM $(CFLAGS) $(SRC_DIR)/$*.c > $*.d +doc: $(MANFILES) + +%: $(DOC_DIR)/%.asc + @echo " Generating man page $@" + @a2x -f manpage -a revdate=$(shell git log -1 --date=short --format="%ad" $<) \ + -a manmanual="toxic manual" -a mansource=toxic \ + -a manversion=$(VERSION) -a datadir=$(DATADIR) $< + @mv $(DOC_DIR)/$@ . + clean: rm -rf *.d *.o toxic + rm -rf $(MANFILES) -include $(OBJ:.o=.d) diff --git a/cfg/targets/help.mk b/cfg/targets/help.mk index 6848df0..0eba1b9 100644 --- a/cfg/targets/help.mk +++ b/cfg/targets/help.mk @@ -3,6 +3,7 @@ help: @echo "-- Targets --" @echo " all: Build toxic [DEFAULT]" @echo " toxic: Build toxic" + @echo " doc: Build documentation" @echo " install: Build toxic and install it in PREFIX (default PREFIX is \"$(abspath $(PREFIX))\")" @echo " clean: Remove built files" @echo " help: This help" diff --git a/cfg/targets/install.mk b/cfg/targets/install.mk index 2e12dcd..0d7b781 100644 --- a/cfg/targets/install.mk +++ b/cfg/targets/install.mk @@ -1,19 +1,19 @@ MISC_DIR = $(BASE_DIR)/misc -DOC_DIR = $(BASE_DIR)/doc SND_DIR = $(BASE_DIR)/sounds DATAFILES = DHTnodes DNSservers toxic.conf.example -MANFILES = toxic.1 toxic.conf.5 SNDFILES = ContactLogsIn.wav ContactLogsOut.wav Error.wav IncomingCall.wav SNDFILES += LogIn.wav LogOut.wav NewMessage.wav OutgoingCall.wav SNDFILES += TransferComplete.wav TransferPending.wav -install: toxic +install: toxic doc mkdir -p $(abspath $(DESTDIR)/$(BINDIR)) mkdir -p $(abspath $(DESTDIR)/$(DATADIR)) mkdir -p $(abspath $(DESTDIR)/$(DATADIR))/sounds mkdir -p $(abspath $(DESTDIR)/$(MANDIR)) + @echo "Installing toxic executable" @install -m 0755 toxic $(abspath $(DESTDIR)/$(BINDIR)) + @echo "Installing data files" @for f in $(DATAFILES) ; do \ install -m 0644 $(MISC_DIR)/$$f $(abspath $(DESTDIR)/$(DATADIR)) ;\ @@ -23,14 +23,13 @@ install: toxic @for f in $(SNDFILES) ; do \ install -m 0644 $(SND_DIR)/$$f $(abspath $(DESTDIR)/$(DATADIR))/sounds ;\ done + @echo "Installing man pages" @for f in $(MANFILES) ; do \ section=$(abspath $(DESTDIR)/$(MANDIR))/man`echo $$f | rev | cut -d "." -f 1` ;\ file=$$section/$$f ;\ mkdir -p $$section ;\ - install -m 0644 $(DOC_DIR)/$$f $$file ;\ - sed -i'' -e 's:__VERSION__:'$(VERSION)':g' $$file ;\ - sed -i'' -e 's:__DATADIR__:'$(abspath $(DATADIR))':g' $$file ;\ + install -m 0644 $$f $$file ;\ gzip -f -9 $$file ;\ done diff --git a/doc/toxic.1.asc b/doc/toxic.1.asc new file mode 100644 index 0000000..167874c --- /dev/null +++ b/doc/toxic.1.asc @@ -0,0 +1,91 @@ +toxic(1) +======== + +NAME +---- +toxic - CLI client for Tox + +SYNOPSIS +-------- +*toxic* [-f 'data-file'] [-x] [-4] [-c 'config-file'] [-n 'nodes-file'] [-h] + +DESCRIPTION +----------- +toxic is an ncurses-based instant messaging client for Tox which formerly +resided in the Tox core repository, and is now available as a standalone +application. + +OPTIONS +------- +-4, --ipv4:: + Force IPv4 connection + +-b, --debug:: + Enable stderr for debugging. Redirect output to + avoid breaking the curses interface and better capture messages. + +-c, --config config-file:: + Use specified 'config-file' instead of '~/.config/tox/toxic.conf' + +-d, --default_locale:: + Use default locale + +-f, --file data-file:: + Use specified 'data-file' instead of '~/.config/tox/data' + +-h, --help:: + Show help message + +-n, --nodes nodes-file:: + Use specified 'nodes-file' for DHT bootstrap nodes, instead of + '{datadir}/DHTnodes' + +-o, --noconnect:: + Do not connect to the DHT network + +-p, --proxy:: + Use proxy: Requires [IP] [port] + +-r, --dnslist:: + Use specified DNSservers file + +-t, --force-tcp:: + Force TCP connection (use this with proxies) + +-x, --nodata:: + Ignore data file + +FILES +----- +{datadir}/DHTnodes:: + Default list of DHT bootstrap nodes. + +~/.config/tox/data:: + Savestate which contains your personal info (nickname, Tox ID, contacts, + etc) + +~/.config/tox/toxic.conf:: + Configuration file. See *toxic.conf*(5) for more details. + +{datadir}/toxic.conf.example:: + Configuration example. + +BUGS +---- +Unicode characters with a width larger than 1 column may cause strange +behaviour. Expect more bugs and bad behaviour: this software is in a +pre-alpha stage. + +AUTHORS +------- +JFreegman + +SEE ALSO +-------- +*toxic.conf*(5) + +LINKS +----- +Project page: + +IRC channel: chat.freenode.net#tox diff --git a/doc/toxic.conf.5.asc b/doc/toxic.conf.5.asc new file mode 100644 index 0000000..6c6e021 --- /dev/null +++ b/doc/toxic.conf.5.asc @@ -0,0 +1,179 @@ +toxic.conf(5) +============= + +NAME +---- +toxic.conf - Configuration file for toxic + + +SYNOPSIS +-------- +~/.config/tox/toxic.conf + + +DESCRIPTION +----------- +The 'toxic.conf' file is the main configuration file for *toxic*(1) client. +It uses syntax accepted by *libconfig*. +Lines starting with "//" are comments and will be ignored. + + +EXAMPLE +------- +---- +// Configuration for interface +ui = { + timestamps = true; + alerts = false; +}; + +// Configuration for audio +audio = { + input_device = 1; +}; +---- + + +OPTIONS +------- +*ui*:: + Configuration related to interface elements. + + *timestamps*;; + Enable or disable timestamps. true or false + + *alerts*;; + Enable or disable terminal alerts on events. true or false + + *native_colors*;; + Select between native terminal colors and toxic color theme. true or false + + *autolog*;; + Enable or disable autologging. true or false + + *time_format*;; + Select between 24 and 12 hour time. Specify 24 or 12 + + *show_typing_other*;; + Show when others are typing in a 1-on-1 chat. true or false + + *show_typing_self*;; + Show others when you're typing in a 1-on-1 chat. true or false + + *history_size*;; + Maximum lines for chat window history. Integer value. (for example: 700) + + +*audio*:: + Configuration related to audio devices. + + *input_device*;; + Audio input device. Integer value. Number corresponds to `/lsdev in` + + *output_device*;; + Audio output device. Integer value. Number corresponds to `/lsdev out` + + *VAD_treshold*;; + Voice Activity Detection treshold. Float value. Recommended values are + around 40.0 + +*tox*:: + Configuration related to file transfer. + + *download_path*;; + Default path for downloads. String value. Absolute path where to store + downloaded files + +*sounds*:: + Configuration related to notification sounds. + Special value "silent" can be used to disable a specific notification. + + Each value is a string which corresponds to the absolute path of a wav + sound file. + + *error*;; + Sound to play when an error occurs. + + *self_log_in*;; + Sound to play when you log in. + + *self_log_out*;; + Sound to play when you log out. + + *user_log_in*;; + Sound to play when a contact become online. + + *user_log_out*;; + Sound to play when a contact become offline. + + *call_incoming*;; + Sound to play when you receive an incoming call. + + *call_outgoing*;; + Sound to play when you start a call. + + *generic_message*;; + Sound to play when an event occurs. + + *transfer_pending*;; + Sound to play when you receive a file transfer request. + + *transfer_completed*;; + Sound to play when a file transfer is completed. + +*keys*:: + Configuration related to user interface interaction. + Currently supported: Ctrl modified keys, Tab, PAGEUP and PAGEDOWN. + + Each value is a string which corresponds to a key combination. + + *next_tab*;; + Key combination to switch next tab. + + *prev_tab*;; + Key combination to switch previous tab. + + *scroll_line_up*;; + Key combination to scroll one line up. + + *scroll_line_down*;; + Key combination to scroll one line down. + + *half_page_up*;; + Key combination to scroll half page up. + + *half_page_down*;; + Key combination to scroll half page down. + + *page_bottom*;; + Key combination to scroll to page bottom. + + *peer_list_up*;; + Key combination to scroll contacts list up. + + *peer_list_down*;; + Key combination to scroll contacts list down. + + +FILES +----- +~/.config/tox/toxic.conf:: + Main configuration file. + +{datadir}/toxic.conf.example:: + Configuration example. + + +SEE ALSO +-------- +*toxic*(1) + + +RESOURCES +--------- +Project page: + +IRC channel: chat.freenode.net#tox + + +AUTHORS +------- +JFreegman