Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support specifying attributes to DartPad #5884

Merged
merged 1 commit into from
May 30, 2024

Conversation

parlough
Copy link
Member

Enables the mechanism for adding a title attribute to DartPad code blocks.

```dartpad run="true" title="The classic hello world program in Dart!" theme="dark"
void main() {
  print('Hello world!');
}
```

Contributes to #5251

@atsansone After this lands, feel free to add titles to the embedded DartPads. I'd be happy to review!

@parlough parlough added the review.tech Awaiting Technical Review label May 29, 2024
@parlough parlough requested a review from atsansone May 29, 2024 23:24
@dart-github-bot
Copy link
Collaborator

Visit the preview URL for this PR (updated for commit 42287ec):

https://dart-dev--pr5884-feat-support-specifiying-dartpad-attr-sv5ci0mm.web.app

Copy link
Contributor

@atsansone atsansone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % 2 questions:

  1. Why do we not set height on DartPad includes any more?
  2. Why default to light theme?

@atsansone atsansone added st.RFM.% Ready to Merge but has suggestions and removed review.tech Awaiting Technical Review labels May 30, 2024
@atsansone atsansone assigned parlough and unassigned atsansone May 30, 2024
@parlough
Copy link
Member Author

parlough commented May 30, 2024

Thanks for the review and questions @atsansone!

  1. Why do we not set height on DartPad includes any more?

The new embed mechanism hasn't supported it, so removing the mentions to avoid misconceptions that it is supported. A lot of them time, they run-dartpad portions were copied from elsewhere without paying too much attention I think. If there's a strong desire to bring height adjustment back, open an issue, and I can definitely do so!

  1. Why default to light theme?

That's just what we've always done for embeds since the site body is light theme. Then in codelabs, dark theme indicates it's a conclusion exercise.

@parlough parlough merged commit e0ff483 into main May 30, 2024
10 checks passed
@parlough parlough deleted the feat/support-specifiying-dartpad-attributes branch May 30, 2024 21:03
@parlough parlough removed the st.RFM.% Ready to Merge but has suggestions label May 30, 2024
@parlough parlough removed their assignment May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants