Skip to content

Update Attribute to include "Type" and "Defalut value" as children - #5439

Open
eharvey328 wants to merge 20 commits into
mainfrom
emh/refactor-attributes
Open

Update Attribute to include "Type" and "Defalut value" as children#5439
eharvey328 wants to merge 20 commits into
mainfrom
emh/refactor-attributes

Conversation

@eharvey328

@eharvey328 eharvey328 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor
  • removes attributeTypeHint and attributeTypeHintHref props on Attribute mdx component.

    • now the type and default value are added to the body as markdown to be parsed in docs
    • allows multiple types with multiple links this way (e.g., method: QiskitType | dict[Qiskititem] | None)
    • this also makes it so hrefs get automatically transformed by the pipeline since they are no longer a prop string
  • did not implement an ignore list for links to python standard types because these links are already display in other places in the docs. If we want we can handle in a follow up.

@eharvey328
eharvey328 marked this pull request as ready for review August 6, 2026 14:18
@eharvey328 eharvey328 changed the title refactor attributes Update Attribute to include "Type" and "Defalut value" as children Aug 6, 2026
axelhzf
axelhzf previously approved these changes Aug 12, 2026
@eharvey328

eharvey328 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@axelhzf I got the inline-code styling to work

The challenge is the source does not output these as inline-code blocks so we have to add them somewhere.
But we can't just wrap the entire thing because we lose the links

`[Value](href) | [Another](href)` // links becomes a string

We need to parse each token individually:

[`Value`](href) | [`Another`](href)

That works for the type, but default value can have complex values with spaces and chars:

Default value:  \<default case>

Since this represents a value, it is safe to assume there won't be any type def links. So we can wrap the whole thing in a code block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants