Skip to content

Commit 02a0ab1

Browse files
committed
Docs: use double single quotes for raw strings
1 parent a5aa6cc commit 02a0ab1

21 files changed

+288
-284
lines changed

docs/changelog.rst

Lines changed: 144 additions & 142 deletions
Large diffs are not rendered by default.

docs/dev/plugins.rst

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -151,50 +151,50 @@ registration process in this case::
151151

152152
The events currently available are:
153153

154-
* `pluginload`: called after all the plugins have been loaded after the ``beet``
155-
command starts
154+
* ``pluginload``: called after all the plugins have been loaded after the
155+
``beet`` command starts
156156

157-
* `import`: called after a ``beet import`` command finishes (the ``lib`` keyword
158-
argument is a Library object; ``paths`` is a list of paths (strings) that were
159-
imported)
157+
* ``import``: called after a ``beet import`` command finishes (the ``lib``
158+
keyword argument is a Library object; ``paths`` is a list of paths (strings)
159+
that were imported)
160160

161-
* `album_imported`: called with an ``Album`` object every time the ``import``
161+
* ``album_imported``: called with an ``Album`` object every time the ``import``
162162
command finishes adding an album to the library. Parameters: ``lib``,
163163
``album``
164164

165-
* `album_removed`: called with an ``Album`` object every time an album is
165+
* ``album_removed``: called with an ``Album`` object every time an album is
166166
removed from the library (even when its file is not deleted from disk).
167167

168-
* `item_copied`: called with an ``Item`` object whenever its file is copied.
168+
* ``item_copied``: called with an ``Item`` object whenever its file is copied.
169169
Parameters: ``item``, ``source`` path, ``destination`` path
170170

171-
* `item_imported`: called with an ``Item`` object every time the importer adds a
172-
singleton to the library (not called for full-album imports). Parameters:
173-
``lib``, ``item``
171+
* ``item_imported``: called with an ``Item`` object every time the importer
172+
adds a singleton to the library (not called for full-album imports).
173+
Parameters: ``lib``, ``item``
174174

175-
* `before_item_moved`: called with an ``Item`` object immediately before its
175+
* ``before_item_moved``: called with an ``Item`` object immediately before its
176176
file is moved. Parameters: ``item``, ``source`` path, ``destination`` path
177177

178-
* `item_moved`: called with an ``Item`` object whenever its file is moved.
178+
* ``item_moved``: called with an ``Item`` object whenever its file is moved.
179179
Parameters: ``item``, ``source`` path, ``destination`` path
180180

181-
* `item_linked`: called with an ``Item`` object whenever a symlink is created
181+
* ``item_linked``: called with an ``Item`` object whenever a symlink is created
182182
for a file.
183183
Parameters: ``item``, ``source`` path, ``destination`` path
184184

185-
* `item_hardlinked`: called with an ``Item`` object whenever a hardlink is
185+
* ``item_hardlinked``: called with an ``Item`` object whenever a hardlink is
186186
created for a file.
187187
Parameters: ``item``, ``source`` path, ``destination`` path
188188

189-
* `item_reflinked`: called with an ``Item`` object whenever a reflink is
189+
* ``item_reflinked``: called with an ``Item`` object whenever a reflink is
190190
created for a file.
191191
Parameters: ``item``, ``source`` path, ``destination`` path
192192

193-
* `item_removed`: called with an ``Item`` object every time an item (singleton
193+
* ``item_removed``: called with an ``Item`` object every time an item (singleton
194194
or album's part) is removed from the library (even when its file is not
195195
deleted from disk).
196196

197-
* `write`: called with an ``Item`` object, a ``path``, and a ``tags``
197+
* ``write``: called with an ``Item`` object, a ``path``, and a ``tags``
198198
dictionary just before a file's metadata is written to disk (i.e.,
199199
just before the file on disk is opened). Event handlers may change
200200
the ``tags`` dictionary to customize the tags that are written to the
@@ -203,79 +203,80 @@ The events currently available are:
203203
operation. Beets will catch that exception, print an error message
204204
and continue.
205205

