- Go 100%
| anchorattributedtotag.go | ||
| anchorattributedtotag_test.go | ||
| extractattributedto.go | ||
| extractattributedto_test.go | ||
| extractcontent.go | ||
| extractcontent_test.go | ||
| extracthref.go | ||
| extracthref_test.go | ||
| extractrel.go | ||
| extractrel_test.go | ||
| extractto.go | ||
| extracttype.go | ||
| extracttype_test.go | ||
| go.mod | ||
| go.sum | ||
| httphandler.go | ||
| indexaftermainend.go | ||
| indexaftermainend_test.go | ||
| indexmainbegin.go | ||
| indexmainbegin_test.go | ||
| LICENSE | ||
| maintag.go | ||
| maintag_test.go | ||
| README.md | ||
| skippastmain.go | ||
| skippastmain_test.go | ||
| split.go | ||
| split_test.go | ||
| unmarshal.go | ||
| unmarshal_test.go | ||
go-activityhtml
Package activityhtml provides tools for working with ActivityHTML, for the Go programming language.
ActivityHTML is HTML that has ActivityPub / ActivityStream data marked-up or embedded into it using RDFa.
Documention
Online documentation, which includes examples, can be found at: http://godoc.org/codeberg.org/reiver/go-activityhtml
ActivityHTML
ActivityHTML is ActivityPub / ActivityStream encoded into HTML in a very specific way.
https://www.w3.org/ns/activitystreams#content— the HTML<main>https://www.w3.org/ns/activitystreams#type— the value of the RDFatypeofattribute on the HTML<main>https://www.w3.org/ns/activitystreams#attributedTo— the value of thehrefattribute on<a>withrelhttps://www.w3.org/ns/activitystreams#attributedToinside of the HTML<main>
For example:
<main typeof="https://www.w3.org/ns/activitystreams#Note">
<p>
Hello world!
</p>
</main>
That becomes:
{
"@context": "https://www.w3.org/ns/activitystreams",
type: "Note",
content: "<main typeof=\"https://www.w3.org/ns/activitystreams#Note\">\n\t<p>\n\t\tHello world!\n\t</p></main>"
}
And, for example, this:
<main typeof="https://www.w3.org/ns/activitystreams#Note">
<p>
Hello world!
</p>
<footer>
<address>
<a rel="https://www.w3.org/ns/activitystreams#attributedTo" href="http://host.example/@dariush">@[email protected]</a>
</address>
</footer>
</main>
Becomes:
{
"@context": "https://www.w3.org/ns/activitystreams",
type: "Note",
content: "<main typeof=\"https://www.w3.org/ns/activitystreams#Note\">\n\t<p>\n\t\tHello world!\n\t</p></main>",
attributedTo: "http://host.example/@dariush"
}
Import
To import package activityhtml use import code like the following:
import "codeberg.org/reiver/go-activityhtml"
Installation
To install package activityhtml do the following:
GOPROXY=direct go get codeberg.org/reiver/go-activityhtml
Author
Package activityhtml was written by Charles Iliya Krempeaux