Docs: a module docstring does not become the button tooltip
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- documentation
Research direction
Read the three named targets: docs/build-extensions/scripting/ironpython.md, docs/build-extensions/tutorials/first-command.md, and pyrevitlib/pyrevit/agent/skills/extension-authoring/SKILL.md. Update each to explain that ribbon tooltips come from tooltip in bundle.yaml, and preserve the stated legacy status of __doc__ where relevant. Done when the docstring tooltip claim and example are removed and the tutorial includes the bundle.yaml step and folder tree entry.
Written by the indexing model from the issue text.
Description
Summary
The docs and the extension-authoring agent skill say that a script's module docstring becomes the button tooltip. The C# extension parser does not read it. ParseScriptConstants in ExtensionParser.cs takes an in-script tooltip only from a __doc__ assignment, and TooltipManager.BuildButtonTooltip has no docstring fallback.
The suggestion is to correct the docs, not add the fallback. #3657 tracks dropping inline metadata, so new tooltip text belongs in bundle.yaml.
Steps to reproduce
Checked on develop at ae79903e0 with the extension parser (no Revit needed).
- Create a
.pushbuttonwith nobundle.yaml, whosescript.pyhas only a module docstring:"""Calculates total volume of all walls in the model.""" - Parse the extension with the C# parser and read the button's tooltip.
Expected (according to the docs)
The tooltip is the docstring.
Actual
The parsed tooltip is empty. From the code, the ribbon tooltip would then show only the bundle name and any authors. I did not check this by hovering the button in Revit.
The Python parser (pyrevitlib/pyrevit/extensions/genericcomps.py) still falls back to the docstring, but the ribbon tooltip comes from the C# parser.
Suggested change
docs/build-extensions/scripting/ironpython.md, "DocString (Tooltip)":- Remove the claim and the example for the docstring as tooltip.
- Show
tooltip:inbundle.yamlas the way to set it. - If
__doc__stays documented, mark it as legacy inline metadata. It is still read while "Read script metadata" is on.
docs/build-extensions/tutorials/first-command.md:- Keep the explanation of what a docstring is, but remove "pyRevit places this string inside the button tooltip".
- Add a short step that creates a
bundle.yamlwith the tooltip, and add that file to the folder tree that holdsscript.pyandicon.png:tooltip: Calculates total volume of all walls in the model.
pyrevitlib/pyrevit/agent/skills/extension-authoring/SKILL.md: replace "A module docstring at the top ofscript.pycan become the button's tooltip, so keep it the same astooltipinbundle.yaml" with a statement that the docstring is not shown on the ribbon and that the tooltip is set withtooltipinbundle.yaml.
Shipped buttons affected
A static scan found 54 of 361 shipped script buttons with a module docstring, but no __doc__ line and no tooltip: in bundle.yaml:
- 49 in
pyRevitDevTools - 5 in
pyRevitTutor - none in the other shipped extensions
Correcting the docs does not give these buttons a tooltip. Where one is wanted, the docstring text can be copied to tooltip: in bundle.yaml, in the same PR or a follow-up.
Not proposed
Reading the module docstring in the C# parser. It would add another way to define metadata in the script while #3657 aims to remove that.
Related: #3657
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 514
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 245
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pyrevitlabs/pyRevit
-
Text differences between engines: float precision and IronPython 2.7 mojibakePossibly taken A pull request linked to this issue is open or already merged. OpenBug IronPython Python 3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pyrevitlabs/pyRevit#4184 ·
Maintainers usually reply within 1 day
-
Python 3 test-infra
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
pyrevitlabs/pyRevit#4159 ·
Maintainers usually reply within 1 day
-
Documentation Python 3
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
pyrevitlabs/pyRevit#4158 ·
Maintainers usually reply within 1 day
-
Consider replacing personal references with `pyrevitlabs` org brandingMay be free again @rajmodi8905 claimed this 50 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
pyrevitlabs/pyRevit#3730 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 Half a day Newbie friendliness 72/100
pyrevitlabs/pyRevit#4279 · 2 comments ·
Maintainers usually reply within 1 day
All issues in pyrevitlabs/pyRevit
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
521xueweihan/HelloGitHub#4574 ·
-
Adopt pr-gate v3.3.0Openarea: ci enhancement perceived difficulty: 1
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Nitjsefnie-Harness-Commons/daedalus#1859 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 3 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
meetecho/juturna_nodes#43 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
TigreGotico/text2spoken#726 ·
Maintainers usually reply within 1 day