This repository has been archived by the owner. It is now read-only.

Update the html to match the latest code #45

Merged
merged 5 commits into from Mar 6, 2014

Conversation

Projects
None yet
2 participants
@vicb
Contributor

vicb commented Mar 4, 2014

see it online @ http://vicb-angulardart.appspot.com/

The first commit has the kind of magics I like: it allows anybody to easily update the code in the html (ie it removes the burden of having to escape the HTML entities).

The second commit is the "real" update. Hopefully I haven't miss anything... anyway it's now much easier for anybody to update.

@kwalrath

This comment has been minimized.

Show comment Hide comment
@kwalrath

kwalrath Mar 4, 2014

Contributor

I took a quick look, and noticed that in http://vicb-angulardart.appspot.com/tutorial/03-ch01-creating-your-first-app.html, the "two" script tags (which are 3 in https://angulardart.org/tutorial/03-ch01-creating-your-first-app.html, oops) are just 1:

<script src="packages/shadow_dom/shadow_dom.min.js">

The application/dart and text/javascript tags are missing. So it looks like the new script doesn't deal with <script> tags properly. I'm guessing the </script> tag from the first line ended the <pre>-equivalent section.

Even before I found that it made me a bit nervous to use a <script> tag to mark <pre>-equivalent sections. Is this technique used anywhere else?

Contributor

kwalrath commented Mar 4, 2014

I took a quick look, and noticed that in http://vicb-angulardart.appspot.com/tutorial/03-ch01-creating-your-first-app.html, the "two" script tags (which are 3 in https://angulardart.org/tutorial/03-ch01-creating-your-first-app.html, oops) are just 1:

<script src="packages/shadow_dom/shadow_dom.min.js">

The application/dart and text/javascript tags are missing. So it looks like the new script doesn't deal with <script> tags properly. I'm guessing the </script> tag from the first line ended the <pre>-equivalent section.

Even before I found that it made me a bit nervous to use a <script> tag to mark <pre>-equivalent sections. Is this technique used anywhere else?

@kwalrath

This comment has been minimized.

Show comment Hide comment
@kwalrath

kwalrath Mar 4, 2014

Contributor

PS: This is very cool work, and anything that makes it easier to update code samples is a good thing!

Contributor

kwalrath commented Mar 4, 2014

PS: This is very cool work, and anything that makes it easier to update code samples is a good thing!

@vicb

This comment has been minimized.

Show comment Hide comment
@vicb

vicb Mar 4, 2014

Contributor

about the script technique don't worry, John Resig (the creator of jQuery) was one of the first to promote this: http://ejohn.org/blog/javascript-micro-templating/.

You are right on the fact that <script> tags could not be nested... one solution could be to replace them by [script] - can not think of anything better at the time.

Contributor

vicb commented Mar 4, 2014

about the script technique don't worry, John Resig (the creator of jQuery) was one of the first to promote this: http://ejohn.org/blog/javascript-micro-templating/.

You are right on the fact that <script> tags could not be nested... one solution could be to replace them by [script] - can not think of anything better at the time.

@kwalrath

This comment has been minimized.

Show comment Hide comment
@kwalrath

kwalrath Mar 4, 2014

Contributor

We could also leave <script> tags in <pre>. (Either way, we should have a helpful comment for future editors, so they don't break this in the future.)

Contributor

kwalrath commented Mar 4, 2014

We could also leave <script> tags in <pre>. (Either way, we should have a helpful comment for future editors, so they don't break this in the future.)

@kwalrath

This comment has been minimized.

Show comment Hide comment
@kwalrath

kwalrath Mar 4, 2014

Contributor

PS: That link does make me feel better about using <script> in this way. :)

Contributor

kwalrath commented Mar 4, 2014

PS: That link does make me feel better about using <script> in this way. :)

@vicb

This comment has been minimized.

Show comment Hide comment
@vicb

vicb Mar 4, 2014

Contributor

We could also leave <script> tags in <pre>

Simple is great! I'll update for this tomorrow (provided we are not using other scripts tags somewhere else)

Contributor

vicb commented Mar 4, 2014

We could also leave <script> tags in <pre>

Simple is great! I'll update for this tomorrow (provided we are not using other scripts tags somewhere else)

@kwalrath

This comment has been minimized.

Show comment Hide comment
@kwalrath

kwalrath Mar 4, 2014

Contributor

It looks like only ch01 & ch07 have <script> tags in the code snippets.

Contributor

kwalrath commented Mar 4, 2014

It looks like only ch01 & ch07 have <script> tags in the code snippets.

@vicb

This comment has been minimized.

Show comment Hide comment
@vicb

vicb Mar 5, 2014

Contributor

thanks for the hint, changes commited.

Contributor