206-
* `after_write`: called with an ``Item`` object after a file's metadata is
206+
* ``after_write``: called with an ``Item`` object after a file's metadata is
207207
written to disk (i.e., just after the file on disk is closed).
208208

209-
* `import_task_created`: called immediately after an import task is
210-
initialized. Plugins can use this to, for example, change imported files of a
211-
task before anything else happens. It's also possible to replace the task
212-
with another task by returning a list of tasks. This list can contain zero
213-
or more `ImportTask`s. Returning an empty list will stop the task.
214-
Parameters: ``task`` (an `ImportTask`) and ``session`` (an `ImportSession`).
209+
* ``import_task_created``: called immediately after an import task is
210+
initialized. Plugins can use this to, for example, change imported files of
211+
a task before anything else happens. It's also possible to replace the task
212+
with another task by returning a list of tasks. This list can contain zero or
213+
more ``ImportTask``. Returning an empty list will stop the task.
214+
Parameters: ``task`` (an ``ImportTask``) and ``session`` (an
215+
``ImportSession``).
215216

216-
* `import_task_start`: called when before an import task begins processing.
217+
* ``import_task_start``: called when before an import task begins processing.
217218
Parameters: ``task`` and ``session``.
218219

219-
* `import_task_apply`: called after metadata changes have been applied in an
220+
* ``import_task_apply``: called after metadata changes have been applied in an
220221
import task. This is called on the same thread as the UI, so use this
221222
sparingly and only for tasks that can be done quickly. For most plugins, an
222223
import pipeline stage is a better choice (see :ref:`plugin-stage`).
223224
Parameters: ``task`` and ``session``.
224225

225-
* `import_task_before_choice`: called after candidate search for an import task
226-
before any decision is made about how/if to import or tag. Can be used to
227-
present information about the task or initiate interaction with the user
226+
* ``import_task_before_choice``: called after candidate search for an import
227+
task before any decision is made about how/if to import or tag. Can be used
228+
to present information about the task or initiate interaction with the user
228229
before importing occurs. Return an importer action to take a specific action.
229230
Only one handler may return a non-None result.
230231
Parameters: ``task`` and ``session``
231232

232-
* `import_task_choice`: called after a decision has been made about an import
233+
* ``import_task_choice``: called after a decision has been made about an import
233234
task. This event can be used to initiate further interaction with the user.
234235
Use ``task.choice_flag`` to determine or change the action to be
235236
taken. Parameters: ``task`` and ``session``.
236237

237-
* `import_task_files`: called after an import task finishes manipulating the
238+
* ``import_task_files``: called after an import task finishes manipulating the
238239
filesystem (copying and moving files, writing metadata tags). Parameters:
239240
``task`` and ``session``.
240241

241-
* `library_opened`: called after beets starts up and initializes the main
242+
* ``library_opened``: called after beets starts up and initializes the main
242243
Library object. Parameter: ``lib``.
243244

244-
* `database_change`: a modification has been made to the library database. The
245+
* ``database_change``: a modification has been made to the library database. The
245246
change might not be committed yet. Parameters: ``lib`` and ``model``.
246247

247-
* `cli_exit`: called just before the ``beet`` command-line program exits.
248+
* ``cli_exit``: called just before the ``beet`` command-line program exits.
248249
Parameter: ``lib``.
249250

250-
* `import_begin`: called just before a ``beet import`` session starts up.
251+
* ``import_begin``: called just before a ``beet import`` session starts up.
251252
Parameter: ``session``.
252253

253-
* `trackinfo_received`: called after metadata for a track item has been
254+
* ``trackinfo_received``: called after metadata for a track item has been
254255
fetched from a data source, such as MusicBrainz. You can modify the tags
255256
that the rest of the pipeline sees on a ``beet import`` operation or during
256257
later adjustments, such as ``mbsync``. Slow handlers of the event can impact
257258
the operation, since the event is fired for any fetched possible match
258-
`before` the user (or the autotagger machinery) gets to see the match.
259+
``before`` the user (or the autotagger machinery) gets to see the match.
259260
Parameter: ``info``.
260261

