Skip to content

Commit

Permalink
Optional steps, expansion and explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Cooper committed Jan 17, 2017
1 parent 803fa50 commit e9586fe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
15 changes: 15 additions & 0 deletions generator/recipe.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@

<xsl:template match="step">
<li>
<xsl:if test="@optional = 'true'">
<em>Optional: </em>
</xsl:if>
<xsl:apply-templates/>
</li>
</xsl:template>
Expand All @@ -230,6 +233,18 @@
</a>
</xsl:template>

<xsl:template match="expanded">
<span class="expanded">
<xsl:apply-templates/>
</span>
</xsl:template>

<xsl:template match="explanation">
<span class="explanation">
<xsl:apply-templates/>
</span>
</xsl:template>

<xsl:template match="variation">
<section class="variation">
<xsl:attribute name="id">
Expand Down
9 changes: 7 additions & 2 deletions recipes.dtd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!ENTITY % URI "CDATA">
<!ENTITY % inline "em | reciperef">
<!ENTITY % step "quantity | ingredient | temperature | time | equipment | procedure">
<!ENTITY % step "quantity | ingredient | temperature | time | equipment | procedure | note | explanation">
<!ELEMENT recipe (title, meta?, ((group, group+, (steps | activity+)?) | (ingredients, (steps | activity+))), serving?, variation*, storage?)>
<!ATTLIST recipe
photo %URI; #IMPLIED
Expand Down Expand Up @@ -38,13 +38,18 @@
<!ELEMENT preprep (#PCDATA)>
<!-- inline elements -->
<!ELEMENT note (#PCDATA | %inline;)*>
<!-- optional expanded instructions for the step -->
<!ELEMENT expanded (#PCDATA | %step; | %inline;)*>
<!-- explanation of the reason for a step -->
<!ELEMENT explanation (#PCDATA | %inline;)*>
<!-- enrich to reference things like &quot;chopped&quot; -->
<!ELEMENT ingredient_choice ((ingredient | ingredient_group)*)>
<!ELEMENT ingredient_group (ingredient, ingredient+)>
<!ELEMENT steps (step+)>
<!ELEMENT step (#PCDATA | %step; | %inline;)*>
<!ELEMENT step (#PCDATA | expanded | %step; | %inline;)*>
<!-- inline elements, quantities, temperatures, etc. -->
<!ATTLIST step
optional (true | false) "false"
photo %URI; #IMPLIED
>
<!ELEMENT activity (label, comment?, processnote?, (steps+ | activity+))>
Expand Down

0 comments on commit e9586fe

Please sign in to comment.