Remove all remaining "$ " prefixes from docs, closes #2140

Also document sqlite-utils create-view
This commit is contained in:
Simon Willison 2023-08-11 10:44:34 -07:00
commit 943df09dcc
14 changed files with 108 additions and 41 deletions

View file

@ -133,13 +133,19 @@ Running Black
Black will be installed when you run ``pip install -e '.[test]'``. To test that your code complies with Black, run the following in your root ``datasette`` repository checkout::
$ black . --check
black . --check
::
All done! ✨ 🍰 ✨
95 files would be left unchanged.
If any of your code does not conform to Black you can run this to automatically fix those problems::
$ black .
black .
::
reformatted ../datasette/setup.py
All done! ✨ 🍰 ✨
1 file reformatted, 94 files left unchanged.
@ -160,11 +166,14 @@ Prettier
To install Prettier, `install Node.js <https://nodejs.org/en/download/package-manager/>`__ and then run the following in the root of your ``datasette`` repository checkout::
$ npm install
npm install
This will install Prettier in a ``node_modules`` directory. You can then check that your code matches the coding style like so::
$ npm run prettier -- --check
npm run prettier -- --check
::
> prettier
> prettier 'datasette/static/*[!.min].js' "--check"
@ -174,7 +183,7 @@ This will install Prettier in a ``node_modules`` directory. You can then check t
You can fix any problems by running::
$ npm run fix
npm run fix
.. _contributing_documentation:
@ -322,10 +331,17 @@ Upgrading CodeMirror
Datasette bundles `CodeMirror <https://codemirror.net/>`__ for the SQL editing interface, e.g. on `this page <https://latest.datasette.io/fixtures>`__. Here are the steps for upgrading to a new version of CodeMirror:
* Install the packages with::
* Install the packages with `npm i codemirror @codemirror/lang-sql`
* Build the bundle using the version number from package.json with:
npm i codemirror @codemirror/lang-sql
node_modules/.bin/rollup datasette/static/cm-editor-6.0.1.js -f iife -n cm -o datasette/static/cm-editor-6.0.1.bundle.js -p @rollup/plugin-node-resolve -p @rollup/plugin-terser
* Build the bundle using the version number from package.json with::
* Update version reference in the `codemirror.html` template
node_modules/.bin/rollup datasette/static/cm-editor-6.0.1.js \
-f iife \
-n cm \
-o datasette/static/cm-editor-6.0.1.bundle.js \
-p @rollup/plugin-node-resolve \
-p @rollup/plugin-terser
* Update the version reference in the ``codemirror.html`` template.