-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -628,19 +628,6 @@ img { | |
} | ||
} | ||
|
||
|
||
/* ----------------------------------------- | ||
Dartpad | ||
----------------------------------------- */ | ||
|
||
#run-dartpad { | ||
position: relative; | ||
padding: 15px 0; | ||
background: $gray-light; | ||
border-top: 1px solid $gray; | ||
z-index: 5; | ||
} | ||
|
||
Comment on lines
-631
to
-643
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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). |
||
/* ----------------------------------------- | ||
Search | ||
----------------------------------------- */ | ||
|
@@ -815,51 +802,6 @@ main .content { | |
border-radius: 8px; | ||
} | ||
|
||
.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; | ||
} | ||
} | ||
|
||
Comment on lines
-818
to
-862
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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). |
||
// Columns | ||
.col2 { | ||
list-style: none; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,36 +7,43 @@ nextpage: | |
prevpage: | ||
url: /tutorials/server | ||
title: Dart command-line and server tutorials | ||
js: [{url: https://dartpad.dev/experimental/inject_embed.dart.js, defer: true}] | ||
--- | ||
|
||
Follow these steps to start using the Dart SDK to develop command-line and server apps. | ||
First you’ll play with the Dart language and libraries in your browser, no download required. | ||
First you’ll play with the Dart language in your browser, no download required. | ||
Then you’ll install the Dart SDK, write a small program, and run that program using the Dart VM. | ||
Finally, you'll use an AOT (_ahead of time_) compiler to compile your finished program to native machine code, | ||
which you'll execute using the Dart runtime. | ||
|
||
## 1. Play with Dart code in DartPad | ||
|
||
With DartPad you can experiment with the Dart language and APIs, | ||
no download necessary. | ||
With [DartPad](/tools/dartpad) you can experiment with the Dart language and | ||
APIs, no download necessary. | ||
|
||
For example, here's an embedded DartPad that lets you play with the code for a | ||
small Hello World program. Click **Run** to run the app; the console output | ||
appears beneath the code. Try editing the source code—perhaps you'd like to | ||
change the greeting to use another language. To get the full DartPad experience, | ||
<a href="{{site.dartpad}}/27e044ec9e2957d9c5c7062871ce8bf3" target="_blank">open | ||
the example at dartpad.dev.</a> | ||
small Hello World program. Click **Run** to run the app; output appears in the | ||
console view. Try editing the source code — perhaps you'd like to change the | ||
greeting to use another language. | ||
|
||
{{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%; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. See #2097 |
||
} | ||
</style> | ||
Comment on lines
+33
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. SGTM |
||
|
||
<?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 commentThe reason will be displayed to describe this comment to others. Learn more. @johnpryan, FYI, I'm keeping the language as It seems that There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
void main() { | ||
print('Hello, World!'); | ||
} | ||
``` | ||
|
||
More information: | ||
|
||
|
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).