ActivityStreams compliance: Microsyntaxes

Created on 6 November 2022, over 2 years ago
Updated 11 April 2025, about 1 month ago

Problem/Motivation

A nice feature is the use of some kind of text parser such as https://www.w3.org/TR/activitystreams-vocabulary/#microsyntaxes , detecting "to" property in text, mention tag types, or simple tag properties.
Maybe the "to" property should be filled with some kind of confirmation.
Also we could create some new conventions, or reuse some found in mail, for example use re:http://note.example.org to automatically fill the inreplyto property
or directly allow the use of properties as of https://www.w3.org/TR/activitystreams-vocabulary/#properties in content to directly fill the property.

Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

🇪🇸Spain aleix

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇪🇸Spain aleix

    To workaround this block I bumped my expired feature request in a new one https://github.com/ckeditor/ckeditor5/issues/18370 , Please re vote there...

    and also made a PR in github: https://github.com/ckeditor/ckeditor5/pull/18371

    I made some tests locally and mentions looks fine ;)

  • 🇪🇸Spain aleix

    I made some progress here, this covers mentions of actors and tags creation in text in a simple way with the help of mf2. Maybe the original issue description covers a lot of things that could lead to a never-end issue. Maybe we could offer just actor and tag by now... Anyway, by now I planned only these microformats, but as mf2 is used, and two kind of mentions are there, extending to new microformats detected by mf2 can be done at some point.

    Also, sorry for this, by now I will not publish the new module or the PR as there are minor points that need to be completed (tests and integration to main module), I'll do this when I find some projects to make the development sustainable...

    This is how I planned:

    The new module will add activitypub mentions to ckeditor5 text editors, if configured as it should you could get a list of actors or tags proposals when a marker (@ for actors, # for tags) and a pattern is entered (@abc@def.xyzfor actors, #abc for tags).
    When there's an actor mention, it will feed the "to" field if the actor is not in user follower collection, and so on will be sent to remote actor's inbox.
    When there's a tag mention, it will create the tag if it doesn't exist and will add the tag to the taxonomy field.


    Configuration

    It will need to enable the activitypub mentions, actors and/or tags, in the settings of the desired editor in /admin/config/content/formats.
    For actors, proposals will create a list from following and followers that will appear after 2 characters (number configurable in editor settings). If there are no candidates when the pattern @aa@bb.cc is there, an autocomplete proposal will also appear to automatically fill the necessary link properties to be treated as an activitypub mention and so on be able to send afterward to pertinent actor inbox.

    For tags autocompletion the vocabulary must be specified, take note that to be able to create a tag in the vocabulary when mentioning a tag, this will be done in editor settings. Also, a taxonomy term reference field using the same vocabulary must exist in the entity.

    For both actor and tags may be configured the number of proposals (default to 10).

    Additionally, if one needs to alter the actors or tags autocomplete proposals, a new two alter hooks could be used, explained in ckeditor5_activitypub.api.php.

    Using in decoupled environments

    Although the new module will depend on ckeditor5 config, the behavior can be cloned in other frontends, as the logic happens in presave (of the content entity and the activitypub_activity entity). So, theoretically, but not tested... One can use the Ajax controller route
    to obtain the list of autocomplete proposals, and use the same downcast/upcast logics. Taking a look at new ckeditor plugin code will help about what parameters must be there to cast an HTML element with attributes to actor/tag mention. Also, how mentions coming from autocomplete can take properties from there to an HTML element with attributes.

  • 🇧🇪Belgium swentel

    That looks very, very, very cool! I wonder whether we can create our own ckeditor plugin instead of having to rely on getting that merged into ckeditor itself. That's just a thought because I have not dived into Ckeditor plugins yet, a bit too scared :)

  • 🇪🇸Spain aleix

    I have all the information we need to fork the plugin, buuut I think it is too much overhead, at the end it is just one line to modify(to tweak a regexp), so it will mean low-cost for us to just patch it...(rather than maintain a whole ckeditor plugin...).

    If at some point we need more then we can think about it. Also the modified ckeditor plugin will be already built in our module so nobody will need to recompile.

Production build 0.71.5 2024