261-
* `albuminfo_received`: like `trackinfo_received`, the event indicates new
262+
* ``albuminfo_received``: like ``trackinfo_received``, the event indicates new
262263
metadata for album items. The parameter is an ``AlbumInfo`` object instead
263264
of a ``TrackInfo``.
264265
Parameter: ``info``.
265266

266-
* `before_choose_candidate`: called before the user is prompted for a decision
267+
* ``before_choose_candidate``: called before the user is prompted for a decision
267268
during a ``beet import`` interactive session. Plugins can use this event for
268269
:ref:`appending choices to the prompt <append_prompt_choices>` by returning a
269270
list of ``PromptChoices``. Parameters: ``task`` and ``session``.
270-
* `mb_track_extract`: called after the metadata is obtained from MusicBrainz.
271+
* ``mb_track_extract``: called after the metadata is obtained from MusicBrainz.
271272
The parameter is a ``dict`` containing the tags retrieved from MusicBrainz for
272273
a track. Plugins must return a new (potentially empty) ``dict`` with
273274
additional ``field: value`` pairs, which the autotagger will apply to the
274275
item, as flexible attributes if ``field`` is not a hardcoded field. Fields
275276
already present on the track are overwritten. Parameter: ``data``
276-
* `mb_album_extract`: Like `mb_track_extract`, but for album tags. Overwrites
277-
tags set at the track level, if they have the same ``field``. Parameter:
278-
``data``
277+
* ``mb_album_extract``: Like ``mb_track_extract``, but for album tags.
278+
Overwrites tags set at the track level, if they have the same ``field``.
279+
Parameter: ``data``
279280

280281
The included ``mpdupdate`` plugin provides an example use case for event
281282
listeners.
@@ -328,10 +329,10 @@ Read Configuration Options
328329
^^^^^^^^^^^^^^^^^^^^^^^^^^
329330

330331
Plugins can configure themselves using the ``config.yaml`` file. You can read
331-
configuration values in two ways. The first is to use `self.config` within
332+
configuration values in two ways. The first is to use ``self.config`` within
332333
your plugin class. This gives you a view onto the configuration values in a
333334
section with the same name as your plugin's module. For example, if your plugin
334-
is in ``greatplugin.py``, then `self.config` will refer to options under the
335+
is in ``greatplugin.py``, then ``self.config`` will refer to options under the
335336
``greatplugin:`` section of the config file.
336337

337338
For example, if you have a configuration value called "foo", then users can put
@@ -341,19 +342,19 @@ this in their ``config.yaml``::
341342
foo: bar
342343

343344
To access this value, say ``self.config['foo'].get()`` at any point in your
344-
plugin's code. The `self.config` object is a *view* as defined by the `Confuse`_
345-
library.
345+
plugin's code. The ``self.config`` object is a *view* as defined by the
346+
`Confuse`_ library.
346347

347348
.. _Confuse: https://confuse.readthedocs.io/en/latest/
348349

349350
If you want to access configuration values *outside* of your plugin's section,
350-
import the `config` object from the `beets` module. That is, just put ``from
351+
import the ``config`` object from the ``beets`` module. That is, just put ``from
351352
beets import config`` at the top of your plugin and access values from there.
352353

353354
If your plugin provides configuration values for sensitive data (e.g.,
354355
passwords, API keys, ...), you should add these to the config so they can be
355356
redacted automatically when users dump their config. This can be done by
356-
setting each value's `redact` flag, like so::
357+
setting each value's ``redact`` flag, like so::
357358

358359
self.config['password'].redact = True
359360

@@ -541,11 +542,11 @@ should have an integer type::
541542
def album_types(self):
542543
return {'rating': types.INTEGER}
543544

544-
A plugin may define two attributes: `item_types` and `album_types`.
545+
A plugin may define two attributes: ``item_types`` and ``album_types``.
545546
Each of those attributes is a dictionary mapping a flexible field name
546547
to a type instance. You can find the built-in types in the
547-
`beets.dbcore.types` and `beets.library` modules or implement your own
548-
type by inheriting from the `Type` class.
548+
``beets.dbcore.types`` and ``beets.library`` modules or implement your own
549+
type by inheriting from the ``Type`` class.
549550

