Skip to content

Commit

Permalink
feat(docs): theme change to docsy
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed Aug 17, 2024
1 parent 3850821 commit 0a4d869
Show file tree
Hide file tree
Showing 21 changed files with 162 additions and 124 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
npm i -D postcss postcss-cli autoprefixer
hugo mod get
hugo \
--minify \
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/zig-cache
/.zig-cache
*lock
docs/resources
docs/resources
docs/public
72 changes: 0 additions & 72 deletions README.org

This file was deleted.

1 change: 1 addition & 0 deletions README.org
7 changes: 0 additions & 7 deletions docs/content.zh/_index.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/content/_index.org

This file was deleted.

24 changes: 24 additions & 0 deletions docs/content/_index.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#+TITLE: Zigcli
#+DATE: 2023-10-21T12:09:48+0800
#+LASTMOD: 2024-08-17T18:53:40+0800
#+TYPE: docs
#+author: Jiacai Liu

[[https://github.com/jiacai2050/zigcli][https://img.shields.io/github/stars/jiacai2050/zigcli.svg]]
[[https://github.com/jiacai2050/loc/actions/workflows/CI.yml][https://github.com/jiacai2050/loc/actions/workflows/CI.yml/badge.svg]]
[[https://github.com/jiacai2050/loc/actions/workflows/binary.yml][https://github.com/jiacai2050/loc/actions/workflows/binary.yml/badge.svg]]
[[https://img.shields.io/badge/zig%20version-0.13.0-blue.svg]]

#+begin_quote
[[https://zigcli.liujiacai.net/][Zigcli]] is a toolkit for building command lines programs in Zig.
#+end_quote

Official website: https://zigcli.liujiacai.net/

It can be imported as [[https://zigcli.liujiacai.net/modules/][Zig modules]] or used directly as [[https://zigcli.liujiacai.net/programs/][binary programs]].

* Who's Using
If you're using =zigcli=, and would like to be added here, welcome to [[https://github.com/jiacai2050/zigcli/pulls][open a PR]].

* License
MIT, see [[https://github.com/jiacai2050/zigcli/blob/main/LICENSE][LICENSE]] for details.
4 changes: 0 additions & 4 deletions docs/content/docs/modules/_index.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/content/docs/programs/_index.org

This file was deleted.

29 changes: 29 additions & 0 deletions docs/content/modules/_index.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#+TITLE: Modules
#+DATE: 2024-08-17T17:58:01+0800
#+LASTMOD: 2024-08-17T18:17:19+0800
#+WEIGHT: 10
#+TYPE: docs
#+AUTHOR: Jiacai Liu
#+DESCRIPTION: Zig modules


* Install
=zigcli= support [[https://ziglang.org/download/0.11.0/release-notes.html#Package-Management][package manager]] introduced in Zig 0.11.

#+begin_src bash
zig fetch --save=zigcli https://github.com/jiacai2050/zigcli/archive/${COMMIT}.tar.gz
#+end_src

#+RESULTS:

Replace ~${COMMIT}~ with a real one, then in your =build.zig=, import the module like this:

#+begin_src zig
const zigcli = b.dependency("zigcli", .{});

// Currently zigcli provide two modules.
exe.root_module.addImport("simargs", zigcli.module("simargs"));
exe.root_module.addImport("pretty-table", zigcli.module("pretty-table"));
#+end_src

* Available modules
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
* Pretty Table
#+TITLE: Pretty Table
#+DATE: 2024-08-17T17:48:29+0800
#+LASTMOD: 2024-08-17T18:17:41+0800
#+TYPE: docs
#+AUTHOR: Jiacai Liu


A formatted and aligned table printer library for Zig.
* Features
- Many box-drawing character to choose(=ascii=, =box=, =dos=).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#+TITLE: Simargs
#+DATE: 2023-10-21T12:04:40+0800
#+LASTMOD: 2024-08-11T20:30:59+0800
#+LASTMOD: 2024-08-17T18:17:38+0800
#+TYPE: docs
#+WEIGTH: 1

* Simargs
A simple, opinionated, struct-based argument parser in Zig, taking full advantage of [[https://kristoff.it/blog/what-is-zig-comptime/][comptime]].
* Features
- Supported data type:
Expand Down
22 changes: 22 additions & 0 deletions docs/content/programs/_index.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#+TITLE: Programs
#+DATE: 2023-10-21T12:26:45+0800
#+LASTMOD: 2024-08-17T18:17:57+0800
#+TYPE: docs
#+WEIGHT: 20
#+DESCRIPTION: Binary programs which can be used directly

* Install
Prebuilt binaries can be found in [[https://github.com/jiacai2050/zigcli/actions/workflows/binary.yml][CI's artifacts]], or you can build from source:
#+begin_src bash
git clone https://github.com/jiacai2050/zigcli.git
#+end_src
Then build with
#+begin_src bash
make build
#+end_src

#+begin_quote
To build zigcli locally, Zig master is required, which can be downloaded [[https://ziglang.org/download/][here]].
#+end_quote

* Available Programs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
* Dark mode
#+TITLE: Dark mode
#+DATE: 2024-08-17T17:52:00+0800
#+LASTMOD: 2024-08-17T18:18:44+0800
#+TYPE: docs
#+AUTHOR: Jiacai Liu

Get dark mode status for macOS.
#+begin_src bash
$ dark-mode -h
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
* Loc
#+TITLE: loc
#+DATE: 2024-08-17T17:52:51+0800
#+LASTMOD: 2024-08-17T18:18:48+0800
#+TYPE: docs
#+AUTHOR: Jiacai Liu

#+begin_src bash :results verbatim code :exports both
./zig-out/bin/loc
#+end_src
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
* Night shift
#+TITLE: Night shift
#+DATE: 2024-08-17T17:52:12+0800
#+LASTMOD: 2024-08-17T18:18:58+0800
#+TYPE: docs
#+AUTHOR: Jiacai Liu

A CLI for configuring "Night Shift" on macOS. 🌕🌖🌗🌘🌑

#+begin_src bash :results verbatim code :exports both
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
* pidof
#+TITLE: pidof
#+DATE: 2024-08-17T17:52:44+0800
#+LASTMOD: 2024-08-17T18:19:01+0800
#+TYPE: docs
#+AUTHOR: Jiacai Liu

Linux has this command, but not macOS, so I write it for you.

#+begin_src bash
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
* repeat
#+TITLE: Repeat
#+DATE: 2024-08-17T17:52:32+0800
#+LASTMOD: 2024-08-17T18:19:06+0800
#+TYPE: docs
#+AUTHOR: Jiacai Liu

#+begin_src bash
$ ./zig-out/bin/repeat -h
USAGE:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#+TITLE: Tree
#+DATE: 2024-08-17T17:52:22+0800
#+LASTMOD: 2024-08-17T18:19:15+0800
#+TYPE: docs
#+AUTHOR: Jiacai Liu

* tree
#+begin_src
$ ./zig-out/bin/tree -h
USAGE:
Expand Down
10 changes: 10 additions & 0 deletions docs/content/roadmap.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#+TITLE: Roadmap
#+DATE: 2024-08-17T18:07:20+0800
#+LASTMOD: 2024-08-17T18:19:47+0800
#+WEIGHT: 30
#+TYPE: docs

* Loc
- Performance, at least comparable with [[https://github.com/cgag/loc][cgag/loc]] [[https://github.com/jiacai2050/loc/issues/1][#1]]
- More options, such as =--exclude <regex>=
- Support multiline comment
4 changes: 3 additions & 1 deletion docs/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ module github.com/jiacai2050/zigcli/docs

go 1.21

require github.com/alex-shpak/hugo-book v0.0.0-20230808113920-3f1bcccbfb24 // indirect
require (
github.com/google/docsy v0.10.0 // indirect
)
6 changes: 4 additions & 2 deletions docs/go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
github.com/alex-shpak/hugo-book v0.0.0-20230808113920-3f1bcccbfb24 h1:8NjMYBSFTtBLeT1VmpZAZznPOt1OH8aNCnE86sL4p4k=
github.com/alex-shpak/hugo-book v0.0.0-20230808113920-3f1bcccbfb24/go.mod h1:L4NMyzbn15fpLIpmmtDg9ZFFyTZzw87/lk7M2bMQ7ds=
github.com/FortAwesome/Font-Awesome v0.0.0-20240402185447-c0f460dca7f7/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/google/docsy v0.10.0 h1:6tMDacPwAyRWNCfvsn/9qGOZDQ8b0aRzjRZvnZPY5dg=
github.com/google/docsy v0.10.0/go.mod h1:c0nIAqmRTOuJ01F85U/wJPQtc3Zj9N58Kea9bOT2AJc=
github.com/twbs/bootstrap v5.3.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
45 changes: 22 additions & 23 deletions docs/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,29 @@ languageCode = 'en-us'
title = 'Zigcli'
enableGitInfo = true

[markup]
[markup.goldmark.renderer]
unsafe = true

[markup.tableOfContents]
startLevel = 1

[languages]
[languages.en]
languageName = 'English'
contentDir = 'content'
weight = 1

# [languages.zh]
# languageName = 'Chinese'
# contentDir = 'content.zh'
# weight = 2

[params]
BookTheme = 'auto'
BookRepo = 'https://github.com/jiacai2050/zigcli'
BookEditPath = 'edit/main/docs'
BookDateFormat = '2006-01-02T15:04:05 -0700'
github_repo = 'https://github.com/jiacai2050/zigcli'
github_subdir = 'docs'
offlineSearch = true

[module]
proxy = "https://goproxy.cn,direct"
[[module.imports]]
path = 'github.com/alex-shpak/hugo-book'
path = "github.com/google/docsy"

[params.copyright]
authors = "Jiacai Liu | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0) | "
from_year = 2023

[params.ui]
navbar_logo = false
showLightDarkModeMenu = true

[markup]
[markup.goldmark]
[markup.goldmark.parser.attribute]
block = true
[markup.goldmark.renderer]
unsafe = true
[markup.highlight]
style = 'tango'

0 comments on commit 0a4d869

Please sign in to comment.