|
19 | 19 | TITLE_RE = re.compile(r"<h2>.+?<code>(.+?)</code>.*</h2>")
|
20 | 20 |
|
21 | 21 |
|
| 22 | +PLOT_SCHEMA_METADATA = """\ |
| 23 | +--- |
| 24 | +trace_name: {trace_name} |
| 25 | +--- |
| 26 | +
|
| 27 | +""" |
| 28 | + |
22 | 29 | PLOT_SCHEMA_CONTENT = """\
|
23 | 30 | <div class="description">
|
24 | 31 | A <code>{trace_name}</code> trace is an object with the key <code>"type"</code> equal to <code>"{trace_data_attributes_type}"</code>
|
@@ -237,7 +244,7 @@ def _reference_block_valtype(src_path, accum, key, value):
|
237 | 244 | accum.append(f" or array of {_get(value, 'valType')}s\n")
|
238 | 245 | accum.append(f"{inner}, one of (\n")
|
239 | 246 | for i, sub_value in enumerate(_get(value, "values")):
|
240 |
| - _comma(accum, i, "|") |
| 247 | + _comma(accum, i, " | ") |
241 | 248 | accum.append(f"<code>{_bool_or_star(sub_value)}</code>")
|
242 | 249 | accum.append(f"{inner})\n")
|
243 | 250 |
|
@@ -380,12 +387,15 @@ def _reference_block_object(
|
380 | 387 |
|
381 | 388 | def _reference_trace(args, schema, src_path, trace_name, trace_data):
|
382 | 389 | """Generate HTML documentation for a trace."""
|
| 390 | + plot_schema_metadata = PLOT_SCHEMA_METADATA.format( |
| 391 | + trace_name=trace_name, |
| 392 | + ) |
383 | 393 | plot_schema_content = PLOT_SCHEMA_CONTENT.format(
|
384 | 394 | trace_name=trace_name,
|
385 | 395 | trace_data_attributes_type=trace_data["attributes"]["type"],
|
386 | 396 | trace_data_meta_description=trace_data["meta"]["description"],
|
387 | 397 | )
|
388 |
| - accum = [plot_schema_content] |
| 398 | + accum = [plot_schema_metadata, plot_schema_content] |
389 | 399 |
|
390 | 400 | parent_link = trace_name
|
391 | 401 | parent_path = f"data[type={trace_name}]"
|
|
0 commit comments