diff --git a/README.md b/README.md index d8dd704..3a828ec 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,45 @@ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com) [![License](https://img.shields.io/badge/LICENSE-CC_BY_4.0-00a2ff)](https://creativecommons.org/licenses/by/4.0/) +## Contents + + +- [Awesome-cli-framework](#awesome-cli-framework) + - [Contents](#contents) + - [Bash/Shell](#bashshell) + - [Crystal](#crystal) + - [C++](#c) + - [Dart](#dart) + - [Deno](#deno) + - [Dotnet/C\#](#dotnetc%5C) + - [Useful awesome list for Dotnet cli](#useful-awesome-list-for-dotnet-cli) + - [Elixir](#elixir) + - [Fortran](#fortran) + - [Go](#go) + - [Useful awesome list for Go cli](#useful-awesome-list-for-go-cli) + - [Haskell](#haskell) + - [Java](#java) + - [JavaScript](#javascript) + - [Julia](#julia) + - [Kotlin](#kotlin) + - [Nim](#nim) + - [Ocaml](#ocaml) + - [PHP](#php) + - [Purescript](#purescript) + - [Python](#python) + - [Ruby](#ruby) + - [Useful awesome list for Ruby cli](#useful-awesome-list-for-ruby-cli) + - [R](#r) + - [Rust](#rust) + - [Scala](#scala) + - [Swift](#swift) + - [V](#v) + - [Zig](#zig) + - [**Contributing**](#contributing) + - [License](#license) + + + ## Bash/Shell - [argc](https://github.com/sigoden/argc) : A bash cli framework, also a task management & automation tool (written in rust). @@ -76,6 +115,8 @@ - [cli](https://github.com/urfave/cli) : A simple, fast, and fun package for building command line apps in Go. +- [climate](https://github.com/avamsi/climate) : Autogenerates CLIs from structs / functions (nested subcommands, global / local flags, help generation, typo suggestions, shell completion etc.) + - [Cobra](https://github.com/spf13/cobra) : Many of the most widely used Go projects are built using Cobra, such as: [Kubernetes](http://kubernetes.io/), [Hugo](http://gohugo.io), [rkt](https://github.com/coreos/rkt), [etcd](https://github.com/coreos/etcd), [Moby (former Docker)](https://github.com/moby/moby), [Docker (distribution)](https://github.com/docker/distribution), [OpenShift](https://www.openshift.com/), [Delve](https://github.com/derekparker/delve), [GopherJS](http://www.gopherjs.org/), [CockroachDB](http://www.cockroachlabs.com/), [Bleve](http://www.blevesearch.com/), [ProjectAtomic (enterprise)](http://www.projectatomic.io/), [Giant Swarm's gsctl](https://github.com/giantswarm/gsctl), [Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack), [rclone](http://rclone.org/), [nehm](https://github.com/bogem/nehm), [Pouch](https://github.com/alibaba/pouch), [Istio](https://istio.io), [Prototool](https://github.com/uber/prototool), [mattermost-server](https://github.com/mattermost/mattermost-server), [Gardener](https://github.com/gardener/gardenctl), [Linkerd](https://linkerd.io/), etc. diff --git a/docs/404.html b/docs/404.html index 76f2787..025d1b0 100644 --- a/docs/404.html +++ b/docs/404.html @@ -4,7 +4,7 @@ Page not found - Awesome CLI Framework - + diff --git a/docs/book.js b/docs/book.js index d40440c..351e28c 100644 --- a/docs/book.js +++ b/docs/book.js @@ -4,14 +4,16 @@ window.onunload = function () { }; // Global variable, shared between modules -function playground_text(playground) { +function playground_text(playground, hidden = true) { let code_block = playground.querySelector("code"); if (window.ace && code_block.classList.contains("editable")) { let editor = window.ace.edit(code_block); return editor.getValue(); - } else { + } else if (hidden) { return code_block.textContent; + } else { + return code_block.innerText; } } @@ -66,7 +68,7 @@ function playground_text(playground) { } // updates the visibility of play button based on `no_run` class and - // used crates vs ones available on http://play.rust-lang.org + // used crates vs ones available on https://play.rust-lang.org function update_play_button(pre_block, playground_crates) { var play_button = pre_block.querySelector(".play-button"); @@ -166,7 +168,6 @@ function playground_text(playground) { .filter(function (node) {return node.classList.contains("editable"); }) .forEach(function (block) { block.classList.remove('language-rust'); }); - Array code_nodes .filter(function (node) {return !node.classList.contains("editable"); }) .forEach(function (block) { hljs.highlightBlock(block); }); @@ -178,7 +179,7 @@ function playground_text(playground) { // even if highlighting doesn't apply code_nodes.forEach(function (block) { block.classList.add('hljs'); }); - Array.from(document.querySelectorAll("code.language-rust")).forEach(function (block) { + Array.from(document.querySelectorAll("code.hljs")).forEach(function (block) { var lines = Array.from(block.querySelectorAll('.boring')); // If no lines were hidden, return @@ -300,6 +301,13 @@ function playground_text(playground) { themePopup.querySelector("button#" + get_theme()).focus(); } + function updateThemeSelected() { + themePopup.querySelectorAll('.theme-selected').forEach(function (el) { + el.classList.remove('theme-selected'); + }); + themePopup.querySelector("button#" + get_theme()).classList.add('theme-selected'); + } + function hideThemes() { themePopup.style.display = 'none'; themeToggleButton.setAttribute('aria-expanded', false); @@ -338,7 +346,7 @@ function playground_text(playground) { } setTimeout(function () { - themeColorMetaTag.content = getComputedStyle(document.body).backgroundColor; + themeColorMetaTag.content = getComputedStyle(document.documentElement).backgroundColor; }, 1); if (window.ace && window.editors) { @@ -355,6 +363,7 @@ function playground_text(playground) { html.classList.remove(previousTheme); html.classList.add(theme); + updateThemeSelected(); } // Set theme @@ -542,13 +551,6 @@ function playground_text(playground) { firstContact = null; } }, { passive: true }); - - // Scroll sidebar to current active section - var activeSection = document.getElementById("sidebar").querySelector(".active"); - if (activeSection) { - // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView - activeSection.scrollIntoView({ block: 'center' }); - } })(); (function chapterNavigation() { @@ -592,7 +594,7 @@ function playground_text(playground) { text: function (trigger) { hideTooltip(trigger); let playground = trigger.closest("pre"); - return playground_text(playground); + return playground_text(playground, false); } }); @@ -667,13 +669,14 @@ function playground_text(playground) { }, { passive: true }); })(); (function controllBorder() { - menu.classList.remove('bordered'); - document.addEventListener('scroll', function () { + function updateBorder() { if (menu.offsetTop === 0) { menu.classList.remove('bordered'); } else { menu.classList.add('bordered'); } - }, { passive: true }); + } + updateBorder(); + document.addEventListener('scroll', updateBorder, { passive: true }); })(); })(); diff --git a/docs/css/chrome.css b/docs/css/chrome.css index 10fa4b3..29992f7 100644 --- a/docs/css/chrome.css +++ b/docs/css/chrome.css @@ -2,12 +2,6 @@ @import 'variables.css'; -::-webkit-scrollbar { - background: var(--bg); -} -::-webkit-scrollbar-thumb { - background: var(--scrollbar); -} html { scrollbar-color: var(--scrollbar) var(--bg); } @@ -18,6 +12,19 @@ a > .hljs { color: var(--links); } +/* + body-container is necessary because mobile browsers don't seem to like + overflow-x on the body tag when there is a tag. +*/ +#body-container { + /* + This is used when the sidebar pushes the body content off the side of + the screen on small screens. Without it, dragging on mobile Safari + will want to reposition the viewport in a weird way. + */ + overflow-x: clip; +} + /* Menu Bar */ #menu-bar, @@ -507,6 +514,8 @@ ul#searchresults span.teaser em { padding: 0; list-style: none; display: none; + /* Don't let the children's background extend past the rounded corners. */ + overflow: hidden; } .theme-popup .default { color: var(--icons); @@ -515,7 +524,7 @@ ul#searchresults span.teaser em { width: 100%; border: 0; margin: 0; - padding: 2px 10px; + padding: 2px 20px; line-height: 25px; white-space: nowrap; text-align: left; @@ -527,8 +536,10 @@ ul#searchresults span.teaser em { .theme-popup .theme:hover { background-color: var(--theme-hover); } -.theme-popup .theme:hover:first-child, -.theme-popup .theme:hover:last-child { - border-top-left-radius: inherit; - border-top-right-radius: inherit; + +.theme-selected::before { + display: inline-block; + content: "✓"; + margin-left: -14px; + width: 14px; } diff --git a/docs/css/general.css b/docs/css/general.css index 0e4f07a..344b53e 100644 --- a/docs/css/general.css +++ b/docs/css/general.css @@ -22,8 +22,8 @@ body { } code { - font-family: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace !important; - font-size: 0.875em; /* please adjust the ace font size accordingly in editor.js */ + font-family: var(--mono-font) !important; + font-size: var(--code-font-size); } /* make long words/inline code not x overflow */ @@ -148,6 +148,18 @@ blockquote { border-bottom: .1em solid var(--quote-border); } +kbd { + background-color: var(--table-border-color); + border-radius: 4px; + border: solid 1px var(--theme-popup-border); + box-shadow: inset 0 -1px 0 var(--theme-hover); + display: inline-block; + font-size: var(--code-font-size); + font-family: var(--mono-font); + line-height: 10px; + padding: 4px 5px; + vertical-align: middle; +} :not(.footnote-definition) + .footnote-definition, .footnote-definition + :not(.footnote-definition) { diff --git a/docs/css/variables.css b/docs/css/variables.css index 56b634b..21bf8e5 100644 --- a/docs/css/variables.css +++ b/docs/css/variables.css @@ -6,6 +6,8 @@ --page-padding: 15px; --content-max-width: 750px; --menu-bar-height: 50px; + --mono-font: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace; + --code-font-size: 0.875em /* please adjust the ace font size accordingly in editor.js */ } /* Themes */ diff --git a/docs/index.html b/docs/index.html index d11049c..41577d7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -151,6 +151,56 @@

Awesome PRs Welcome License

+

Contents

+ + +

Bash/Shell