550551
Specifying types has several advantages:
551552

docs/guides/main.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ displayed in the results of a search::
291291
[MP3] For Emma, Forever Ago (2009) - Bon Iver - Flume
292292
[AAC] Freezepop Forever (2011) - Freezepop - Harebrained Scheme
293293

294-
In the format option, field references like `$format` and `$year` are filled
294+
In the format option, field references like ``$format`` and ``$year`` are filled
295295
in with data from each result. You can see a full list of available fields by
296296
running ``beet fields``.
297297

docs/plugins/autobpm.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
AutoBPM Plugin
22
==============
33

4-
The `autobpm` plugin uses the `Librosa`_ library to calculate the BPM
5-
of a track from its audio data and store it in the `bpm` field of your
4+
The ``autobpm`` plugin uses the `Librosa`_ library to calculate the BPM
5+
of a track from its audio data and store it in the ``bpm`` field of your
66
database. It does so automatically when importing music or through
77
the ``beet autobpm [QUERY]`` command.
88

@@ -26,7 +26,7 @@ configuration file. The available options are:
2626
Otherwise, you need to use the ``beet autobpm`` command explicitly.
2727
Default: ``yes``
2828
- **overwrite**: Calculate a BPM even for files that already have a
29-
`bpm` value.
29+
``bpm`` value.
3030
Default: ``no``.
3131
- **beat_track_kwargs**: Any extra keyword arguments that you would like to
3232
provide to librosa's `beat_track`_ function call, for example:

docs/plugins/badfiles.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Custom commands will be run once for each file of the specified type, with the
2626
path to the file as the last argument. Commands must return a status code
2727
greater than zero for a file to be considered corrupt.
2828

29-
You can run the checkers when importing files by using the `check_on_import`
29+
You can run the checkers when importing files by using the ``check_on_import``
3030
option. When on, checkers will be run against every imported file and warnings
3131
and errors will be presented when selecting a tagging option.
3232

docs/plugins/bucket.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ The available options are:
5252
fields.
5353
Default: none.
5454
- **bucket_alpha_regex**: A ``range: regex`` mapping (one per line) where
55-
``range`` is one of the `bucket_alpha` ranges and ``value`` is a regex that
55+
``range`` is one of the ``bucket_alpha`` ranges and ``value`` is a regex that
5656
overrides original range definition.
5757
Default: none.
5858
- **bucket_year**: Ranges to use for all substitutions occurring on the
@@ -72,6 +72,6 @@ Here's an example::
7272
bucket_alpha_regex:
7373
'A - D': ^[0-9a-dA-D…äÄ]
7474

75-
This configuration creates five-year ranges for any input year. The `A - D`
75+
This configuration creates five-year ranges for any input year. The ``A - D``
7676
bucket now matches also all artists starting with ä or Ä and 0 to 9 and …
7777
(ellipsis). The other alpha buckets work as ranges.

docs/plugins/convert.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ file. The available options are:
8484
defined in your config file.
8585
Default: ``no``.
8686

87-
.. note:: You probably want to use only one of the `auto` and `auto_keep`
87+
.. note:: You probably want to use only one of the ``auto`` and ``auto_keep``
8888
options, not both. Enabling both will convert your files twice on import,
8989
which you probably don't want.
9090

@@ -142,7 +142,7 @@ file. The available options are:
142142
after the transcoding step has completed.
143143
Default: ``false``.
144144
- **playlist**: The name of a playlist file that should be written on each run
145-
of the plugin. A relative file path (e.g `playlists/mylist.m3u8`) is allowed
145+
of the plugin. A relative file path (e.g ``playlists/mylist.m3u8``) is allowed
146146
as well. The final destination of the playlist file will always be relative
147147
to the destination path (``dest``, ``--dest``, ``-d``). This configuration is
148148
overridden by the ``-m`` (``--playlist``) command line option.
@@ -177,7 +177,7 @@ and select a command with the ``--format`` command-line option or the
177177
wav: ffmpeg -i $source -y -acodec pcm_s16le $dest
178178

