Repository navigation
readaloud 2.1.0
The preferences are a directory of files, one per kind of input, picked by the file's
extension: a Markdown file is drawn by mdcat and read cell by cell without a flag, and a
Python file is read through its grammar by the shipped python.conf.
- The preferences are a directory,
~/.readaloud/:readaloud.conffor what applies
to everything,markdown.conffor Markdown, and a<language>.confper language
(python.conf,rust.conf), named after the grammar, with plain[config],
[pronunciations],[shapes],[parts]and[syntax]sections inside. The first run
of this version moves an existing~/.readaloud.confinto the directory, section by
section, deletes it and says so. The three shipped files live in
src/readaloud/configs/, where a language's file can be shared. [files]inreadaloud.confsays which configs read a file, by its extension:
.py .pyi = code python,.rs = code rust,.md = markdown. Each name is a layer, the
[config.code]-style sections inreadaloud.confplus a<name>.conf, laid over one
another in that order; the last names the grammar. Adding Rust is one line and a
rust.conf. Thecodelayer, every source file'sformat = codeand the words for the
operators, lives inreadaloud.conf.-mdand--markdownare gone (a hint says what to do).readaloud notes.mdreads
the file: a lone argument that names a file is that file, and.mdgets
markdown.conf, whose newrenderer = mdcatdraws it with
mdcat and reads its tables cell by cell, falling back to stripped text with a notice when
mdcat is not installed. A pipe or TEXT gets the same with--conf md;--conf NAME
reads any input with the configs of a.NAMEfile or the layer NAME.- A Python comment is read without its
#, and a triple-quoted string without its quotes:
[syntax]rules in the shippedpython.conf; a language's file carries its own markers.
A rule may say nothing, and the text it covers is then neither read nor reached by an
entry; a rule beats an entry of the same length, where a shape loses to one. The two
"triple quote" entries are gone from the shippedreadaloud.conf. - A comment leading a
def's body, which the grammar hangs on thedefitself rather
than in the body, is said before the body instead of being dropped by the rule. readaloud --tree app.pyprints a file's syntax tree, the node kinds and fields a
[syntax]rule can name, and the docs say how to change the reading of a piece of code:
find its kind in the tree, write the line, delete it to go back.- The
markdown = yes|nosetting of 2.0 isformat = markdown | code | plain: how plain
input is read.codeis what thecodelayer sets;plainis new, for text that is
neither Markdown nor code and should keep its*asterisks*. The first run rewrites an old
markdown = noasformat = code. - With
format = code, a source file's indented lines are cut into chunks of at most
charslike any paragraph, at line ends, instead of being read as one code block: a
class body no longer waits on one long synthesis. - In a source file, operators (
==,<=,->, the*of*args) are words of their
own, lit while they are spoken; before, their speech ran under the neighbouring word.
A rule's opening words light the token before the node, so "and returns type" lights
the->and "with a default of" the=. - With
format = code, each line is read as a sentence of its own, so the pause falls
where the line ends rather than wherever the voice feels like it: "return self dot path
dot stem", pause, "method for_file takes self". A line that runs on (a bracket left open,
a trailing comma or operator, a\) is not. The screen and the highlight are unchanged.