vicb commented Mar 5, 2014

thanks for the hint, changes commited.

@kwalrath

This comment has been minimized.

Show comment Hide comment
@kwalrath

kwalrath Mar 5, 2014

Contributor

Could you update http://vicb-angulardart.appspot.com/ so I can do a visual diff? Thanks!

Contributor

kwalrath commented Mar 5, 2014

Could you update http://vicb-angulardart.appspot.com/ so I can do a visual diff? Thanks!

@vicb

This comment has been minimized.

Show comment Hide comment
@vicb

vicb Mar 5, 2014

Contributor

it's live now

Contributor

vicb commented Mar 5, 2014

it's live now

@kwalrath

This comment has been minimized.

Show comment Hide comment
@kwalrath

kwalrath Mar 5, 2014

Contributor

In http://vicb-angulardart.appspot.com/tutorial/07-ch05-filter-service.html I happened to notice a couple of code snippets (inside the "Built in filters" section) that don't have enough space above them. E.g., the upper border of the snippet that starts <input id="name-filter" type = "text" is right up against the last line of the previous paragraph. The same is true of the next snippet.

This doesn't happen everywhere, but where it does, it's much more noticeable when the last line of the previous paragraph contains some code font. E.g., I didn't notice this problem above String nameFilterString = ""; but upon closer inspection that snippet has too little space above it.

Perhaps you removed a line above these snippets? Or is there a style change we need to make?

Oh, and... This is new to your version. (I was visually comparing with the old version.)

Contributor

kwalrath commented Mar 5, 2014

In http://vicb-angulardart.appspot.com/tutorial/07-ch05-filter-service.html I happened to notice a couple of code snippets (inside the "Built in filters" section) that don't have enough space above them. E.g., the upper border of the snippet that starts <input id="name-filter" type = "text" is right up against the last line of the previous paragraph. The same is true of the next snippet.

This doesn't happen everywhere, but where it does, it's much more noticeable when the last line of the previous paragraph contains some code font. E.g., I didn't notice this problem above String nameFilterString = ""; but upon closer inspection that snippet has too little space above it.

Perhaps you removed a line above these snippets? Or is there a style change we need to make?

Oh, and... This is new to your version. (I was visually comparing with the old version.)

@vicb

This comment has been minimized.

Show comment Hide comment
@vicb

vicb Mar 5, 2014

Contributor

That was definitely an issue with the markup, it should be fixed now.

Contributor

vicb commented Mar 5, 2014

That was definitely an issue with the markup, it should be fixed now.

@vicb

This comment has been minimized.

Show comment Hide comment
@vicb

vicb Mar 5, 2014

Contributor

thanks for catching it !

Contributor

vicb commented Mar 5, 2014

thanks for catching it !

@kwalrath

This comment has been minimized.

Show comment Hide comment
@kwalrath

kwalrath Mar 5, 2014

Ah, much better now.

Ah, much better now.

app/tutorial/08-ch06-view.html
@@ -223,81 +223,81 @@ <h3 id="encapsulating-view-logic-into-components">
<div class="col-md-6">
<h3>index.html (previous Chapter)</h3>
-<pre class="prettyprint">
-&lt;div recipe-book&gt;
+<script type="template/dart">

This comment has been minimized.

Show comment Hide comment
@kwalrath

kwalrath Mar 5, 2014

Contributor

This example probably needs to stay as a <pre>, since it formats the code (using <strong>, e.g.).

At least, I assume the formatting is intentional...

@kwalrath

kwalrath Mar 5, 2014

Contributor

This example probably needs to stay as a <pre>, since it formats the code (using <strong>, e.g.).

At least, I assume the formatting is intentional...

This comment has been minimized.

Show comment Hide comment
@vicb

vicb Mar 5, 2014

Contributor

Nice catch again !

The formatting is indeed intentional.

I would prefer loosing the formatting here over switching back to escaped entities but I'll do whatever your prefer.

@vicb

vicb Mar 5, 2014

Contributor

Nice catch again !

The formatting is indeed intentional.

I would prefer loosing the formatting here over switching back to escaped entities but I'll do whatever your prefer.

This comment has been minimized.

Show comment Hide comment
@kwalrath

kwalrath Mar 5, 2014

Contributor

I don't have strong feelings either way.

-k-

On Wed, Mar 5, 2014 at 8:24 AM, Victor Berchet notifications@github.comwrote:

In app/tutorial/08-ch06-view.html:

@@ -223,81 +223,81 @@



index.html (previous Chapter)

-


-<div recipe-book>
+<script type="template/dart">

Nice catch again !

The formatting is indeed intentional.

I would prefer loosing the formatting here over switching batch to escaped
entities but I'll do whatever your prefer.


