microformats / h-entry

For collecting and handling issues with the h-entry vocabulary specification: http://microformats.org/wiki/h-entry
17 stars 5 forks source link

Are IRC and XMPP being ignored? #34

Open sjehuda opened 2 months ago

sjehuda commented 2 months ago

Greetings!

I have found references to h-card at https://github.com/movim/movim/issues/393 and we have applied it to https://git.xmpp-it.net/sch/Blasta/src/branch/main/xhtml/contact.xhtml

You would see there class attributes with the following values u-xmpp, u-xmpp-mix, u-xmpp-muc, and u-irc, including u-email which is the only one which is mentioned on microformats.org

Please define IRC and XMPP.

Thank you, Schimon

gRegorLove commented 2 months ago

Hi Schimon, Thanks for proposing those properties!

The h-card spec tries to stay compatible with vCard4. For XMPP, I think you'd use the u-impp property that's listed in the spec. You could probably use that for IRC as well if there is a URI for linking to your IRC network+nickname, though I'm not aware if that's possible with most networks.

microformats2 parsing is based on the property prefix instead of a fixed list of properties, so you can start publishing and consuming properties you might want to experiment with right away. For example:

<div class="h-card">
  <h1 class="p-name">Alice Smith</h1>
  <a href="irc:irc.example.com/username" class="u-irc">username on example.com IRC</a>
</div>

parses as:

{
    "items": [
        {
            "type": [
                "h-card"
            ],
            "properties": {
                "name": [
                    "Alice Smith"
                ],
                "irc": [
                    "irc:irc.example.com/username"
                ]
            }
        }
    ],
    "rels": {},
    "rel-urls": {},
    "debug": {
        "package": "https://packagist.org/packages/mf2/mf2",
        "source": "https://github.com/indieweb/php-mf2",
        "version": "v0.5.0",
        "note": [
            "This output was generated from the php-mf2 library available at https://github.com/indieweb/php-mf2",
            "Please file any issues with the parser at https://github.com/indieweb/php-mf2/issues",
            "Using the Masterminds HTML5 parser"
        ]
    }
}
sjehuda commented 2 months ago

This is the page:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="color-scheme" content="dark light" />
    <title>Blasta / contact</title>
    <link rel="shortcut icon" href="/graphic/blasta.svg"/>
    <link rel='icon' type='image/svg+xml' href='/graphic/blasta.svg'/>
    <link rel='stylesheet' type='text/css' media='screen' href='/stylesheet/stylesheet.css'/>
</head>
<body>
    <div id="container">
        <div id="header" class="row">
            <h1>
                <img src="/graphic/blasta.svg"/>
                <a href="/">Blasta</a> / contact
            </h1>
            <dl id="navigation">
                <dd>
                    <img src="/graphic/blasta.svg"/>
                </dd>

                <dd>
                    <a href="/search">Search</a>
                </dd>
                <dd>
                    <a href="/popular">Popular</a>
                </dd>
                <dd>
                    <a href="/recent">Recent</a>
                </dd>
                <dd>

                        <a href="/connect">Connect</a>

                </dd>
            </dl>
        </div>
        <div id="main" class="row">
            <div id="content">
                <h2>&nbsp; PubSub Bookmarks</h2>
                <p>
                    » Herein contant information.
                </p>
                <h3 id="contact">
                    Contact
                </h3>
                <p>
                    You can reach us by the following means.
                </p>

                    <dl class="h-card">
                        <h4 class="p-name"
                            id="mix">
                            Blasta Community
                        </h4>

                            <dd>
                                MIX Groupchat
                                <br/>
                                <a class="u-xmpp-mix"
                                   href="xmpp:blasta@mix.christian.i2p?join">
                                    blasta@mix.christian.i2p</a>
                            </dd>

                            <dd>
                                MUC Groupchat
                                <br/>
                                <a class="u-xmpp-muc"
                                   href="xmpp:blasta@muc.christian.i2p?join">
                                    blasta@muc.christian.i2p</a>
                            </dd>

                            <dd>
                                IRC Channel
                                <br/>
                                <a class="u-irc"
                                   href="irc://irc.christian.i2p/#blasta">
                                    #blasta</a>
                                at irc.christian.i2p
                            </dd>

                    </dl>

                    <dl class="h-card">
                        <h4 class="p-name"
                            id="jabber">
                            Blasta Contact
                        </h4>

                            <dd>
                                Send a Jabber message
                                <br/>
                                <a class="u-xmpp"
                                   href="xmpp:blasta@christian.i2p?message">
                                    blasta@christian.i2p</a>
                            </dd>

                            <dd>
                                Send an Email message
                                <br/>
                                <a class="u-email"
                                   href="mailto:blasta@christian.i2p?subject=Blasta">
                                    blasta@christian.i2p</a>
                            </dd>

                    </dl>

                <br/>
                <p class="quote bottom">
                    “Be seeing you.”
                    ― Blasta
                </p>
            </div>
        </div>
        <div id="footer" class="row">
            <dl>
                <dd>
                    <img src="/graphic/blasta.svg" alt="logo"/>
                    <a href="/">blasta</a>
                </dd>
                <dd>
                    <a href="/help/about">about</a>
                </dd>
                <dd>
                    <a href="/help/about/xmpp">xmpp</a>
                </dd>
                <dd>
                    <a href="/help/about/xmpp/pubsub">pubsub</a>
                </dd>
                <dd>
                    <a href="gemini://christian.i2p">journal</a>
                </dd>
                <dd>
                    <a href="/help">help</a>
                </dd>
                <dd>
                    <a href="/help/policy">policy</a>
                </dd>
                <dd>
                    <a href="/help/feeds">rss</a>
                </dd>
                <dd>
                    <a href="/contact">contact</a>
                </dd>
            </dl>
        </div>
    </div>
</body>
</html>
gRegorLove commented 2 months ago

That will parse. You can try it out on https://php.microformats.io. But again, you probably want the existing u-impp property.

A key question in the microformats2 process for advancing proposed properties is "what is the consuming use-case?" While parsers will extract u-irc and u-xmpp (u-anything really!), we look for other sites consuming the properties interoperably. Of course, if you only need to consume these properties within your own ecosystem, it's fine to use whichever properties make the most sense. Sometimes vendor prefixes are used in those situations, like u-vendorname-foo