From c1649b4fb2213252db4e0e6b825fe51c196e8bd6 Mon Sep 17 00:00:00 2001 From: Greg Wilson Date: Tue, 15 Jul 2025 12:22:02 -0400 Subject: [PATCH 1/2] Small changes to JavaScript documentation formatting to help Python Markdown. - Put back-quotes around HTML tags in `src/components/annotations/attributes.js` so that they are not interpreted literally in Python Markdown documentation. - Fix mis-matched asterisk and back-quote in `src/components/errorbars/attributes.js`. - Format comparison operators and interval operators in `src/traces/contour/attributes.js` as back-quoted text so that angle brackets and square brackets don't confuse Markdown formatting in Python documentation. --- src/components/annotations/attributes.js | 6 +++--- src/components/errorbars/attributes.js | 2 +- src/traces/contour/attributes.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/annotations/attributes.js b/src/components/annotations/attributes.js index 45005977486..9dfb760d681 100644 --- a/src/components/annotations/attributes.js +++ b/src/components/annotations/attributes.js @@ -49,9 +49,9 @@ module.exports = templatedArray('annotation', { description: [ 'Sets the text associated with this annotation.', 'Plotly uses a subset of HTML tags to do things like', - 'newline (
), bold (), italics (),', - 'hyperlinks (). Tags , , , , ', - ' are also supported.' + 'newline (`
`), bold (``), italics (``),', + 'hyperlinks (``). Tags ``, ``,', + '``, ``, ``, and `` are also supported.' ].join(' ') }, textangle: { diff --git a/src/components/errorbars/attributes.js b/src/components/errorbars/attributes.js index d564fe00562..bd57eb82e40 100644 --- a/src/components/errorbars/attributes.js +++ b/src/components/errorbars/attributes.js @@ -16,7 +16,7 @@ module.exports = { description: [ 'Determines the rule used to generate the error bars.', - 'If *constant`, the bar lengths are of a constant value.', + 'If *constant*, the bar lengths are of a constant value.', 'Set this constant in `value`.', 'If *percent*, the bar lengths correspond to a percentage of', diff --git a/src/traces/contour/attributes.js b/src/traces/contour/attributes.js index 3562a98c641..191cfa7f17c 100644 --- a/src/traces/contour/attributes.js +++ b/src/traces/contour/attributes.js @@ -226,11 +226,11 @@ module.exports = extendFlat({ 'Sets the value or values of the constraint boundary.', 'When `operation` is set to one of the comparison values', - '(' + COMPARISON_OPS2 + ')', + '(`' + COMPARISON_OPS2 + '`)', '*value* is expected to be a number.', 'When `operation` is set to one of the interval values', - '(' + INTERVAL_OPS + ')', + '(`' + INTERVAL_OPS + '`)', '*value* is expected to be an array of two numbers where the first', 'is the lower bound and the second is the upper bound.', ].join(' ') From c4aee249db2ffc21f99493d6a5698c3afb0721d7 Mon Sep 17 00:00:00 2001 From: Ya-Fan Chen Date: Sat, 7 Dec 2024 19:35:39 +0100 Subject: [PATCH 2/2] Update template_attributes.js Correct wrong description of hovertemplate regarding the use of tag `` --- src/plots/template_attributes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plots/template_attributes.js b/src/plots/template_attributes.js index 9f01f920688..1daa3f77edd 100644 --- a/src/plots/template_attributes.js +++ b/src/plots/template_attributes.js @@ -75,7 +75,7 @@ exports.hovertemplateAttrs = function(opts, extra) { 'The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data.', 'Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available.', descPart, - 'Anything contained in tag `` is displayed in the secondary box, for example "{fullData.name}".', + 'Anything contained in tag `` is displayed in the secondary box, for example `%{fullData.name}`.', 'To hide the secondary box completely, use an empty tag ``.' ].join(' ') };