{"schemaVersion":1,"contentVersion":"3.4.0","id":"intermediate.18","languages":{"javascript":{"id":"intermediate.18","title":"Optional: markup objects","moduleName":"Optional extensions","tips":"","concept":"<p class=\"lead\">Change the text inside an HTML element, or replace the element and its tags.</p><p><strong>Before this lesson:</strong> Paired objects.</p><p>In JavaScript the examples are JSX components, and in Python and plain text they're HTML templates. it is the text inside an element and at includes its opening and closing tags. You can start anywhere in the element, even on one of its tags. With nested elements, start inside the one you mean. This lesson is optional.</p><h3>Example</h3><p>From inside &lt;em&gt;draft&lt;/em&gt;, cit then final then Esc keeps the em tags. cat replaces the whole element.</p><p>Use Start over to try again.</p>","teaches":["textobject:it","textobject:at"],"introduces":["textobject"],"constraints":[],"drills":[{"task":"You can follow a parcel in the app now. Make the paragraph under Delivery say <code>Follow your parcel in the app.</code>","hint":"cit changes the text between an element's tags, from anywhere in the element, even on one of its tags.","mode":"jsx","start":"import { formatMoney } from \"../lib/money\";\n\nexport function DeliveryNote({ freeFromCents }) {\n  return (\n    <aside className=\"delivery-note\">\n      <h3>Delivery</h3>\n      <p>We'll email you when your parcel leaves the warehouse.</p>\n      <small>Free delivery from {formatMoney(freeFromCents)}</small>\n    </aside>\n  );\n}","startCursor":{"line":2,"ch":20},"paths":[{"keys":["4","j","c","i","t","Follow your parcel in the app.","<Esc>"],"tier":"idiomatic","technique":"textobject:it","core":["textobject:it"],"note":"cit keeps the element's tags and changes all of its text at once."}],"target":"import { formatMoney } from \"../lib/money\";\n\nexport function DeliveryNote({ freeFromCents }) {\n  return (\n    <aside className=\"delivery-note\">\n      <h3>Delivery</h3>\n      <p>Follow your parcel in the app.</p>\n      <small>Free delivery from {formatMoney(freeFromCents)}</small>\n    </aside>\n  );\n}","language":"javascript","evidence":"guided","canonicalKey":"intermediate.18#0","canonicalFingerprint":"6clik1"},{"task":"Support has moved to chat. Replace the email link with <code>&lt;ChatButton /&gt;</code>.","hint":"cat replaces the element and its tags. Start anywhere in it.","mode":"jsx","start":"import { ChatButton } from \"./ChatButton\";\n\n// At the bottom of every account page.\nexport function HelpFooter() {\n  return (\n    <footer className=\"help-footer\">\n      <p>Questions? <a href=\"mailto:help@northwind.shop\">Email us</a> any time.</p>\n      <p>We answer within one working day.</p>\n    </footer>\n  );\n}","startCursor":{"line":3,"ch":24},"paths":[{"keys":["3","j","c","a","t","<ChatButton />","<Esc>"],"tier":"idiomatic","technique":"textobject:at","core":["textobject:at"],"note":"cat takes the tags with it, so only what you type is left."}],"target":"import { ChatButton } from \"./ChatButton\";\n\n// At the bottom of every account page.\nexport function HelpFooter() {\n  return (\n    <footer className=\"help-footer\">\n      <p>Questions? <ChatButton /> any time.</p>\n      <p>We answer within one working day.</p>\n    </footer>\n  );\n}","language":"javascript","evidence":"guided","canonicalKey":"intermediate.18#1","canonicalFingerprint":"1alktl"}]},"python":{"id":"intermediate.18","title":"Optional: markup objects","moduleName":"Optional extensions","tips":"","concept":"<p class=\"lead\">Change the text inside an HTML element, or replace the element and its tags.</p><p><strong>Before this lesson:</strong> Paired objects.</p><p>In JavaScript the examples are JSX components, and in Python and plain text they're HTML templates. it is the text inside an element and at includes its opening and closing tags. You can start anywhere in the element, even on one of its tags. With nested elements, start inside the one you mean. This lesson is optional.</p><h3>Example</h3><p>From inside &lt;em&gt;draft&lt;/em&gt;, cit then final then Esc keeps the em tags. cat replaces the whole element.</p><p>Use Start over to try again.</p>","teaches":["textobject:it","textobject:at"],"introduces":["textobject"],"constraints":[],"drills":[{"task":"The button should say what it does. Make it say <code>Update my address</code>.","hint":"cit changes the text between an element's tags, from anywhere in the element, even on one of its tags.","mode":"jsx","start":"{% extends \"account/base.html\" %}\n\n{% block content %}\n  <h1>Your delivery address</h1>\n  <form method=\"post\">\n    {% csrf_token %}\n    {{ form.as_p }}\n    <button type=\"submit\">Save changes</button>\n  </form>\n{% endblock %}","startCursor":{"line":4,"ch":6},"paths":[{"keys":["3","j","c","i","t","Update my address","<Esc>"],"tier":"idiomatic","technique":"textobject:it","core":["textobject:it"],"note":"cit keeps the element's tags and changes all of its text at once."}],"target":"{% extends \"account/base.html\" %}\n\n{% block content %}\n  <h1>Your delivery address</h1>\n  <form method=\"post\">\n    {% csrf_token %}\n    {{ form.as_p }}\n    <button type=\"submit\">Update my address</button>\n  </form>\n{% endblock %}","language":"markup","specialization":"markup","evidence":"guided","canonicalKey":"intermediate.18#0","canonicalFingerprint":"6clik1"},{"task":"Give the refund time we worked out for this order. Replace <code>&lt;em&gt;three to five days&lt;/em&gt;</code> with <code>{{ refund.days }} working days</code>.","hint":"cat replaces the element and its tags. Start anywhere in it.","mode":"jsx","start":"{% extends \"emails/base.html\" %}\n\n{% block body %}\n  <p>Hi {{ order.customer.first_name }},</p>\n  <p>We've cancelled order {{ order.number }} as you asked.</p>\n  <p>The refund reaches your card in <em>three to five days</em>.</p>\n  <p>Questions? Just reply to this email.</p>\n{% endblock body %}","startCursor":{"line":4,"ch":38},"paths":[{"keys":["j","c","a","t","{{ refund.days }} working days","<Esc>"],"tier":"idiomatic","technique":"textobject:at","core":["textobject:at"],"note":"cat takes the tags with it, so only what you type is left."}],"target":"{% extends \"emails/base.html\" %}\n\n{% block body %}\n  <p>Hi {{ order.customer.first_name }},</p>\n  <p>We've cancelled order {{ order.number }} as you asked.</p>\n  <p>The refund reaches your card in {{ refund.days }} working days.</p>\n  <p>Questions? Just reply to this email.</p>\n{% endblock body %}","language":"markup","specialization":"markup","evidence":"guided","canonicalKey":"intermediate.18#1","canonicalFingerprint":"1alktl"}]},"text":{"id":"intermediate.18","title":"Optional: markup objects","moduleName":"Optional extensions","tips":"","concept":"<p class=\"lead\">Change the text inside an HTML element, or replace the element and its tags.</p><p><strong>Before this lesson:</strong> Paired objects.</p><p>In JavaScript the examples are JSX components, and in Python and plain text they're HTML templates. it is the text inside an element and at includes its opening and closing tags. You can start anywhere in the element, even on one of its tags. With nested elements, start inside the one you mean. This lesson is optional.</p><h3>Example</h3><p>From inside &lt;em&gt;draft&lt;/em&gt;, cit then final then Esc keeps the em tags. cat replaces the whole element.</p><p>Use Start over to try again.</p>","teaches":["textobject:it","textobject:at"],"introduces":["textobject"],"constraints":[],"drills":[{"task":"Most new shops bring their products over first. Make the button say <code>Import your catalogue</code>.","hint":"cit changes the text between an element's tags, from anywhere in the element, even on one of its tags.","mode":"jsx","start":"<table role=\"presentation\" width=\"100%\">\n  <tr>\n    <td class=\"hero\">\n      <h1>Welcome to Northwind</h1>\n      <p>Your shop is ready. Start by adding your first product.</p>\n      <a class=\"button\" href=\"https://admin.northwind.shop/products/new\">Add a product</a>\n    </td>\n  </tr>\n</table>","startCursor":{"line":3,"ch":10},"paths":[{"keys":["2","j","c","i","t","Import your catalogue","<Esc>"],"tier":"idiomatic","technique":"textobject:it","core":["textobject:it"],"note":"cit keeps the element's tags and changes all of its text at once."}],"target":"<table role=\"presentation\" width=\"100%\">\n  <tr>\n    <td class=\"hero\">\n      <h1>Welcome to Northwind</h1>\n      <p>Your shop is ready. Start by adding your first product.</p>\n      <a class=\"button\" href=\"https://admin.northwind.shop/products/new\">Import your catalogue</a>\n    </td>\n  </tr>\n</table>","language":"markup","specialization":"markup","evidence":"guided","canonicalKey":"intermediate.18#0","canonicalFingerprint":"6clik1"},{"task":"The shop has reopened. Replace the Closed for renovation tag with <code>Open again.</code>","hint":"cat replaces the element and its tags. Start anywhere in it.","mode":"jsx","start":"<section class=\"store\">\n  <h2>Visit the shop</h2>\n  <p>Kade 12, Rotterdam. <span class=\"tag\">Closed for renovation</span></p>\n  <p>Open Monday to Saturday, 9:00 to 18:00.</p>\n  <p>Parking is free after 17:00.</p>\n</section>","startCursor":{"line":4,"ch":30},"paths":[{"keys":["2","k","c","a","t","Open again.","<Esc>"],"tier":"idiomatic","technique":"textobject:at","core":["textobject:at"],"note":"cat takes the tags with it, so only what you type is left."}],"target":"<section class=\"store\">\n  <h2>Visit the shop</h2>\n  <p>Kade 12, Rotterdam. Open again.</p>\n  <p>Open Monday to Saturday, 9:00 to 18:00.</p>\n  <p>Parking is free after 17:00.</p>\n</section>","language":"markup","specialization":"markup","evidence":"guided","canonicalKey":"intermediate.18#1","canonicalFingerprint":"1alktl"}]}},"concepts":{"javascript":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Paired objects.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Change the text inside an HTML element, or replace the element and its tags.</p><p>In JavaScript the examples are JSX components, and in Python and plain text they're HTML templates. it is the text inside an element and at includes its opening and closing tags. You can start anywhere in the element, even on one of its tags. With nested elements, start inside the one you mean. This lesson is optional.</p><h2 class=\"prose-subhead\">Example</h2><p>From inside &lt;em&gt;draft&lt;/em&gt;, cit then final then Esc keeps the em tags. cat replaces the whole element.</p><p>Use Start over to try again.</p></div></details>"},"python":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Paired objects.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Change the text inside an HTML element, or replace the element and its tags.</p><p>In JavaScript the examples are JSX components, and in Python and plain text they're HTML templates. it is the text inside an element and at includes its opening and closing tags. You can start anywhere in the element, even on one of its tags. With nested elements, start inside the one you mean. This lesson is optional.</p><h2 class=\"prose-subhead\">Example</h2><p>From inside &lt;em&gt;draft&lt;/em&gt;, cit then final then Esc keeps the em tags. cat replaces the whole element.</p><p>Use Start over to try again.</p></div></details>"},"text":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Paired objects.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Change the text inside an HTML element, or replace the element and its tags.</p><p>In JavaScript the examples are JSX components, and in Python and plain text they're HTML templates. it is the text inside an element and at includes its opening and closing tags. You can start anywhere in the element, even on one of its tags. With nested elements, start inside the one you mean. This lesson is optional.</p><h2 class=\"prose-subhead\">Example</h2><p>From inside &lt;em&gt;draft&lt;/em&gt;, cit then final then Esc keeps the em tags. cat replaces the whole element.</p><p>Use Start over to try again.</p></div></details>"}}}