Closed simonw closed 1 year ago
I wrote the docs like this because early examples include both the command and its output:
https://sqlite-utils.datasette.io/en/stable/cli.html#returning-json
I could split them up into two blocks like this:
I do miss the visual indication that one of these is the command and one is the output though.
Another option:
That's using this markup:
Newline-delimited JSON
~~~~~~~~~~~~~~~~~~~~~~
Use ``--nl`` to get back newline-delimited JSON objects:
.. code-block:: bash
sqlite-utils dogs.db "select * from dogs" --nl
.. code-block:: output
{"id": 1, "age": 4, "name": "Cleo"}
{"id": 2, "age": 2, "name": "Pancakes"}
And this extra CSS:
.highlight-output .highlight {
border-left: 9px solid #30c94f;
}
Put this in a PR so I can preview it:
This page has all of the changes: https://sqlite-utils--553.org.readthedocs.build/en/553/cli.html#running-sql-queries
e.g. in this section:
https://sqlite-utils.datasette.io/en/stable/cli.html#running-queries-directly-against-csv-or-json
The little copy button will also copy the
$
which breaks the examples when copied.