From 58dcf810c8187df5a8558eef31fd4f4530748adf Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sun, 4 Aug 2024 22:12:45 +0700 Subject: all: update the CLI usage in the README There are three places for command usage: one in main Go doc, one in the program usage, and one in README. If we changes the flags we need to update three of them, and sometimes we forgot. To simplify, we remove the one in the Go doc main program. --- README.md | 38 +++++++++++++++++++++++++++++--------- cmd/ciigo/main.go | 23 ----------------------- 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index d051ba7..cab739e 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,11 @@ markup format. As showcase, the following websites are build using ciigo, -* [kilabit.info](https://kilabit.info) -* [golang-id.org](https://golang-id.org) +* [kilabit.info](https://kilabit.info) - + [Source code](https://git.sr.ht/~shulhan/kilabit.info). + +* [golang-id.org](https://golang-id.org) - + [Source code](https://git.sr.ht/~shulhan/golang-id-web). ## ciigo as CLI @@ -21,30 +24,47 @@ markup files, as HTML files. ### Usage ``` -$ ciigo [-template ] [-exclude ] convert +ciigo [-template ] [-exclude ] convert ``` -Scan the "dir" recursively to find markup files (.adoc) and convert them into -HTML files. +Scan the "dir" recursively to find markup files (.adoc or .md) and convert +them into HTML files. The template "file" is optional, default to embedded HTML template. ``` -$ ciigo [-template ] [-exclude ] [-out ] generate +ciigo [-template ] [-exclude ] [-out ] \ + [-package-name ] [-var-name ] \ + embed ``` -Convert all markup files inside directory "dir" recursively and then -embed them into ".go" source file. +Convert all markup files inside directory "dir" recursively and then embed +them into ".go" source file. The output file is optional, default to "ciigo_static.go" in current directory. +The package name default to main. +The variable name default to memFS. + +``` +ciigo help +``` + +Print the usage. ``` -$ ciigo [-template ] [-exclude ] [-address ] serve +ciigo [-template ] [-exclude ] [-address ] \ + serve ``` Serve all files inside directory "dir" using HTTP server, watch changes on markup files and convert them to HTML files automatically. If the address is not set, its default to ":8080". +``` +ciigo version +``` + +Print the current ciigo version. + ## ciigo as library diff --git a/cmd/ciigo/main.go b/cmd/ciigo/main.go index 9b5184d..d4d4fc9 100644 --- a/cmd/ciigo/main.go +++ b/cmd/ciigo/main.go @@ -3,29 +3,6 @@ // ciigo is a CLI to convert, embed, and/or serve a directory that contains // markup files, as HTML files. -// -// # Usage -// -// The following section describe how to use ciigo CLI. -// -// ciigo [-template ] [-exclude ] convert -// -// Scan the "dir" recursively to find markup files and convert them into HTML -// files. -// The template "file" is optional, default to embedded HTML template. -// -// ciigo [-template ] [-exclude ] [-out ] embed -// -// Convert all the markup files inside directory "dir" recursively and then -// embed them into ".go" source file. -// The output file is optional, default to "ciigo_static.go" in current -// directory. -// -// ciigo [-template ] [-exclude ] [-address ] serve -// -// Serve all files inside directory "dir" using HTTP server, watch changes on -// markup files and convert them to HTML files. -// If the address is not set, its default to ":8080". package main import ( -- cgit v1.3