@@ -234,50 +234,43 @@ calling `setup_figure`.
234234
235235### Extra tracking
236236
237- This is a comma-separated list of extra libraries to install file tracking on.
238- See the [ file tracking] ( file_tracking.md ) documentation for more details.
237+ This is an array of strings naming extra libraries to install file tracking on. See the
238+ [ file tracking] ( file_tracking.md ) documentation for more details.
239239
240240
241241### Environment variables
242242
243- Environment variables to set can be specified using the multi-line option
244- `` environment `` . Each line represents one environment variable in the format
245- `` name = value `` :
243+ Environment variables to set can be specified using the table option ` environment ` . Each
244+ entry represents one environment variable:
246245
247246``` toml
248247[pgfutils ]
249- environment = '''
250- name1 = "value1"
251- name2 = "value2"
252- '''
248+ environment = {name1 = " value1" , name2 = " value2" }
253249```
254250
255- Existing environment variables of the same name will be overwritten. This means that if
256- you specify the same variable multiple times the last value will be used. For example,
257- the configuration
251+ TOML requires inline tables as used in the previous example to be on a single line. If
252+ you prefer to split this over multiple lines, you can make ` environment ` an explicit
253+ table:
258254
259255``` toml
260- [pgfutils ]
261- environment = '''
262- name1 = "value1"
263- name2 = "value2"
264- name1 = "value3"
265- '''
256+ [pgfutils .environment ]
257+ name1 = " value1"
258+ name2 = " value2"
266259```
267260
268- will result in ` name1 ` being set to ` value3 ` . The variables are set during the call to
269- ` setup_figure() ` , so any libraries that read the environment variables must be imported
270- after this call.
261+ Existing environment variables of the same name will be overwritten. This means that
262+ environment variables given in the configuration file will override existing values, and
263+ that environment variables given in the ` setup_figure ` call will override values from
264+ the configuration file. The variables are set during the call to ` setup_figure() ` , so
265+ any libraries that read the environment variables must be imported after this call.
271266
272267Note that the ` PGFUTILS_TRACK_FILES ` variable described in the [ file tracking
273268documentation] ( file_tracking.md ) can be configured through this option, for example to
274269output tracked files to stdout:
275270
276271``` toml
277272[pgfutils ]
278- environment = '''
279- PGFUTILS_TRACK_FILES = "1"
280- '''
273+ environment = {PGFUTILS_TRACK_FILES = " 1" }
281274```
282275
283276
@@ -288,49 +281,49 @@ it is a dependency. If it is in one of the directories given under the `data` ke
288281any subdirectory of one of these directories, then it is counted as a dependency. The
289282top-level directory (the directory the script was run from) is always included as a data
290283directory, so you only need to specify directories outside the top-level directory.
291- Multiple entries must be specified on separate lines of the configuration .
284+ These paths must be given as an array of strings, each corresponding to one path .
292285
293286``` toml
294287[paths ]
295- data = '''
296- /data/common
297- '''
288+ data = [
289+ ' /data/common'
290+ ]
298291```
299292
300293Note that these directories are not added to any kind of search path, so any
301294code which uses them still has to give a complete path.
302295
303- If you have Python code in other libraries you want to be able to import in
304- your scripts, you can use the ` pythonpath ` option in the ` paths ` section of the
305- configuration file to specify custom search paths for Python. This is a
306- multi-line entry with one path per line. The paths are inserted at the start
307- of ` sys.path ` when you call ` setup_figure() ` . They are inserted in the order
308- given in the configuration, which means the last path in the configuration will
309- be the first entry in ` sys.path ` . They are not modified or checked in any way.
310- Relative paths will therefore be interpreted by Python as being relative to the
311- directory it was run from, which should be the top-level directory of your
312- project.
296+ If you have Python code in other libraries you want to be able to import in your
297+ scripts, you can use the ` pythonpath ` option in the ` paths ` section of the configuration
298+ file to specify custom search paths for Python. This is an array of strings, each
299+ corresponding to one path entry. The paths are inserted at the start of ` sys.path ` when
300+ you call ` setup_figure() ` . They are inserted in the order given in the configuration,
301+ which means the last path in the configuration will be the first entry in ` sys.path ` .
302+ They are not modified or checked in any way. Relative paths will therefore be
303+ interpreted by Python as being relative to the directory it was run from, which should
304+ be the top-level directory of your project.
313305
314306``` toml
315307[paths ]
316- pythonpath = '''
317- pythonlib/
318- /usr/share/myotherlib
319- '''
308+ pythonpath = [
309+ ' pythonlib/' ,
310+ ' /usr/share/myotherlib' ,
311+ ]
320312```
321313
322314Python imports can also be handled by the [ file tracking] ( file_tracking.md ) . If
323315enabled, any library imported from a directory (or subdirectory) specified in
324316the ` pythonpath ` option is treated as a dependency and output as part of the
325317file tracking details. If you have other libraries which are already in the
326318Python path which you want to be tracked as dependencies, you can add the
327- appropriate directories to the ` extra_imports ` option:
319+ appropriate directories to the ` extra_imports ` option. As with the other path settings,
320+ this must be an array of strings, each corresponding to a single path.
328321
329322``` toml
330323[paths ]
331- extra_imports = '''
332- /home/username/.local/lib/
333- '''
324+ extra_imports = [
325+ ' /home/username/.local/lib/'
326+ ]
334327```
335328
336329
@@ -339,10 +332,10 @@ Matplotlib rcParams
339332
340333Matplotlib can be customised using its [ rcParams] [ ] system (this is how pgfutils does
341334much of its setup). If you want to override rcParams settings, you can specify them in
342- the ` rcParams ` section:
335+ the ` rcparams ` section:
343336
344337``` toml
345- [rcParams ]
338+ [rcparams ]
346339"figure.facecolor" = " blue"
347340"xtick.labelsize" = 8
348341```
0 commit comments