Adventures in Tech Land. Season 4. Episode 3
2024/02/23, 50th day
The reboot is really happening. If only because I need a stimulating way to procrastinate and something to do to avoid being stuck all day on the horrors happening in Palestine at the moment.
I managed to write some code that automatically updates a number of items in my templates.
the page of the day before now has an automatic link to today's page
the main index page also automatically links to the "last day"
it also automatically updates the total number of days, the episode number in the season and the episode list
the "tommorrow" page also has an automatic update for the "last day" link
Besides for the fact that the code, the variable names and the whole process is a bit messy, I'm at a place where I don't have to manually do much any more. I can focus on actual practice in freeCodeCamp and other places.
On the freeCodeCamp side, this time there are two things that I never used before. The <figure>
tag that can have plenty of types of contents, but content should be self-contained so that it can be moved to a different position in the document. The <figure>
can have a caption in a <figcaption>
tag. The <figcaption>
can contain the accessible description
of the <figure>
.
https://developer.mozilla.org/en-US/docs/Glossary/Accessible_description
The second thing is the <form>
element, that's used to send information to a process somewhere else. It comes with an action
attribute that does something to the data and can contain <input>
elements to actually gather data. <input>
elements can have various attributes, including type
, that describes the type of input, placeholder
that gives a default value, name
that names the input for processing in the target process, etc.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
Unlike the previous days, I'll just put small code blocks to emphasize the step content. I also added the real HTML so that it shows how it renders on the page.
<h3>
headingHeading number shows hierarchy.
<section> <h2>This movie is really good</h2> <h3>List of represented days</h3> </section>---
<ul>
unordered listList (empty for now) where items are not ordered.
<section> <h2>This movie is really good</h2> <h3>List of represented days</h3> <ul></ul> </section>
<li>
list itemThe list contains list items
<h3>List of represented days</h3> <ul> <li>First day</li> <li>Second day</li> <li>Third day</li> </ul>---
<h3>List of represented days</h3> <ul> <li>First day</li> <li>Second day</li> <li>Third day</li> </ul> <img alt="All the days of the year" src="https://helios-i.mashable.com/imagery/articles/03LkUHbeYe9Gf8qlIT9ock6/hero-image.fill.size_1248x702.v1612299679.jpg">
<figure>
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure
"The <figure>
HTML element represents self-contained content, potentially with an optional caption, which is specified using the <figcaption>
element. The figure, its caption, and its contents are referenced as a single unit."
<figure> <imgg alt="All the days of the year" src="https://helios-i.mashable.com/imagery/articles/03LkUHbeYe9Gf8qlIT9ock6/hero-image.fill.size_1248x702.v1612299679.jpg"> <figcaption>I can't see the image, so I can't tell</figcaption> </figure>--- ---
<figcaption>
I'm not doing it again.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figcaption
"The <figcaption> HTML element represents a caption or legend describing the rest of the contents of its parent <figure> element, providing the <figure> an accessible description."
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figcaption
<em>
phasis
Emphasizing blindness. It is possible to inline-stype <figcaption>
.
<figuree> <img alt="All the days of the year" src="https://helios-i.mashable.com/imagery/articles/03LkUHbeYe9Gf8qlIT9ock6/hero-image.fill.size_1248x702.v1612299679.jpg"> <figcaption>I <em>can't see</em> the image, so I can't tell</figcaption> </figure>
<h3>
under the <figure>
Starting another subsection.
<sectionon> <h2>This movie is really good</h2> <h3>List of represented days</h3> <ul> <li>First day</li> <li>Second day</li> <li>Third day</li> </ul> <figure> <img alt="All the days of the year" src="https://helios-i.mashable.com/imagery/articles/03LkUHbeYe9Gf8qlIT9ock6/hero-image.fill.size_1248x702.v1612299679.jpg"> <figcaption>I <em>can't see</em> the image, so I can't tell</figcaption> </figure> <h3>List of misrepresented days</h3> </section>
<ol>
ordered listsSome days are more important than others.
<h3>List of misrepresented days</h3> <ol> <li>Day A</li> <li>Day A’</li> <li>Day A’’</li> </ol>
Another figure under the list.
<h3>List of misrepresented days</h3> <ol> <li>Day A</li> <li>Day A’</li> <li>Day A’’</li> </ol> <figure> <img alt="Today, again?" src="https://i.insider.com/52de8d076da8113b6da3dcf7"> <figcaption>Déjà vu.</figcaption> </figure>---
<img>
Image added, above.
alt
alt
added, above.
<figcaption>
<figcaption>
added, above.
<strong>
A strongly different way to emphasize.
<figure> <img alt="Today, again?" src="https://i.insider.com/52de8d076da8113b6da3dcf7"> <figcaption>Dejà <strong>vu</strong>.</figcaption> </figure>
<section>
<section> </section>
<h2>
inside the new section<section> <h2>To know more about your potential days</h2> </section>
<form>
At last, something new and exciting.
<section> <h2>To know more about your potential days</h2> <form></form> </section>
action
attribute<section> <h2>To know more about your potential days</h2> <form action="someplace.on.the.web/get.your.GD.calendar"></form> </section>
<input>
element, to send datahttps://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
<section> <h2>To know more about your potential days</h2> <form action="someplace.on.the.web/get.your.GD.calendar"> <input/> </form> </section>
type
attribute
The input
element can have lots of types. One is text
, to send text.
<section> <h2>To know more about your potential days</h2> <form action="someplace.on.the.web/get.your.GD.calendar"> <input type="text"/> </form> </section>
In order for a form's data to be accessed by the location specified in the action attribute, you must give the text field a name attribute and assign it a value to represent the data being submitted.
<section> <h2>To know more about your potential days</h2> <form action="someplace.on.the.web/get.your.GD.calendar"> <input type="text" name="yourEmail"/> </form> </section>
<section> <h2>To know more about your potential days</h2> <form action="someplace.on.the.web/get.your.GD.calendar"> <input type="text" name="yourEmail" placeholder="myName@myserver.stuff"/> </form> </section>---
Et voilà !