Best Practice 4.12.0.26. Use label
attribute for Runestone Components.
Many of our interactive exercises and programming environments are powered by software from Runestone Academy (Chapter 32). Not suprisingly, when you build online HTML for hosting on Runestone servers these components have more features than otherwise. This is managed by locating each component in a (massive) database. And so each exercise needs an identifier.
You accomplish this by placing a unique value in a
@label
attribute on an outermost element, such as an <exercise>
, <task>
, <project>
, <video>
, <program>
, etc. You should choose these strings carefully, as they should not be changed, lest the database entries become confused. Under the hood, we get the content of docinfo/document-id
element, and the @edition
attribute of <document-id>
, to form a database identifier such as AATA_2_easy-exercise
. The <document-id>
distinguishes your book from other books, and the edition allows you some flexibility. In other words, if you declare a new edition, you can change some of your @label
as part of that process and you will get new database entries while preserving the old.Short answer: before hosting your project on Runestone, decide on permanent values for
<document-id>
, @edition
, and all necessary @label
. (We expect to add a warning for Runestone builds when these values are not set.)