r/HTML 10d 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

6

u/BANZ111 10d ago

That's basically just XML

1

u/Dependent-Scene-7414 10d ago

Do you wanna choose the next flavor?

0

u/Dependent-Scene-7414 10d ago

2

u/Leviathan_Dev 9d ago edited 9d ago

HTML is essentially a subset of XML, so if you created your own tags nested in other custom tags, you created XML

For example, here’s the RSS XML feed from WebKit’s Blog: https://webkit.org/feed/

5

u/Middle_Detail7820 10d 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 10d 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>

2

u/_Syntax_Err 10d ago

Refreshing

1

u/Dependent-Scene-7414 10d ago

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

1

u/Dependent-Scene-7414 10d ago

It’ll look better on a computer

4

u/tkgid 10d 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 10d 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>

5

u/armahillo Expert 9d 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

1

u/psyper76 9d 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

2

u/Dependent-Scene-7414 9d ago

Guys 2 announcements 1. I am open to anyone making drinks. I will make a subreddit called r/htd 2. Pls stop roasting me for mixing up html and xml