179179
In this example ``beet convert`` will use the *speex* command by
180-
default. To convert the audio to `wav`, run ``beet convert -f wav``.
180+
default. To convert the audio to ``wav``, run ``beet convert -f wav``.
181181
This will also use the format key (``wav``) as the file extension.
182182

183183
Each entry in the ``formats`` map consists of a key (the name of the
@@ -189,7 +189,7 @@ command to use to transcode audio. The tokens ``$source`` and ``$dest`` in the
189189
command are replaced with the paths to the existing and new file.
190190

191191
The plugin in comes with default commands for the most common audio
192-
formats: `mp3`, `alac`, `flac`, `aac`, `opus`, `ogg`, `wma`. For
192+
formats: ``mp3``, ``alac``, ``flac``, ``aac``, ``opus``, ``ogg``, ``wma``. For
193193
details have a look at the output of ``beet config -d``.
194194

195195
For a one-command-fits-all solution use the ``convert.command`` and

docs/plugins/export.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ key:
6464

6565
- **delimiter**: Used as the separating character between fields. The default
6666
value is a comma (,).
67-
- **dialect**: The kind of CSV file to produce. The default is `excel`.
67+
- **dialect**: The kind of CSV file to produce. The default is ``excel``.
6868

6969
These options match the options from the `Python csv module`_.
7070

docs/plugins/fetchart.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ file. The available options are:
6363
still be considered valid. This can be done either in pixels
6464
(``enforce_ratio: 10px``) or as a percentage of the longer edge
6565
(``enforce_ratio: 0.5%``). Default: ``no``.
66-
- **sources**: List of sources to search for images. An asterisk `*` expands
66+
- **sources**: List of sources to search for images. An asterisk ``*`` expands
6767
to all available sources.
6868
Default: ``filesystem coverart itunes amazon albumart``, i.e., everything but
6969
``wikipedia``, ``google``, ``fanarttv`` and ``lastfm``. Enable those sources
@@ -268,19 +268,19 @@ Spotify album id is found.
268268
Cover Art URL
269269
'''''''''''''
270270

271-
The `fetchart` plugin can also use a flexible attribute field ``cover_art_url``
272-
where you can manually specify the image URL to be used as cover art. Any custom
273-
plugin can use this field to provide the cover art and ``fetchart`` will use it
274-
as a source.
271+
The ``fetchart`` plugin can also use a flexible attribute field
272+
``cover_art_url`` where you can manually specify the image URL to be used as
273+
cover art. Any custom plugin can use this field to provide the cover art and
274+
``fetchart`` will use it as a source.
275275

276276
.. _cover-art-archive-maxwidth:
277277

278278
Cover Art Archive Pre-sized Thumbnails
279279
--------------------------------------
280280

281281
The CAA provides pre-sized thumbnails of width 250, 500, and 1200 pixels. If you
282-
set the `maxwidth` option to one of these values, the corresponding image will
283-
be downloaded, saving `beets` the need to scale down the image. It can also
282+
set the ``maxwidth`` option to one of these values, the corresponding image will
283+
be downloaded, saving ``beets`` the need to scale down the image. It can also
284284
speed up the downloading process, as some cover arts can sometimes be very
285285
large.
286286

docs/plugins/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ Metadata
212212

213213
:doc:`importadded <importadded>`
214214
Use file modification times for guessing the value for
215-
the `added` field in the database.
215+
the ``added`` field in the database.
216216

217217
:doc:`lastgenre <lastgenre>`
218218
Fetch genres based on Last.fm tags.
@@ -484,7 +484,7 @@ Here are a few of the plugins written by the beets community:
484484

485485
`beets-filetote`_
486486
Helps bring non-music extra files, attachments, and artifacts during
487-
imports and CLI file manipulation actions (`beet move`, etc.).
487+
imports and CLI file manipulation actions (``beet move``, etc.).
488488

489489
`beets-follow`_
490490
Lets you check for new albums from artists you like.

0 commit comments

Comments
 (0)