minor tweak to new-platforms.md, and run prettier on docs

This commit is contained in:
Damien Elmes 2021-10-23 15:34:08 +10:00
parent ee644e08a3
commit 3b8b71b815
8 changed files with 68 additions and 58 deletions

4
docs/BUILD.bazel Normal file
View file

@ -0,0 +1,4 @@
load("//ts:prettier.bzl", "prettier_test")
# formatting of the .md files
prettier_test()

View file

@ -21,7 +21,7 @@ pylib contains a private Python module called rsbridge (`pylib/rsbridge/`) that
### GUI ### GUI
Anki's *GUI* is a mix of Qt (via the PyQt Python bindings for Qt), and Anki's _GUI_ is a mix of Qt (via the PyQt Python bindings for Qt), and
TypeScript/HTML/CSS. The Qt code lives in `qt/aqt/`, and is importable in Python TypeScript/HTML/CSS. The Qt code lives in `qt/aqt/`, and is importable in Python
with "import aqt". The web code is split between `qt/aqt/data/web/` and `ts/`, with "import aqt". The web code is split between `qt/aqt/data/web/` and `ts/`,
with the majority of new code being placed in the latter, and copied into the with the majority of new code being placed in the latter, and copied into the
@ -39,4 +39,4 @@ type-safe manner between the different languages.
At the moment, the protobuf is not considered public API. Some pylib methods At the moment, the protobuf is not considered public API. Some pylib methods
expose a protobuf object directly to callers, but when they do so, they use a expose a protobuf object directly to callers, but when they do so, they use a
type alias, so callers outside pylib should never need to import a generated type alias, so callers outside pylib should never need to import a generated
_pb2.py file. \_pb2.py file.

View file

@ -179,9 +179,9 @@ expand proc macros and build scripts, and run cargo check on startup. Adding
of `use` statements. of `use` statements.
The Bazel build products will make RA start up slowly out of the box. For a much The Bazel build products will make RA start up slowly out of the box. For a much
nicer experience, add each of the bazel-* folders to Rust Analyzer's excludeDirs nicer experience, add each of the `bazel-*` folders to Rust Analyzer's excludeDirs
settings, and node_modules. Wildcards don't work unfortunately. Then adjust settings, and node*modules. Wildcards don't work unfortunately. Then adjust
VS Code's "watcher exclude", and add `**/bazel-*`. VS Code's "watcher exclude", and add `\*\*/bazel-*`.
After running 'code' from the project root, it may take a minute or two to be After running 'code' from the project root, it may take a minute or two to be
ready. ready.

View file

@ -31,16 +31,16 @@ https://github.com/ankitects/anki/commit/db3308e788f20b188e84add40d6a1dce5bf726a
folder is, and add the following to user.bazelrc in the project folder root: folder is, and add the following to user.bazelrc in the project folder root:
``` ```
build --action_env=PYTHON_SITE_PACKAGES=/path/to/site-packages build --action_env=PYTHON_SITE_PACKAGES=/path/to/site-packages/
``` ```
- Anki uses the Python 'orjson' module to speed up DB access. If you're on a - Anki uses the Python 'orjson' module to speed up DB access. If you're on a
platform that can not build orjson, you can remove it from platform that can not build orjson, you can remove it from
pip/requirements.txt to skip it during running/building, but DB operations python/requirements.txt to skip it during running/building, but DB operations
will be slower. will be slower.
The py_wheel() rule in pylib/anki/BUILD.bazel adds an orjson requirement to The py_wheel() rule in pylib/anki/BUILD.bazel adds an orjson requirement to
the generated Anki wheel on x86_64. If you have removed orjson, you'll want to the generated Anki wheel. If you have removed orjson, you'll want to
remove that line. If you have successfully built orjson for another platform, remove that line. If you have successfully built orjson for another platform,
you'll want to adjust that line to include your platform. you'll want to adjust that line to include your platform.

View file

@ -1,2 +1,7 @@
# this is a hack to invoke prettier directly from Bazel # this is a hack to invoke prettier directly from Bazel
(cd "${BUILD_WORKSPACE_DIRECTORY}" && node_modules/.bin/prettier --config .prettierrc --write ts qt/aqt/data/web/js) (cd "${BUILD_WORKSPACE_DIRECTORY}" && node_modules/.bin/prettier \
--config .prettierrc --write \
ts \
qt/aqt/data/web/js \
docs \
)

View file

@ -9,6 +9,7 @@ def prettier_test(name = "format_check", srcs = None, exclude = [], **kwargs):
"*.ts", "*.ts",
"*.js", "*.js",
"*.svelte", "*.svelte",
"*.md",
], exclude = exclude) ], exclude = exclude)
_prettier_test( _prettier_test(