From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mail-a.sr.ht; dkim=pass header.d=johnnyrichard.com header.i=@johnnyrichard.com Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [IPv6:2001:41d0:203:375::b0]) by mail-a.sr.ht (Postfix) with ESMTPS id 0C1082013A for <~johnnyrichard/olang-devel@lists.sr.ht>; Mon, 19 Feb 2024 20:07:06 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1708373225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KgQkVY+aXmuEYbeTEBO5/8ej9sEM4Ss1o1pigm3Zvw0=; b=QejCo74ay/FadOtuWtQnoaakzX1i2nPAEqrKhcBBm7dYdfw8rlONQ3ca/Q6Her8/TNtYWd OrSZyKsjvhSuu06huEAU1AGw5OZuyK+8nENmB8bPus2hSXcALarR42AHBG868h9vvWqVWa OJTGXwzU1xUQKyRnEd1/okmaQzdpbXdM7kcp/8her4vLKBJLc+TmQ3H8PeraXZT6KhBA6D +JoZHSdYgngbPokAcPGW1PRFBLcV49tdM/D2nFjy7Y2ihSWW58PPgVGVWYIoeG560eVZY4 Qb18gNY7BE8ft3YufuAEyQXq/9owY5YIwrisJtX0HjwBuWYKIC5Q6vAYT4JJKg== From: Johnny Richard To: ~johnnyrichard/olang-devel@lists.sr.ht Cc: Johnny Richard Subject: [PATCH olang v4 3/4] docs: create man page for 0c compiler Date: Mon, 19 Feb 2024 22:04:10 +0100 Message-ID: <20240219210541.25624-4-johnny@johnnyrichard.com> In-Reply-To: <20240219210541.25624-1-johnny@johnnyrichard.com> References: <20240219210541.25624-1-johnny@johnnyrichard.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-TUID: GeSMrVglAfKi Since the 0c compiler contains a --dump-tokens functionality, it has been documented as well. The site build has been adapted to accommodate the manpages build. Everything should work as before for site generation. Signed-off-by: Johnny Richard --- docs/Makefile | 21 +++++++++++++++------ docs/manpages/0c.md | 21 +++++++++++++++++++++ src/0c.c | 1 - 3 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 docs/manpages/0c.md diff --git a/docs/Makefile b/docs/Makefile index 731da5d..54561a1 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,14 +1,16 @@ PANDOC := pandoc INDEX := index.md BUILD_DIR := build -TARGET := $(BUILD_DIR)/index.html +SITE_DIR := $(BUILD_DIR)/site +TARGET := $(SITE_DIR)/index.html DIST_FILE := site.tar.gz PAGES_DIR := pages +MANPAGES := $(BUILD_DIR)/man PAGES := $(wildcard $(PAGES_DIR)/*.md) -HTML_PAGES := $(patsubst $(PAGES_DIR)/%.md, $(BUILD_DIR)/$(PAGES_DIR)/%.html, $(PAGES)) +HTML_PAGES := $(patsubst $(PAGES_DIR)/%.md, $(SITE_DIR)/$(PAGES_DIR)/%.html, $(PAGES)) .PHONY: all -all: $(BUILD_DIR) $(TARGET) $(PAGES) +all: $(BUILD_DIR) $(TARGET) $(PAGES) manpages .PHONY: clean clean: @@ -18,15 +20,22 @@ clean: .PHONY: dist dist: $(DIST_FILE) +.PHONY: manpages +manpages: $(BUILD_DIR) $(MANPAGES)/0c.1 + +$(MANPAGES)/%.1: manpages/%.md + $(PANDOC) -s -t man $< > $@ + $(DIST_FILE): all - tar -czf $(DIST_FILE) -C $(BUILD_DIR) . + tar -czf $(DIST_FILE) -C $(SITE_DIR) . $(TARGET): $(HTML_PAGES) $(PANDOC) -s --template template.html -f markdown -t html $(INDEX) > $(TARGET) $(BUILD_DIR): @mkdir -p $@ - @mkdir -p $@/$(PAGES_DIR) + @mkdir -p $(SITE_DIR)/$(PAGES_DIR) + @mkdir -p $(MANPAGES) -$(BUILD_DIR)/$(PAGES_DIR)/%.html: $(PAGES_DIR)/%.md +$(SITE_DIR)/$(PAGES_DIR)/%.html: $(PAGES_DIR)/%.md $(PANDOC) -s --template template.html -f markdown -t html --toc $< > $@ diff --git a/docs/manpages/0c.md b/docs/manpages/0c.md new file mode 100644 index 0000000..87a56df --- /dev/null +++ b/docs/manpages/0c.md @@ -0,0 +1,21 @@ +% 0C(1) +% olang mantainers +% Feb 2024 + +# NAME + +0c - zero langague compiler + +# SYNOPSIS + +**0c** **----dump-tokens** source.0 + +# DESCRIPTION + +**0c** is the offical compiler for zero language, it is also a tool that +contains utilities to help the language development. + +# GENERAL OPTIONS + +**----dump-tokens** +: Display lexical tokens given a soruce.0 code. diff --git a/src/0c.c b/src/0c.c index 0af9caa..e84559d 100644 --- a/src/0c.c +++ b/src/0c.c @@ -34,7 +34,6 @@ cli_args_shift(cli_args_t *args); typedef struct cli_opts { - // TODO: create man page instruction for --dump-tokens option bool dump_tokens; char *file_path; } cli_opts_t; -- 2.43.2