From fef1ab1fb351676e31172a2768f3035e79b7def3 Mon Sep 17 00:00:00 2001 From: rtio Date: Thu, 24 Nov 2022 23:13:40 -0300 Subject: [PATCH] Point out the original documentation --- README.md | 4 +- docs/Makefile | 192 ------- docs/_config.yml | 19 - docs/_includes/edit-doc-link.html | 7 - docs/_includes/footer.html | 18 - docs/_includes/meta.html | 24 - docs/_includes/navbar.html | 31 -- docs/_layouts/default.html | 24 - docs/activitystreams-types.md | 250 --------- docs/assets/css/style.scss | 110 ---- docs/conf.py | 75 --- docs/index.md | 527 ------------------ docs/index.rst | 63 --- docs/requirements.txt | 3 - docs/types/activitypub-dialects-management.md | 178 ------ .../activitypub-ontologies-management.md | 178 ------ 16 files changed, 2 insertions(+), 1701 deletions(-) delete mode 100644 docs/Makefile delete mode 100644 docs/_config.yml delete mode 100644 docs/_includes/edit-doc-link.html delete mode 100644 docs/_includes/footer.html delete mode 100644 docs/_includes/meta.html delete mode 100644 docs/_includes/navbar.html delete mode 100644 docs/_layouts/default.html delete mode 100644 docs/activitystreams-types.md delete mode 100644 docs/assets/css/style.scss delete mode 100644 docs/conf.py delete mode 100644 docs/index.md delete mode 100644 docs/index.rst delete mode 100644 docs/requirements.txt delete mode 100644 docs/types/activitypub-dialects-management.md delete mode 100644 docs/types/activitypub-ontologies-management.md diff --git a/README.md b/README.md index 98e3624..af91de7 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ As the two layers are implemented, it aims to be an ActivityPub conformant Feder All normalized types are implemented too. If you need to create a new one, just extend existing types. -[See the full documentation](https://rtio.github.io/activitypub-core) or +[See the full documentation](https://landrok.github.io/activitypub) or an overview below. Table of contents @@ -496,7 +496,7 @@ ________________________________________________________________________ More ---- -- [See the full documentation](https://rtio.github.io/activitypub-core/) +- [See the full documentation](https://landrok.github.io/activitypub/) - [ActivityPub](https://www.w3.org/TR/activitypub/) - [ActivityStreams 2.0](https://www.w3.org/TR/activitystreams-core/) diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 1f6b980..0000000 --- a/docs/Makefile +++ /dev/null @@ -1,192 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = build - -# User-friendly check for sphinx-build -ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) -$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) -endif - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " applehelp to make an Apple Help Book" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " xml to make Docutils-native XML files" - @echo " pseudoxml to make pseudoxml-XML files for display purposes" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - @echo " coverage to run coverage check of the documentation (if enabled)" - -clean: - rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ActivityPhp.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ActivityPhp.qhc" - -applehelp: - $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp - @echo - @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." - @echo "N.B. You won't be able to view it unless you put it in" \ - "~/Library/Documentation/Help or install it in your application" \ - "bundle." - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/ActivityPhp" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ActivityPhp" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -latexpdfja: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through platex and dvipdfmx..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." - -coverage: - $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage - @echo "Testing of coverage in the sources finished, look at the " \ - "results in $(BUILDDIR)/coverage/python.txt." - -xml: - $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml - @echo - @echo "Build finished. The XML files are in $(BUILDDIR)/xml." - -pseudoxml: - $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml - @echo - @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/docs/_config.yml b/docs/_config.yml deleted file mode 100644 index e8bafc2..0000000 --- a/docs/_config.yml +++ /dev/null @@ -1,19 +0,0 @@ -markdown: kramdown -highlighter: rouge -pygments: true - -enableRobotsTXT: true - -# Site name (head) -name: ActivityPhp Core Documentation - -# Site description (head) -description: A PHP implementation of ActivityPub core types protocol based upon the ActivityStreams 2.0 data format. - -# Github repositories and download URLs -repository_url : https://github.com/rtio/activitypub-core -doc_repository_url: https://github.com/rtio/activitypub-core/tree/master/docs -github_author_url : https://github.com/rtio -doc_baseurl : https://rtio.github.io/activitypub-core -github_author_name: rtio - diff --git a/docs/_includes/edit-doc-link.html b/docs/_includes/edit-doc-link.html deleted file mode 100644 index e721b5e..0000000 --- a/docs/_includes/edit-doc-link.html +++ /dev/null @@ -1,7 +0,0 @@ -

- - Edit this document on GitHub - -

- -
diff --git a/docs/_includes/footer.html b/docs/_includes/footer.html deleted file mode 100644 index 08ad54d..0000000 --- a/docs/_includes/footer.html +++ /dev/null @@ -1,18 +0,0 @@ - -
- -

- Home - - License -

- -
- - - - - - diff --git a/docs/_includes/meta.html b/docs/_includes/meta.html deleted file mode 100644 index 1b9dd58..0000000 --- a/docs/_includes/meta.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - {% if page.excerpt %} - - - {% else %} - - - {% endif %} - - - {% if page.title %} - - - {% endif %} - - - - - diff --git a/docs/_includes/navbar.html b/docs/_includes/navbar.html deleted file mode 100644 index 4ec5456..0000000 --- a/docs/_includes/navbar.html +++ /dev/null @@ -1,31 +0,0 @@ - - diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html deleted file mode 100644 index 39b710c..0000000 --- a/docs/_layouts/default.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - {% if page.title %}{{ page.title }} – {{ site.name }}{% else %}{{ site.description }} – {{ site.name }}{% endif %} - {% include meta.html %} - - - - - {% include navbar.html %} - -
- - {{ content }} - -
- - {% include footer.html %} - - - - - - diff --git a/docs/activitystreams-types.md b/docs/activitystreams-types.md deleted file mode 100644 index 513837d..0000000 --- a/docs/activitystreams-types.md +++ /dev/null @@ -1,250 +0,0 @@ ---- -layout: default -permalink: activitystreams-types.html -title: ActivityStreams 2.0 types in PHP -excerpt: Usage of ActivityStreams 2.0 types in PHP. ---- - -ActivityStreams types -===================== - -ActivityStreams 2.0 defines a standardized collection of objects called -Vocabulary. - -This collection is divided into 2 parts: Core Types and Extended Types. - -Extended Types are divided into 3 parts: Actor, Activity and Object -Types. - -In this manual, we'll see how they are implemented in ActivityPhp and -how to use them. - -________________________________________________________________________ - - -- [ActivityStreams Core Types]({{ site.doc_baseurl }}/activitystreams-types.html#activitystreams-core-types) -- [ActivityStreams Extended Types]({{ site.doc_baseurl }}/activitystreams-types.html#activitystreams-extended-types) - - [Actor Types]({{ site.doc_baseurl }}/activitystreams-types.html#actor-types) - - [Activity Types]({{ site.doc_baseurl }}/activitystreams-types.html#activity-types) - - [Object Types]({{ site.doc_baseurl }}/activitystreams-types.html#object-types) -- [Custom types]({{ site.doc_baseurl }}/activitystreams-types.html#custom-types) -- [Real world examples]({{ site.doc_baseurl }}/activitystreams-types.html#real-world-examples) - -________________________________________________________________________ - -ActivityStreams Core Types --------------------------- - -Core types are __Activity__, __Collection__, __CollectionPage__, -__IntransitiveActivity__, __Link__, __Object__, __OrderedCollection__ -and __OrderedCollectionPage__. - -They are all provided in the __ActivityPhp\Type\Core__ namespace. - -```php -use ActivityPhp\Type\Core\Activity; -use ActivityPhp\Type\Core\Collection; -use ActivityPhp\Type\Core\CollectionPage; -use ActivityPhp\Type\Core\IntransitiveActivity; -use ActivityPhp\Type\Core\Link; -use ActivityPhp\Type\Core\ObjectType; // Object is a reserved keyword in PHP -use ActivityPhp\Type\Core\OrderedCollection; -use ActivityPhp\Type\Core\OrderedCollectionPage; -``` - -Instead of using them with namespace imports (use ...), you may wish to -call them by their short names with only one import using the *Type* -factory. - -```php -use ActivityPhp\Type; - -$activity = Type::create('Activity'); -$collection = Type::create('Collection'); -$collectionPage = Type::create('CollectionPage'); -$intransitiveActivity = Type::create('IntransitiveActivity'); -$link = Type::create('Link'); -$object = Type::create('ObjectType'); -$object = Type::create('Object'); -$orderedCollection = Type::create('OrderedCollection'); -$orderedCollectionPage = Type::create('OrderedCollectionPage'); -``` - -Note that the Object type can be called in 2 ways. - -________________________________________________________________________ - -ActivityStreams Extended Types ------------------------------- - -All extended types are provided: - -### Actor types - -They are all provided in the -__ActivityPhp\Type\Extended\Actor__ namespace. - -```php -use ActivityPhp\Type\Extended\Actor\Application; -use ActivityPhp\Type\Extended\Actor\Group; -use ActivityPhp\Type\Extended\Actor\Organization; -use ActivityPhp\Type\Extended\Actor\Person; -use ActivityPhp\Type\Extended\Actor\Service; -``` - -Like Core types, you may wish to call them by their short names using -the *Type* factory. - -```php -use ActivityPhp\Type; - -$application = Type::create('Application'); -$group = Type::create('Group'); -$organization = Type::create('Organization'); -$person = Type::create('Person'); -$service = Type::create('Service'); -``` - -### Activity types - -They are all provided in the -__ActivityPhp\Type\Extended\Activity__ namespace. - -```php -use ActivityPhp\Type\Extended\Activity\Accept; -use ActivityPhp\Type\Extended\Activity\Add; -use ActivityPhp\Type\Extended\Activity\Announce; -use ActivityPhp\Type\Extended\Activity\Arrive; -use ActivityPhp\Type\Extended\Activity\Block; -use ActivityPhp\Type\Extended\Activity\Create; -use ActivityPhp\Type\Extended\Activity\Delete; -use ActivityPhp\Type\Extended\Activity\Dislike; -use ActivityPhp\Type\Extended\Activity\Flag; -use ActivityPhp\Type\Extended\Activity\Follow; -use ActivityPhp\Type\Extended\Activity\Ignore; -use ActivityPhp\Type\Extended\Activity\Invite; -use ActivityPhp\Type\Extended\Activity\Join; -use ActivityPhp\Type\Extended\Activity\Leave; -use ActivityPhp\Type\Extended\Activity\Like; -use ActivityPhp\Type\Extended\Activity\Listen; -use ActivityPhp\Type\Extended\Activity\Move; -use ActivityPhp\Type\Extended\Activity\Offer; -use ActivityPhp\Type\Extended\Activity\Question; -use ActivityPhp\Type\Extended\Activity\Read; -use ActivityPhp\Type\Extended\Activity\Reject; -use ActivityPhp\Type\Extended\Activity\Remove; -use ActivityPhp\Type\Extended\Activity\TentativeAccept; -use ActivityPhp\Type\Extended\Activity\TentativeReject; -use ActivityPhp\Type\Extended\Activity\Travel; -use ActivityPhp\Type\Extended\Activity\Undo; -use ActivityPhp\Type\Extended\Activity\Update; -use ActivityPhp\Type\Extended\Activity\View; -``` - -As usual, you may wish to call them by their short names using the -*Type* factory. - -```php -use ActivityPhp\Type; - -$accept = Type::create('Accept'); -$add = Type::create('Add'); -$announce = Type::create('Announce'); -$arrive = Type::create('Arrive'); -$block = Type::create('Block'); -$create = Type::create('Create'); -$delete = Type::create('Delete'); -$dislike = Type::create('Dislike'); -$flag = Type::create('Flag'); -$follow = Type::create('Follow'); -$ignore = Type::create('Ignore'); -$invite = Type::create('Invite'); -$join = Type::create('Join'); -$leave = Type::create('Leave'); -$like = Type::create('Like'); -$listen = Type::create('Listen'); -$move = Type::create('Move'); -$offer = Type::create('Offer'); -$question = Type::create('Question'); -$read = Type::create('Read'); -$reject = Type::create('Reject'); -$remove = Type::create('Remove'); -$tentativeAccept = Type::create('TentativeAccept'); -$tentativeReject = Type::create('TentativeReject'); -$travel = Type::create('Travel'); -$undo = Type::create('Undo'); -$update = Type::create('Update'); -$view = Type::create('View'); - -``` - - -### Object types - -They are all provided in the -__ActivityPhp\Type\Extended\Object__ namespace. - -```php -use ActivityPhp\Type\Extended\Object\Article; -use ActivityPhp\Type\Extended\Object\Audio; -use ActivityPhp\Type\Extended\Object\Document; -use ActivityPhp\Type\Extended\Object\Event; -use ActivityPhp\Type\Extended\Object\Image; -use ActivityPhp\Type\Extended\Object\Mention; -use ActivityPhp\Type\Extended\Object\Note; -use ActivityPhp\Type\Extended\Object\Page; -use ActivityPhp\Type\Extended\Object\Place; -use ActivityPhp\Type\Extended\Object\Profile; -use ActivityPhp\Type\Extended\Object\Relationship; -use ActivityPhp\Type\Extended\Object\Tombstone; -use ActivityPhp\Type\Extended\Object\Video; -``` - -As usual, you may wish to call them by their short names using the -*Type* factory. - -```php -use ActivityPhp\Type; - -$article = Type::create('Article'); -$audio = Type::create('Audio'); -$document = Type::create('Document'); -$event = Type::create('Event'); -$image = Type::create('Image'); -$mention = Type::create('Mention'); -$note = Type::create('Note'); -$page = Type::create('Page'); -$place = Type::create('Place'); -$profile = Type::create('Profile'); -$relationship = Type::create('Relationship'); -$tombstone = Type::create('Tombstone'); -$video = Type::create('Video'); - -``` - -________________________________________________________________________ - -Custom Types ------------- - -If you would like to create custom types, you may extend existing types. - -An example is given in -[this part of the manual]({{ site.doc_baseurl }}#use-your-own-extended-types). - -________________________________________________________________________ - -Real world examples -------------------- - -These examples are illustrating how to easily use implemented types to -customize your models. - -- [Fetch Peertube Outbox activities]({{ site.doc_baseurl }}/fetch-peertube-outbox-activities.html) - - -________________________________________________________________________ - - -{% capture doc_url %}{{ site.doc_repository_url }}/activitystreams-types.md{% endcapture %} -{% include edit-doc-link.html %} diff --git a/docs/assets/css/style.scss b/docs/assets/css/style.scss deleted file mode 100644 index 82a6643..0000000 --- a/docs/assets/css/style.scss +++ /dev/null @@ -1,110 +0,0 @@ ---- ---- - -/* - generated by rouge http://rouge.jneen.net/ - original base16 by Chris Kempson (https://github.com/chriskempson/base16) -*/ - -.highlight table td { padding: 5px; } -.highlight table pre { margin: 0; } -.highlight, .highlight .w { - color: #d0d0d0; -} -.highlight .err { - color: #151515; - background-color: #ac4142; -} -.highlight .c, .highlight .cd, .highlight .cm, .highlight .c1, .highlight .cs { - color: #888; -} -.highlight .cp { - color: #f4bf75; -} -.highlight .nt { - color: #f4bf75; -} -.highlight .o, .highlight .ow { - color: #d0d0d0; -} -.highlight .p, .highlight .pi { - color: #d0d0d0; -} -.highlight .gi { - color: #90a959; -} -.highlight .gd { - color: #ac4142; -} -.highlight .gh { - color: #6a9fb5; - font-weight: bold; -} -.highlight .k, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kv { - color: #aa759f; -} -.highlight .kc { - color: #d28445; -} -.highlight .kt { - color: #d28445; -} -.highlight .kd { - color: #d28445; -} -.highlight .s, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .s2, .highlight .sh, .highlight .sx, .highlight .s1 { - color: #90a959; -} -.highlight .sr { - color: #75b5aa; -} -.highlight .si { - color: #8f5536; -} -.highlight .se { - color: #8f5536; -} -.highlight .nn { - color: #f4bf75; -} -.highlight .nc { - color: #f4bf75; -} -.highlight .no { - color: #f4bf75; -} -.highlight .na { - color: #6a9fb5; -} -.highlight .m, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mb, .highlight .mx { - color: #90a959; -} -.highlight .ss { - color: #90a959; -} - -/********************************************************************** - * Custom highlights - **********************************************************************/ -.hljs{ - border: 1px solid #ddd; - background: #fafafa; - border-radius: 4px; -} -.hljs-keyword{ - color: #aa759f; - -} -.hljs .nx, .hljs .o, .hljs .p, .hljs .na{ - color: #aa759f; - font-weight: bold; -} - -/********************************************************************** - * navbar - **********************************************************************/ -.navbar-activitypub{ - background-color:#fff; - -webkit-box-shadow:0 2px 4px rgba(0,0,0,.04); - box-shadow:0 2px 4px rgba(0,0,0,.04) -} diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index 1eb45f8..0000000 --- a/docs/conf.py +++ /dev/null @@ -1,75 +0,0 @@ -import sys, os -from sphinx.highlighting import lexers -from pygments.lexers.web import PhpLexer - -extensions = [ - 'sphinxcontrib.phpdomain' -] - -lexers['php'] = PhpLexer(startinline=True) -lexers['php-annotations'] = PhpLexer(startinline=True) -primary_domain = 'php' -highlight_language = 'php' - -templates_path = ['_templates'] -source_suffix = '.rst' -master_doc = 'index' -project = u'ActivityPhp' -copyright = u'rtio' -version = '1' -html_title = "ActivityPhp Documentation" -html_short_title = "ActivityPhp" - -exclude_patterns = ['_build'] -html_static_path = ['_static'] - -#### sphinx theme -html_theme = 'sphinx_rtd_theme' -html_theme_options = { - 'collapse_navigation': True, - 'display_version': False -} - -# Custom sidebar templates, maps document names to template names. -html_sidebars = { - '**': ['logo-text.html', 'globaltoc.html', 'searchbox.html'] -} - -# Register the theme as an extension to generate a sitemap.xml -extensions.append("sphinx_rtd_theme") - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -html_show_sphinx = False - -# Theme options (see theme.conf for more information) -html_theme_options = { - - # Set the path to a special layout to include for the homepage - # "index_template": "homepage.html", - - # Allow a separate homepage from the master_doc - # homepage = index - - # Set the name of the project to appear in the nav menu - # "project_nav_name": "ActivityPhp API", - - # Set your Disqus short name to enable comments - # "disqus_comments_shortname": "my_disqus_comments_short_name", - - # Set you GA account ID to enable tracking - # "google_analytics_account": "my_ga_account", - - # Path to a touch icon - # "touch_icon": "", - - # Specify a base_url used to generate sitemap.xml links. If not - # specified, then no sitemap will be built. - # Not supported by the default theme - # "base_url": "https://activityphp.readthedocs.io" - - # Allow the "Table of Contents" page to be defined separately from "master_doc" - # tocpage = Contents - - # Allow the project link to be overriden to a custom URL. - # projectlink = http://myproject.url -} diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index 02b2f0c..0000000 --- a/docs/index.md +++ /dev/null @@ -1,527 +0,0 @@ ---- -layout: default ---- - -[![Build Status](https://app.travis-ci.com/rtio/activitypub-core.svg?branch=master)](https://app.travis-ci.com/rtio/activitypub-core) -[![Test Coverage](https://api.codeclimate.com/v1/badges/72317e4f93b477359432/test_coverage)](https://codeclimate.com/github/rtio/activitypub-core/test_coverage) - -**ActivityPhp** is an implementation of ActivityPub layers in PHP. - -It provides two layers: - -- A __client to server protocol__, or "Social API" - This protocol permits a client to act on behalf of a user. -- A [__server to server protocol__]({{ site.doc_baseurl }}/#server), or "Federation Protocol" - This protocol is used to distribute activities between actors on - different servers, tying them into the same social graph. - -As the two layers are implemented, it aims to be an ActivityPub -conformant Federated Server. - -All [normalized types]({{ site.doc_baseurl }}/activitystreams-types.html) -are implemented too. If you need to create a new one, just extend -existing implementations. - -________________________________________________________________________ - -Basics ------- - -- [Install]({{ site.doc_baseurl }}/#install) -- [Requirements]({{ site.doc_baseurl }}/#requirements) -- [Types]({{ site.doc_baseurl }}/#types) - - [Type factory]({{ site.doc_baseurl }}/#type-factory) - - [Properties names]({{ site.doc_baseurl }}/#properties-names) - - [All properties and their values]({{ site.doc_baseurl }}/#all-properties-and-their-values) - - [JSON export]({{ site.doc_baseurl }}/#json-export) - - [Set several properties]({{ site.doc_baseurl }}/#set-several-properties) - - [Get a property]({{ site.doc_baseurl }}/#get-a-property) - - [Set a property]({{ site.doc_baseurl }}/#set-a-property) - - [Check if property exists]({{ site.doc_baseurl }}/#check-if-property-exists) - - [Create a copy]({{ site.doc_baseurl }}/#create-a-copy) - - [Use native types]({{ site.doc_baseurl }}/#use-native-types) - - [Use your own extended types]({{ site.doc_baseurl }}/#use-your-own-extended-types) - - [Create your own property validator]({{ site.doc_baseurl }}/#create-your-own-property-validator) - - [Dialects management]({{ site.doc_baseurl }}/activitypub-dialects-management.html) - -________________________________________________________________________ - -Requirements ------------- - -- Supports PHP 7.2+ | 8.0 - -________________________________________________________________________ - -Install -------- - -```sh -composer require rtio/activitypub-core -``` -________________________________________________________________________ - -Types ------ - -### Type factory - -You can instantiate ActivityStreams types using their short name. - -```php -use ActivityPhp\Type; - -$link = Type::create('Link'); -$note = Type::create('Note'); - -``` - -Instantiate a type and setting properties is possible with the second -parameter. - -```php -use ActivityPhp\Type; - -$note = Type::create('Note', [ - 'content' => 'A content for my note' -]); - -``` - -Starting from an array with a 'type' key, it's even possible to directly -instantiate your type. - -```php -use ActivityPhp\Type; - -$array = [ - 'type' => 'Note', - 'content' => 'A content for my note' -]; - -$note = Type::create($array); - -``` - -You may create a type from a JSON string with the `fromJson()` method. -JSON must have a `type` key. - -```php -use ActivityPhp\Type; - -$json = ' -{ - "type": "Note", - "content": "A content for my note" -}'; - -$note = Type::fromJson($json); - -``` - -When a property does not exist, an Exception is thrown in strict mode. -You can define 3 different behaviours: - -- throw an exception (default=strict) -- ignore property (ignore) -- set property (include) - -```php -use ActivityPhp\Type; -use ActivityPhp\Type\TypeConfiguration; - -$note = Type::create('Note'); - -// Ignore mode -TypeConfiguration::set('undefined_properties', 'ignore'); -$note->undefinedProperty = 'https://example.com/custom-notes/1'; -echo $note->undefinedProperty; // null - -// Include mode -TypeConfiguration::set('undefined_properties', 'include'); -$note->undefinedProperty = 'https://example.com/custom-notes/1'; -echo $note->undefinedProperty; // https://example.com/custom-notes/1 - -// Strict mode -TypeConfiguration::set('undefined_properties', 'strict'); -$note->undefinedProperty = 'https://example.com/custom-notes/1'; // Exception - -``` -________________________________________________________________________ - - -### Properties names - -Whatever be your object or link, you can get all properties names with -`getProperties()` method. - -```php -use ActivityPhp\Type; - -$link = Type::create('Link'); - -print_r( $link->getProperties() ); -``` - -Would output something like: - -``` -Array -( - [0] => type - [1] => id - [2] => name - [3] => nameMap - [4] => href - [5] => hreflang - [6] => mediaType - [7] => rel - [8] => height - [9] => preview - [10] => width -) -``` - -________________________________________________________________________ - -### All properties and their values - -In order to dump all properties and associated values, use `toArray()` -method. - -```php -use ActivityPhp\Type; - -$link = Type::create('Link'); -$link->setName('An example'); -$link->setHref('http://example.com'); - -print_r( - $link->toArray() -); -``` - -Would output something like: - -``` -Array -( - [type] => Link - [name] => An example - [href] => http://example.com -) -``` - -________________________________________________________________________ - -### JSON export - -In order to export a type as JSON, use `toJson()` method. - -```php -use ActivityPhp\Type; - -$link = Type::create('Link'); -$link->setName('An example'); -$link->setHref('http://example.com'); - -echo $link->toJson(); -``` - -Would output something like: - -``` -{"type":"Link","name":"An example","href":"http:\/\/example.com"} - -``` - -It's possible to give PHP JSON options as parameter - -```php -use ActivityPhp\Type; - -$link = Type::create('Link'); -$link->setName('An example'); -$link->setHref('http://example.com'); - -echo $link->toJson(JSON_PRETTY_PRINT); -``` - -Would output something like: - -``` -{ - "type": "Link", - "name": "An example", - "href": "http:\/\/example.com" -} - -``` -________________________________________________________________________ - -### Get a property - -There are 3 equivalent ways to get a value. - -```php -use ActivityPhp\Type; - -$note = Type::create('Note'); - -// Each method returns the same value -echo $note->id; -echo $note->get('id'); -echo $note->getId(); -``` - -________________________________________________________________________ - -### Set a property - -There are 3 equivalent ways to set a value. - -```php -use ActivityPhp\Type; - -$note = Type::create('Note'); - -$note->id = 'https://example.com/custom-notes/1'; -$note->set('id', 'https://example.com/custom-notes/1'); -$note->setId('https://example.com/custom-notes/1'); - -``` - -Whenever you assign a value, the format of this value is checked. - -This action is made by a validator. If rules are not respected an -Exception is thrown. - -When a property does not exist, an Exception is thrown in strict mode. -You can define 3 different behaviours: - -- throw an exception (default=strict) -- ignore property (ignore) -- set property (include) - -```php -use ActivityPhp\Type; -use ActivityPhp\Type\TypeConfiguration; - -$note = Type::create('Note'); - -// Ignore mode -TypeConfiguration::set('undefined_properties', 'ignore'); -$note->undefinedProperty = 'https://example.com/custom-notes/1'; -echo $note->undefinedProperty; // null - -// Include mode -TypeConfiguration::set('undefined_properties', 'include'); -$note->undefinedProperty = 'https://example.com/custom-notes/1'; -echo $note->undefinedProperty; // https://example.com/custom-notes/1 - -// Strict mode -TypeConfiguration::set('undefined_properties', 'strict'); -$note->undefinedProperty = 'https://example.com/custom-notes/1'; // Exception - -``` -________________________________________________________________________ - -### Set several properties - -With __Type factory__, you can instanciate a type and set several -properties. - -```php -use ActivityPhp\Type; - -$note = Type::create('Note', [ - 'id' => 'https://example.com/custom-notes/1', - 'name' => 'An important note', -]); - -``` -________________________________________________________________________ - - -### Check if property exists - -```php -use ActivityPhp\Type; - -$note = Type::create('Note'); - -echo $note->has('id'); // true -echo $note->has('anotherProperty'); // false - -``` -________________________________________________________________________ - - -### Create a copy - -Sometimes you may use a copy in order not to affect values of the -original type. - - -```php -use ActivityPhp\Type; - -$note = Type::create('Note', ['name' => 'Original name']); - -$copy = $note->copy()->setName('Copy name'); - -echo $copy->name; // Copy name -echo $note->name; // Original name -``` - -You can copy and chain methods to affect only values of the copied type. - -________________________________________________________________________ - -### Use native types - -All core and extended types can be used with a classic instanciation. - -```php -use ActivityPhp\Type\Extended\Object\Note; - -$note = new Note(); -``` - -Same way with the Type factory: - -```php -use ActivityPhp\Type; - -$note = Type::create('Note'); -``` - -________________________________________________________________________ - - -### Use your own extended types - -If you need some custom attributes, you can extend predefined types. - -- Define your custom type and add it to the pool: - -```php -use ActivityPhp\Type\Extended\Object\Note; - -// Define -class MyNote extends Note -{ - // Override basic type - protected $type = 'CustomNote'; - - // Custom property - protected $myProperty; -} - -// Add a custom class definition (, ) -Type::add('MyNote', MyNote::class); - -``` - -There are 2 ways to instanciate a type: - -- A classic PHP call: - -```php -$note = new MyNote(); -$note->id = 'https://example.com/custom-notes/1'; -$note->myProperty = 'Custom Value'; - -echo $note->getMyProperty(); // Custom Value - -``` - -- With the Type factory: - -```php -use ActivityPhp\Type; - -// Now the new object type is available -$note = Type::create('MyNote', [ - 'id' => 'https://example.com/custom-notes/1', - 'myProperty' => 'Custom Value' -]); -``` - -Extending types preserves benefits of getters, setters and -their validators. - -________________________________________________________________________ - - -### Create your own property validator - -Use a custom property validator when you define custom attributes or -when you want to override ActivityPub attribute default validation. - -Regarding to previous example with a custom attribute `$myProperty`, if -you try to set this property, it would be done without any check on -values you're providing. - -You can easily cope with that implementing a custom validator using -`Validator`. - -```php -use ActivityPhp\Type\ValidatorInterface; -use ActivityPhp\Type\Validator; - -// Create a custom validator that implements ValidatorInterface -class MyPropertyValidator implements ValidatorInterface -{ - // A public validate() method is mandatory - public function validate($value, $container) - { - return true; - } -} - -// Attach this custom validator to a property -Validator::add('myProperty', MyPropertyValidator::class); - -// Now all values are checked with the validate() method -// 'myProperty' is passed to the first argument -// $note is passed to the second one. - -$note->myProperty = 'Custom Value'; - -``` - -An equivalent way is to use Type factory and `addValidator()` method: - -```php -use ActivityPhp\Type; - -// Attach this custom validator to a property -Type::addValidator('myProperty', MyPropertyValidator::class); - -``` -________________________________________________________________________ - -Now that we know how to use types, let's see what types are implemented -and how to use them thanks to -[the ActivityStreams Types manual]({{ site.doc_baseurl }}/activitystreams-types.html). - -________________________________________________________________________ - -More ----- - -- [Contribute on Github](https://github.com/rtio/activitypub-core) - -- [ActivityPub](https://www.w3.org/TR/activitypub/) - -- [ActivityStreams 2.0](https://www.w3.org/TR/activitystreams-core/) - -- [JSON-LD](https://www.w3.org/TR/json-ld/) - -________________________________________________________________________ - - - -{% capture doc_url %}{{ site.doc_repository_url }}/index.md{% endcapture %} -{% include edit-doc-link.html %} diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index 5b421bf..0000000 --- a/docs/index.rst +++ /dev/null @@ -1,63 +0,0 @@ -.. title:: ActivityPhp manual -.. meta:: - :description: ActivityPhp is an implementation of the ActivityPub and ActivityStreams layers in PHP. - :keywords: ActivityPhp ActivityPub ActivityStreams Federation Server Client - :author: Landrok - - -========================= -ActivityPhp Documentation -========================= - -|latest-stable| |build-status| |license| - -**ActivityPhp** is an implementation of ActivityPub layers in PHP. - -It provides two layers: - -- A __client to server protocol__, or "Social API" - This protocol permits a client to act on behalf of a user. -- A [__server to server protocol__]({{ site.doc_baseurl }}/#server), or "Federation Protocol" - This protocol is used to distribute activities between actors on - different servers, tying them into the same social graph. - -As the two layers are implemented, it aims to be an ActivityPub -conformant Federated Server. - -All [normalized types]({{ site.doc_baseurl }}/activitystreams-types.html) -are implemented too. If you need to create a new one, just extend -existing implementations. - -.. code-block:: php - - use ActivityPhp\Server; - use ActivityPhp\Type; - - $note = Type::create('Note'); - - $note = Type::create('Note', [ - 'content' => 'A content for my note' - ]); - - $array = [ - 'type' => 'Note', - 'content' => 'A content for my note' - ]; - - $note = Type::create($array); - - $server = new Server(); - - - -.. |build-status| image:: https://api.travis-ci.org/landrok/activitypub.svg?branch=master - :alt: Build status - :target: https://travis-ci.org/landrok/activitypub - -.. |latest-stable| image:: https://poser.pugx.org/landrok/activitypub/version.svg - :alt: Latest - :target: https://github.com/landrok/activitypub/releases - -.. |license| image:: https://poser.pugx.org/landrok/activitypub/license.svg - :alt: License - :target: https://packagist.org/packages/landrok/activitypub diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 5c6d5d8..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -Sphinx>=1.6.5 -sphinx_rtd_theme>=0.3.0 -sphinxcontrib-phpdomain diff --git a/docs/types/activitypub-dialects-management.md b/docs/types/activitypub-dialects-management.md deleted file mode 100644 index 93837a6..0000000 --- a/docs/types/activitypub-dialects-management.md +++ /dev/null @@ -1,178 +0,0 @@ ---- -layout: default -permalink: activitypub-dialects-management.html -title: Extending ActivityPub Vocabulary with custom dialects -excerpt: How to implement a custom dialect on top of the ActivityPub Vocabulary in PHP. ---- - -ActivityPub dialects -==================== - -In a previous example, we've seen how to extend ActivityPub types with -types customization, extending PHP class. - -There is another method to dynamically extend defined types or to define -new ones. - -This method is based on `ActivityPhp\Type\Dialect` tool. - -In this manual, we'll only see basics of its API. For more practical -aspects, there is a [dedicated example in server's part]({{ site.doc_baseurl }}/fetch-peertube-outbox-activities-using-dialects.html). - -________________________________________________________________________ - - -- [Create a dialect]({{ site.doc_baseurl }}/activitypub-dialects-management.html#create-your-dialect) -- [Add and load your dialect]({{ site.doc_baseurl }}/activitypub-dialects-management.html#add-and-load-your-dialect) -- [Only add your dialect]({{ site.doc_baseurl }}/activitypub-dialects-management.html#only-add-your-dialect) -- [Load a particular dialect]({{ site.doc_baseurl }}/activitypub-dialects-management.html#load-a-particular-dialect) -- [Unload dialects]({{ site.doc_baseurl }}/activitypub-dialects-management.html#unload-dialects) - -________________________________________________________________________ - -Create your dialect -------------------- - -In order to create a new dialect, you have to extend -[ActivityPub types](activitystreams-types.html). - -Let's start with adding 2 properties to the Person type. - -```php -$dialect = [ - // Add fields to one type - 'Person' => ['featured', 'uuid'], -]; -``` - -Sometimes, you need to attach several properties to several types; - -```php -$dialect = [ - // Add fields to several types with | separator - 'Person|Application' => [ - 'featured', 'manuallyApprovesFollowers' - ], -]; -``` - -When a type does not exist, it is transparently created. - -```php -$dialect = [ - // Add fields to a new type - 'MyNewType' => [ - 'propertyOne', 'propertyTwo' - ], -]; -``` - -________________________________________________________________________ - -Add and load your dialect -------------------------- - -After defining it, you have to load it. - -```php -use ActivityPhp\Type; -use ActivityPhp\Type\Dialect; - -// Dialect definition -$dialect = [ - // Add fields to one type - 'Person' => ['featured', 'uuid'], -]; - -// Add and load this dialect -Dialect::add('mydialect', $dialect); - -// Now you can use this property -$person = Type::create('Person'); -$person->featured = true; - -``` - -Of course, you may accomplish that in one step: - -```php -use ActivityPhp\Type\Dialect; - -// Define, add and load this dialect -Dialect::add('mydialect', [ - // Add fields to one type - 'Person' => ['featured', 'uuid'], -]); - -``` - -________________________________________________________________________ - -Only add your dialect ---------------------- - -It may be useful to add a set of dialects without allowing them. - -It's the role of the 3rd parameter. Dialects definitions are stacked, -ready to be loaded but not usable. - -```php -use ActivityPhp\Type\Dialect; - -// Dialect definition -$dialect = [ - // Add fields to one type - 'Person' => ['featured', 'uuid'], -]; - -// Add 2 definitions but not load these dialects -Dialect::add('mydialect1', $dialect, false); -Dialect::add('mydialect2', $dialect, false); - -``` - -This way, your dialects are configurable as plugins among contexts. - -To complete this usage, you have a `Dialect::load()` method - -________________________________________________________________________ - -Load a particular dialect -------------------------- - -Based on previous example, you may now load specifically a particular -dialect. - -```php - -// Load only mydialect1 -Dialect::load('mydialect1'); - -// Load all available dialects -Dialect::load('*'); - -``` -________________________________________________________________________ - -Unload dialects ---------------- - -Sometimes, you need to keep only ActivityPub standard vocabulary. - -You can unload dialects. - -```php - -// Unload only mydialect1 -Dialect::unload('mydialect1'); - -// Unload all available dialects -Dialect::unload('*'); - -``` - -________________________________________________________________________ - - -{% capture doc_url %}{{ site.doc_repository_url }}/types/activitypub-dialects-management.md{% endcapture %} -{% include edit-doc-link.html %} diff --git a/docs/types/activitypub-ontologies-management.md b/docs/types/activitypub-ontologies-management.md deleted file mode 100644 index 9636173..0000000 --- a/docs/types/activitypub-ontologies-management.md +++ /dev/null @@ -1,178 +0,0 @@ ---- -layout: default -permalink: activitypub-ontologies-management.html -title: Extending ActivityPub Vocabulary with custom ontology -excerpt: How to implement a custom ontology on top of the ActivityPub Vocabulary in PHP. ---- - -ActivityPub ontologies -==================== - -In a previous example, we've seen how to extend ActivityPub types with -[dialects]({{ site.doc_baseurl }}/activitypub-dialects-management.html). - -There is another method to dynamically extend defined types or to create -new ones. - -This method is based on `ActivityPhp\Type\Ontology` tool. - -In this manual, we'll only see basics of its API. For more practical -aspects, there is a [dedicated example in server's part]({{ site.doc_baseurl }}/fetch-peertube-outbox-activities-using-ontologies.html). - -________________________________________________________________________ - - -- [Create an ontology]({{ site.doc_baseurl }}/activitypub-ontologies-management.html#create-your-ontology) -- [Add and load your ontology]({{ site.doc_baseurl }}/activitypub-ontologies-management.html#add-and-load-your-ontology) -- [Only add your ontology]({{ site.doc_baseurl }}/activitypub-ontologies-management.html#only-add-your-ontology) -- [Load a particular ontology]({{ site.doc_baseurl }}/activitypub-ontologies-management.html#load-a-particular-ontology) -- [Unload ontologies]({{ site.doc_baseurl }}/activitypub-ontologies-management.html#unload-ontologies) -- [Contribute with your ontologies]({{ site.doc_baseurl }}/activitypub-ontologies-management.html#contribute-with-your-ontologies) - -________________________________________________________________________ - -Create your ontology -------------------- - -Before creating your own ontology, keep in mind that ActivityPub already -implements a lot of stuff. Check that they do not fit your needs before -reinventing the wheel :) - -In order to create a new ontology, you have to extend -`ActivityPhp\Type\OntologyBase` class. - -If you want to see a complete and working ontology, let's see -[Peertube's one]({{ site.repository_url }}/tree/master/src/ActivityPhp/Type/Ontology/Peertube.php). - -Let's define our simple ontology. - -```php -use ActivityPhp\Type\OntologyBase; - -abstract class SimpleOntology extends OntologyBase -{ - /** - * A definition of dialect to overload Activity Streams - * vocabulary. - * - * @var array - */ - protected static $definitions = [ - 'Group' => ['myNewProperty'], - ]; -} - -``` - -When a type (Group in previous example) does not exist, it is -transparently created. - -________________________________________________________________________ - -Add and load your ontology --------------------------- - -After defining it, you have to load it. - -```php -use ActivityPhp\Type; -use ActivityPhp\Type\Ontology; - - -// Add and load this ontology -Ontology::add('simple-ontology', SimpleOntology::class); - -// Now you can use this property -$group = Type::create('Group'); -$group->myNewProperty = true; - -``` - -Of course, you may accomplish that in a server context - -```php -use ActivityPhp\Server; - -// Create a server instance and allow our simple ontology -$server = new Server([ - 'ontologies' => [ - 'simple-ontology' => SimpleOntology::class, - ] -]); - -``` - -________________________________________________________________________ - -Only add your ontology ----------------------- - -It may be useful to add a set of dialects without allowing them. - -It's the role of the 3rd parameter. Ontology definitions are stacked, -ready to be loaded but not usable. - -```php -use ActivityPhp\Type\Ontology; - -// Add 2 definitions but don't load these dialects -Ontology::add('simple-ontology', SimpleOntology::class, false); - -``` - -This way, your ontologies are configurable as plugins among contexts. - -To complete this usage, you have a `Ontology::load()` method - -________________________________________________________________________ - -Load a particular ontology --------------------------- - -Based on previous example, you may now load specifically a particular -ontology. - -```php - -// Load only simple ontology -Ontology::load('mydialect1'); - -// Load all available ontologies -Ontology::load('*'); - -``` -________________________________________________________________________ - -Unload ontologies ------------------ - -Sometimes, you need to keep only ActivityPub standard vocabulary. - -You can unload ontologies. - -```php - -// Unload only simple ontolgy -Ontology::unload('simple-ontology'); - -// Unload all available ontologies -Ontology::unload('*'); - -``` - -________________________________________________________________________ - - -Contribute with your ontologies -------------------------------- - -This feature is made to ease implementation of major ontologies -(Mastodon, Peertube, Pixelfed, etc...). - -If you successfully implemented a new one, feel free to contribute with -a [pull request]({{ site.repository_url }})! - - - -{% capture doc_url %}{{ site.doc_repository_url }}/types/activitypub-ontologies-management.md{% endcapture %} -{% include edit-doc-link.html %}