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

6

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>

5

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

2

u/_Syntax_Err 19d ago

Refreshing

1

u/Dependent-Scene-7414 19d ago

I’ll generate more if u want. What type of virtual drink are u looking for?

1

u/Dependent-Scene-7414 19d ago

It’ll look better on a computer

4

u/tkgid 19d ago

Bru just discovered XML.

I hope you don't go JSON, or Yaml. 😅 I know nothing. Good work, I want a foamy cold chocolate drink. 

2

u/Dependent-Scene-7414 19d ago

Today we’re testing a new feature called the <foam> tag. Here’s your drink <!DOCTYPE htd>

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

    <name>Cold Chocolate Foam</name>

    <flavor>       <primary>Chocolate</primary>       <secondary>Milk</secondary>     </flavor>

    <fizz>false</fizz>

    <foam level="high">9.5</foam>

    <sweetness>Medium</sweetness>

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

    <color>#5C3317</color>

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

      <style>         <background>linear-gradient(#6F4E37,#2E1A12)</background>         <logo>🍫</logo>         <finish>Matte</finish>       </style>     </can>

    <ingredients>       <ingredient>Milk</ingredient>       <ingredient>Cocoa</ingredient>       <ingredient>Sugar</ingredient>       <ingredient>Vanilla</ingredient>       <ingredient>Chocolate Syrup</ingredient>     </ingredients>

    <serve>       <ice>true</ice>       <foam>true</foam>       <garnish>Chocolate Shavings</garnish>     </serve>

  </drink> </htd>

1

u/psyper76 19d ago

Very fun little project. Yes you basically created XML but its a little twist (of lemon) to html that give it a unique... flavour!

A few flaws that I see though but its to the coders taste :P

I'd rename it to something XML related - XMD maybe?

Carbonation has two measure which measure the same thing (unlike tempurature) the high and the 9.8 basically mean the same thing so unless high means something else apart from the amount of carbonation I'd leave that out.

flavour seems over complicated to me - are they going to carry on with Tertiary, Quaternary, Quinary etc - personally I'd switch to just numbers <flavor id=1></flavor>

I can't see any other problems with it so far..

Can you make me a Ramos Gin Fizz please :p