-
Notifications
You must be signed in to change notification settings - Fork 700
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
Server > Get Started: use tested sources for DartPad Hello World #2092
Conversation
|
||
/* Hide "Open Dartpad" link */ | ||
.run-in-dartpad { | ||
display: none; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This CSS class was introduced July 11, 2016, Migrating repo from Ocupop. AFAICT, since the Dash migration, this style isn't used anymore (I've checked the site sources and the generated site).
|
||
/* ----------------------------------------- | ||
Dartpad | ||
----------------------------------------- */ | ||
|
||
#run-dartpad { | ||
position: relative; | ||
padding: 15px 0; | ||
background: $gray-light; | ||
border-top: 1px solid $gray; | ||
z-index: 5; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This CSS class was introduced July 11, 2016, Migrating repo from Ocupop. AFAICT, since the Dash migration, this style isn't used anymore (I've checked the site sources and the generated site).
.codesample__open-in-dartpad { | ||
display: block; | ||
position: absolute; | ||
width: auto; | ||
z-index: 10; | ||
padding: 5px 10px 5px 35px; | ||
top: 35px; | ||
right: 38px; | ||
background-color: $gray; | ||
color: $gray-base; | ||
|
||
font-weight: normal; | ||
font-size: $font-size-base * 0.91; | ||
@include media-breakpoint-up(md) { | ||
font-size: $font-size-base * 0.8; | ||
} | ||
@include media-breakpoint-up(lg) { | ||
font-size: $font-size-base * 0.91; | ||
} | ||
|
||
&.top { | ||
top: 0; | ||
} | ||
&:visited, &:active { | ||
color: $gray-base; | ||
} | ||
&:hover { | ||
background-color: darken($gray, 10%); | ||
color: $white-base; | ||
} | ||
&:after { | ||
content: ''; | ||
display: block; | ||
position: absolute; | ||
top: 5px; | ||
left: 10px; | ||
width: 18px; | ||
height: 18px; | ||
background-image: asset_url('shared/dart/logo/default.svg'); | ||
background-size: cover; | ||
background-position: center center; | ||
background-repeat: no-repeat; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This CSS class was introduced July 11, 2016, Migrating repo from Ocupop. AFAICT, since the Dash migration, this style isn't used anymore (I've checked the site sources and the generated site).
<style> | ||
iframe[src^="https://dartpad"] { | ||
border: 1px solid #ccc; | ||
margin-bottom: 1rem; | ||
width: 100%; | ||
} | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we like this approach (of initializing DartPads from code excerpts rather than Gists), then I'll move this style definition into an appropriate SCSS file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
</style> | ||
|
||
<?code-excerpt "misc/test/samples_test.dart (hello-world)"?> | ||
```dart:run-dartpad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnpryan, FYI, I'm keeping the language as dart
because it allows IDEs etc to continue pretty-printing the code as Dart code:
It seems that inject_embed.dart
is ok with class="language-dart:run-dartpad"
instead of class="language-run-dartpad"
, as is document in https://github.com/dart-lang/dart-pad/wiki/Embedding-Guide#converting-code-blocks-to-dartpad. Maybe that wiki page entry could be updated?
</style> | ||
|
||
<?code-excerpt "misc/test/samples_test.dart (hello-world)"?> | ||
```dart:run-dartpad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kwalrath - I switched to using the default mode-dart rather than mode-inline because the default mode look slightly better on desktop and looks no worse on mobile.
iframe[src^="https://dartpad"] { | ||
border: 1px solid #ccc; | ||
margin-bottom: 1rem; | ||
width: 100%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would vote to make this just a little bit taller (maybe 200px-400px) to encourage people try things out. We are adding a feature very soon to support this, but right now we might want to set a min-height
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you've both approved this PR, I'll merge it as is. I'll address the min height in a followup PR.
@kwalrath - what are your feelings about the DartPad height for this sample?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to increase the height.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #2097
<style> | ||
iframe[src^="https://dartpad"] { | ||
border: 1px solid #ccc; | ||
margin-bottom: 1rem; | ||
width: 100%; | ||
} | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me!
LGTM |
I like that idea. I don't think there's an issue for that yet.
…On Thu, Nov 14, 2019 at 10:09 AM Patrice Chalin ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/_tutorials/server/get-started.md
<#2092 (comment)>:
>
{{site.alert.note}}
{% include dartpad-embedded-troubleshooting.md %}
{{site.alert.end}}
-<iframe
- src="{{site.dartpad-embed-inline}}?id=27e044ec9e2957d9c5c7062871ce8bf3"
- width="100%"
- height="300px"
- style="border: 1px solid #ccc;">
-</iframe>
+<style>
+iframe[src^="https://dartpad"] {
+ border: 1px solid #ccc;
+ margin-bottom: 1rem;
+ width: 100%;
What would be really nice would be to have a "grow frame" button at the
bottom-right, just like GitHub comment boxes have:
[image: Screen Shot 2019-11-14 at 13 06 44]
<https://user-images.githubusercontent.com/4140793/68883760-ae4d5a00-06df-11ea-9994-b771f8d9dd8e.png>
WDYT? (Is there an issue / feature request open for this already? If not,
would you like for me to open one?)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2092?email_source=notifications&email_token=AAIXW565YCZPIUUQRQYQMXTQTWH5PA5CNFSM4JNPIZCKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCLTWXJI#discussion_r346466134>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIXW5ZRQFIBNTCKZDYUWELQTWH5PANCNFSM4JNPIZCA>
.
|
Thanks for the reviews. Travis is green, merging. |
Contributes to #1803 by replacing a Gist-based DartPad with a DartPad initialized from an analyzed and tested code excerpt from our examples folder.
Notes:
const
.Followup to #1921
Related to #1919
Staged
https://dart-dev-staging-1.firebaseapp.com/tutorials/server/get-started
Screen shot
cc @johnpryan @legalcodes @RedBrogdon