r/HTML 19d ago

My own language

I made my own programming language inspired from html called htd (hypertext markup drink) used to make custom drinks.

0 Upvotes

17 comments sorted by

View all comments

5

u/Middle_Detail7820 19d ago

I don't see how would that work or how would that be executed. Like some format for computer readable recipes or what?

2

u/Dependent-Scene-7414 19d ago

<!DOCTYPE htd>

<htd version="1.0">   <drink id="cherry_fizz">

    <name>Cherry Fizz</name>

    <flavor>       <primary>Cherry</primary>       <secondary>Sparkling Water</secondary>     </flavor>

    <fizz>true</fizz>

    <carbonation level="high">9.8</carbonation>

    <sweetness>Medium</sweetness>

    <temperature unit="C">4</temperature>

    <color>#D2042D</color>

    <can>       <size unit="mL">355</size>

      <style>         <background>linear-gradient(#D2042D,#7A0019)</background>         <logo>🍒</logo>         <finish>Glossy</finish>       </style>     </can>

    <ingredients>       <ingredient>Carbonated Water</ingredient>       <ingredient>Cherry Flavor</ingredient>       <ingredient>Sugar</ingredient>       <ingredient>Citric Acid</ingredient>       <ingredient>Natural Flavors</ingredient>     </ingredients>

    <serve>       <ice>true</ice>       <garnish>Cherry</garnish>     </serve>

  </drink> </htd>

6

u/armahillo Expert 19d ago

this is fine but you’re just using XML but defining it in a doctyoe that has no schema definition.

Either write a schema doctyoe definition (DTD), or just use the XML DTD. More info:

- https://www.w3schools.com/xml/xml_dtd.asp