summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Kislyuk <kislyuk@gmail.com>2023-05-06 15:11:28 -0700
committerAndrey Kislyuk <kislyuk@gmail.com>2023-05-06 15:11:31 -0700
commita35e9a610ac3d26b0b44b1fb177826b4a16fdc18 (patch)
tree681f850ee333c127a602ec6221a9f2213a2ffa2e
parent27ecaaafa279493cc3eef0d52d418cd4f0f0efe4 (diff)
Use furo sphinx doc theme
-rw-r--r--Makefile1
-rw-r--r--common.mk2
-rw-r--r--docs/cli-doc-tomlq.txt64
-rw-r--r--docs/cli-doc-xq.txt72
-rw-r--r--docs/conf.py20
-rw-r--r--docs/index.rst11
-rw-r--r--docs/toc.html1
7 files changed, 159 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 1b3e98f..90cafd8 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,7 @@ init_docs:
cd docs; sphinx-quickstart
docs:
+ python -m pip install furo
sphinx-build docs docs/html
install:
diff --git a/common.mk b/common.mk
index 63b0463..6c47130 100644
--- a/common.mk
+++ b/common.mk
@@ -30,6 +30,8 @@ release:
if [[ -f Changes.md ]]; then cat $$TAG_MSG <(echo) Changes.md | sponge Changes.md; git add Changes.md; fi; \
if [[ -f Changes.rst ]]; then cat <(pandoc --from markdown --to rst $$TAG_MSG) <(echo) Changes.rst | sponge Changes.rst; git add Changes.rst; fi; \
yq --help > docs/cli-doc.txt; git add docs/cli-doc.txt; \
+ xq --help > docs/cli-doc-xq.txt; git add docs/cli-doc-xq.txt; \
+ tomlq --help > docs/cli-doc-tomlq.txt; git add docs/cli-doc-tomlq.txt; \
git commit -m ${TAG}; \
git tag --sign --annotate --file $$TAG_MSG ${TAG}
git push --follow-tags
diff --git a/docs/cli-doc-tomlq.txt b/docs/cli-doc-tomlq.txt
new file mode 100644
index 0000000..637156a
--- /dev/null
+++ b/docs/cli-doc-tomlq.txt
@@ -0,0 +1,64 @@
+usage: tomlq [options] <jq filter> [input file...]
+
+tomlq: Command-line TOML processor - jq wrapper for TOML documents
+
+tomlq transcodes TOML documents to JSON and passes them to jq.
+See https://github.com/kislyuk/tomlq for more information.
+
+positional arguments:
+ jq_filter
+ files
+
+optional arguments:
+ -h, --help show this help message and exit
+ --toml-output, -t Transcode jq JSON output back into TOML and emit it
+ --in-place, -i Edit files in place (no backup - use caution)
+ --version show program's version number and exit
+
+jq - commandline JSON processor [version 1.6]
+
+Usage: jq [options] <jq filter> [file...]
+ jq [options] --args <jq filter> [strings...]
+ jq [options] --jsonargs <jq filter> [JSON_TEXTS...]
+
+jq is a tool for processing JSON inputs, applying the given filter to
+its JSON text inputs and producing the filter's results as JSON on
+standard output.
+
+The simplest filter is ., which copies jq's input to its output
+unmodified (except for formatting, but note that IEEE754 is used
+for number representation internally, with all that that implies).
+
+For more advanced filters see the jq(1) manpage ("man jq")
+and/or https://stedolan.github.io/jq
+
+Example:
+
+ $ echo '{"foo": 0}' | jq .
+ {
+ "foo": 0
+ }
+
+Some of the options include:
+ -c compact instead of pretty-printed output;
+ -n use `null` as the single input value;
+ -e set the exit status code based on the output;
+ -s read (slurp) all inputs into an array; apply filter to it;
+ -r output raw strings, not JSON texts;
+ -R read raw strings, not JSON texts;
+ -C colorize JSON;
+ -M monochrome (don't colorize JSON);
+ -S sort keys of objects on output;
+ --tab use tabs for indentation;
+ --arg a v set variable $a to value <v>;
+ --argjson a v set variable $a to JSON value <v>;
+ --slurpfile a f set variable $a to an array of JSON texts read from <f>;
+ --rawfile a f set variable $a to a string consisting of the contents of <f>;
+ --args remaining arguments are string arguments, not files;
+ --jsonargs remaining arguments are JSON arguments, not files;
+ -- terminates argument processing;
+
+Named arguments are also available as $ARGS.named[], while
+positional arguments are available as $ARGS.positional[].
+
+See the manpage for more options.
diff --git a/docs/cli-doc-xq.txt b/docs/cli-doc-xq.txt
new file mode 100644
index 0000000..65dd264
--- /dev/null
+++ b/docs/cli-doc-xq.txt
@@ -0,0 +1,72 @@
+usage: xq [options] <jq filter> [input file...]
+ [--version]
+ [jq_filter] [files ...]
+
+xq: Command-line XML processor - jq wrapper for XML documents
+
+xq transcodes XML documents to JSON and passes them to jq.
+See https://github.com/kislyuk/xq for more information.
+
+positional arguments:
+ jq_filter
+ files
+
+optional arguments:
+ -h, --help show this help message and exit
+ --xml-output, -x Transcode jq JSON output back into XML and emit it
+ --xml-item-depth XML_ITEM_DEPTH
+ Specify depth of items to emit (default 0; use a positive integer to stream large docs)
+ --xml-dtd Preserve XML Document Type Definition (disables streaming of multiple docs)
+ --xml-root XML_ROOT When transcoding back to XML, envelope the output in an element with this name
+ --xml-force-list XML_FORCE_LIST
+ Emit a list for elements with this name even if they occur only once (option can repeat)
+ --in-place, -i Edit files in place (no backup - use caution)
+ --version show program's version number and exit
+
+jq - commandline JSON processor [version 1.6]
+
+Usage: jq [options] <jq filter> [file...]
+ jq [options] --args <jq filter> [strings...]
+ jq [options] --jsonargs <jq filter> [JSON_TEXTS...]
+
+jq is a tool for processing JSON inputs, applying the given filter to
+its JSON text inputs and producing the filter's results as JSON on
+standard output.
+
+The simplest filter is ., which copies jq's input to its output
+unmodified (except for formatting, but note that IEEE754 is used
+for number representation internally, with all that that implies).
+
+For more advanced filters see the jq(1) manpage ("man jq")
+and/or https://stedolan.github.io/jq
+
+Example:
+
+ $ echo '{"foo": 0}' | jq .
+ {
+ "foo": 0
+ }
+
+Some of the options include:
+ -c compact instead of pretty-printed output;
+ -n use `null` as the single input value;
+ -e set the exit status code based on the output;
+ -s read (slurp) all inputs into an array; apply filter to it;
+ -r output raw strings, not JSON texts;
+ -R read raw strings, not JSON texts;
+ -C colorize JSON;
+ -M monochrome (don't colorize JSON);
+ -S sort keys of objects on output;
+ --tab use tabs for indentation;
+ --arg a v set variable $a to value <v>;
+ --argjson a v set variable $a to JSON value <v>;
+ --slurpfile a f set variable $a to an array of JSON texts read from <f>;
+ --rawfile a f set variable $a to a string consisting of the contents of <f>;
+ --args remaining arguments are string arguments, not files;
+ --jsonargs remaining arguments are JSON arguments, not files;
+ -- terminates argument processing;
+
+Named arguments are also available as $ARGS.named[], while
+positional arguments are available as $ARGS.positional[].
+
+See the manpage for more options.
diff --git a/docs/conf.py b/docs/conf.py
index 9573116..c372081 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -5,29 +5,25 @@ copyright = "Andrey Kislyuk"
author = "Andrey Kislyuk"
version = ""
release = ""
-language = None
+language = "en"
master_doc = "index"
extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"]
source_suffix = [".rst", ".md"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
pygments_style = "sphinx"
+templates_path = [""]
if "readthedocs.org" in os.getcwd().split("/"):
with open("index.rst", "w") as fh:
fh.write("Documentation for this project has moved to https://kislyuk.github.io/" + project)
else:
- import guzzle_sphinx_theme
- html_theme_path = guzzle_sphinx_theme.html_theme_path()
- html_theme = "guzzle_sphinx_theme"
- html_theme_options = {
- "project_nav_name": project,
- "projectlink": "https://github.com/kislyuk/" + project,
- }
+ html_theme = "furo"
html_sidebars = {
"**": [
- "logo-text.html",
- # "globaltoc.html",
- "localtoc.html",
- "searchbox.html"
+ "sidebar/brand.html",
+ "sidebar/search.html",
+ "sidebar/scroll-start.html",
+ "toc.html",
+ "sidebar/scroll-end.html",
]
}
diff --git a/docs/index.rst b/docs/index.rst
index 220bf09..0dd9a65 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -3,8 +3,19 @@
CLI usage
=========
+yq
+--
.. literalinclude:: cli-doc.txt
+xq
+--
+.. literalinclude:: cli-doc-xq.txt
+
+tomlq
+-----
+.. literalinclude:: cli-doc-tomlq.txt
+
+
Change log
==========
diff --git a/docs/toc.html b/docs/toc.html
new file mode 100644
index 0000000..8aca8b4
--- /dev/null
+++ b/docs/toc.html
@@ -0,0 +1 @@
+{{toc}}