Reply to this email directly or view it on GitHubhttps://github.com/angular/angulardart.org/pull/45/files#r10306023
.

@kwalrath

kwalrath Mar 5, 2014

Contributor

I don't have strong feelings either way.

-k-

On Wed, Mar 5, 2014 at 8:24 AM, Victor Berchet notifications@github.comwrote:

In app/tutorial/08-ch06-view.html:

@@ -223,81 +223,81 @@



index.html (previous Chapter)

-


-<div recipe-book>
+<script type="template/dart">

Nice catch again !

The formatting is indeed intentional.

I would prefer loosing the formatting here over switching batch to escaped
entities but I'll do whatever your prefer.


Reply to this email directly or view it on GitHubhttps://github.com/angular/angulardart.org/pull/45/files#r10306023
.

app/tutorial/08-ch06-view.html
@@ -496,12 +495,12 @@ <h4 id="routes-are-hierarchical">Routes are hierarchical</h4>
<p>Here is how our routing configuration will build the paths we’ve
defined:</p>
-<pre class="prettyprint lang-html">
+<script class="prettyprint">
...#

This comment has been minimized.

Show comment Hide comment
@kwalrath

kwalrath Mar 5, 2014

Contributor

This code isn't showing up in the page.

@kwalrath

kwalrath Mar 5, 2014

Contributor

This code isn't showing up in the page.

@@ -182,11 +182,11 @@ <h2 id="running-the-sample-app">Running the Sample App</h2>
<p>Before running the app, get the packages, temporarily set the DART_SDK
environment variable, and run the code generator. For example:</p>
-<pre>
+<script type="template/dart">

This comment has been minimized.

Show comment Hide comment
@kwalrath

kwalrath Mar 5, 2014

Contributor

template/dart isn't the right thing here. Maybe use just a plain pre?

@kwalrath

kwalrath Mar 5, 2014

Contributor

template/dart isn't the right thing here. Maybe use just a plain pre?

@kwalrath

This comment has been minimized.

Show comment Hide comment
@kwalrath

kwalrath Mar 5, 2014

Contributor

Once you fix the few things I commented on, this looks great to me.

Contributor

kwalrath commented Mar 5, 2014

Once you fix the few things I commented on, this looks great to me.

@vicb

This comment has been minimized.

Show comment Hide comment
@vicb

vicb Mar 6, 2014

Contributor
  • removed the <strong> formatting to keep script tags (easier to update),
  • fixed <script class="prettyprint">
  • changed template/dart to template/code so it could be used everywhere (no only dart)

Will push the commit & update the live version in the coming minutes.

Contributor

vicb commented Mar 6, 2014

  • removed the <strong> formatting to keep script tags (easier to update),
  • fixed <script class="prettyprint">
  • changed template/dart to template/code so it could be used everywhere (no only dart)

Will push the commit & update the live version in the coming minutes.

@vicb

This comment has been minimized.

Show comment Hide comment
@vicb

vicb Mar 6, 2014

Contributor

Done and thanks again for the very good feedback !

Contributor

vicb commented Mar 6, 2014

Done and thanks again for the very good feedback !

@kwalrath

This comment has been minimized.

Show comment Hide comment
@kwalrath

kwalrath Mar 6, 2014

Contributor

So close!

Contributor

kwalrath commented Mar 6, 2014

So close!

@vicb

This comment has been minimized.

Show comment Hide comment
@vicb

vicb Mar 6, 2014

Contributor

I think I'm done now :)

Contributor

vicb commented Mar 6, 2014

I think I'm done now :)

@kwalrath

This comment has been minimized.

Show comment Hide comment
@kwalrath

kwalrath Mar 6, 2014

Contributor

lgtm! Thanks for making the docs better (and for bearing through the review process :).

Contributor

kwalrath commented Mar 6, 2014

lgtm! Thanks for making the docs better (and for bearing through the review process :).

kwalrath added a commit that referenced this pull request Mar 6, 2014

Merge pull request #45 from vicb/updates
Update the html to match the latest code

@kwalrath kwalrath merged commit 5fd419f into dart-archive:master Mar 6, 2014

@vicb vicb deleted the vicb:updates branch Mar 6, 2014

@vicb

This comment has been minimized.

Show comment Hide comment
@vicb

vicb Mar 6, 2014

Contributor

Cool! Many thanks for reviewing and catching so many errors !

Contributor

vicb commented Mar 6, 2014

Cool! Many thanks for reviewing and catching so many errors !

@kwalrath

This comment has been minimized.

Show comment Hide comment
@kwalrath

kwalrath Mar 6, 2014

Contributor

Attention to detail is my gift and curse. :) You're very welcome.

Contributor

kwalrath commented Mar 6, 2014

Attention to detail is my gift and curse. :) You're very welcome.

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