diff --git a/composer.json b/composer.json index 0828a515d23f506f72af71361b533e54386fb518..ddf47155deedac9f3184db0228008bfb326fb066 100644 --- a/composer.json +++ b/composer.json @@ -57,7 +57,8 @@ "symfony/doctrine-bridge": "^7.0", "bref/bref": "^2.1", "symfony/http-foundation": "^7.0", - "symfony/expression-language": "^7.0" + "symfony/expression-language": "^7.0", + "embed/embed": "^4.4" }, "require-dev": { "phpunit/phpunit": "^11.0", diff --git a/composer.lock b/composer.lock index 041c89f9f680f82d2ff3c6eb44e27d8ec2055b3a..af6f6e380d6f6cf86c6d36d0b6119eb78455baca 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ef6348bdeee54a23ab896acae84599e3", + "content-hash": "93d0e2fe2c71e7ea9f7c17b349067d52", "packages": [ { "name": "amphp/amp", @@ -641,6 +641,82 @@ ], "time": "2024-03-15T10:23:05+00:00" }, + { + "name": "composer/ca-bundle", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0c5ccfcfea312b5c5a190a21ac5cef93f74baf99", + "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.10", + "psr/log": "^1.0", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.5.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-03-15T14:00:32+00:00" + }, { "name": "crwlr/query-string", "version": "v1.0.3", @@ -2048,6 +2124,95 @@ ], "time": "2023-10-06T06:47:41+00:00" }, + { + "name": "embed/embed", + "version": "v4.4.10", + "source": { + "type": "git", + "url": "https://github.com/oscarotero/Embed.git", + "reference": "8ac21505d048e8796c6cb9172ec5e81e5d0e0408" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/oscarotero/Embed/zipball/8ac21505d048e8796c6cb9172ec5e81e5d0e0408", + "reference": "8ac21505d048e8796c6cb9172ec5e81e5d0e0408", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0", + "ext-curl": "*", + "ext-dom": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ml/json-ld": "^1.1", + "oscarotero/html-parser": "^0.1.4", + "php": "^7.4|^8", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0|^2.0" + }, + "require-dev": { + "brick/varexporter": "^0.3.1", + "friendsofphp/php-cs-fixer": "^2.0", + "nyholm/psr7": "^1.2", + "oscarotero/php-cs-fixer-config": "^1.0", + "phpunit/phpunit": "^9.0", + "symfony/css-selector": "^5.0" + }, + "suggest": { + "symfony/css-selector": "If you want to get elements using css selectors" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Embed\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oscar Otero", + "email": "oom@oscarotero.com", + "homepage": "http://oscarotero.com", + "role": "Developer" + } + ], + "description": "PHP library to retrieve page info using oembed, opengraph, etc", + "homepage": "https://github.com/oscarotero/Embed", + "keywords": [ + "embed", + "embedly", + "oembed", + "opengraph", + "twitter cards" + ], + "support": { + "email": "oom@oscarotero.com", + "issues": "https://github.com/oscarotero/Embed/issues", + "source": "https://github.com/oscarotero/Embed/tree/v4.4.10" + }, + "funding": [ + { + "url": "https://paypal.me/oscarotero", + "type": "custom" + }, + { + "url": "https://github.com/oscarotero", + "type": "github" + }, + { + "url": "https://www.patreon.com/misteroom", + "type": "patreon" + } + ], + "time": "2023-12-10T12:30:47+00:00" + }, { "name": "ezyang/htmlpurifier", "version": "v4.17.0", @@ -4430,6 +4595,110 @@ ], "time": "2023-11-24T15:40:42+00:00" }, + { + "name": "ml/iri", + "version": "1.1.4", + "target-dir": "ML/IRI", + "source": { + "type": "git", + "url": "https://github.com/lanthaler/IRI.git", + "reference": "cbd44fa913e00ea624241b38cefaa99da8d71341" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lanthaler/IRI/zipball/cbd44fa913e00ea624241b38cefaa99da8d71341", + "reference": "cbd44fa913e00ea624241b38cefaa99da8d71341", + "shasum": "" + }, + "require": { + "lib-pcre": ">=4.0", + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "ML\\IRI": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Markus Lanthaler", + "email": "mail@markus-lanthaler.com", + "homepage": "http://www.markus-lanthaler.com", + "role": "Developer" + } + ], + "description": "IRI handling for PHP", + "homepage": "http://www.markus-lanthaler.com", + "keywords": [ + "URN", + "iri", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/lanthaler/IRI/issues", + "source": "https://github.com/lanthaler/IRI/tree/master" + }, + "time": "2014-01-21T13:43:39+00:00" + }, + { + "name": "ml/json-ld", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/lanthaler/JsonLD.git", + "reference": "537e68e87a6bce23e57c575cd5dcac1f67ce25d8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lanthaler/JsonLD/zipball/537e68e87a6bce23e57c575cd5dcac1f67ce25d8", + "reference": "537e68e87a6bce23e57c575cd5dcac1f67ce25d8", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ml/iri": "^1.1.1", + "php": ">=5.3.0" + }, + "require-dev": { + "json-ld/tests": "1.0", + "phpunit/phpunit": "^4" + }, + "type": "library", + "autoload": { + "psr-4": { + "ML\\JsonLD\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Markus Lanthaler", + "email": "mail@markus-lanthaler.com", + "homepage": "http://www.markus-lanthaler.com", + "role": "Developer" + } + ], + "description": "JSON-LD Processor for PHP", + "homepage": "http://www.markus-lanthaler.com", + "keywords": [ + "JSON-LD", + "jsonld" + ], + "support": { + "issues": "https://github.com/lanthaler/JsonLD/issues", + "source": "https://github.com/lanthaler/JsonLD/tree/1.2.1" + }, + "time": "2022-09-29T08:45:17+00:00" + }, { "name": "nette/php-generator", "version": "v4.1.4", @@ -4845,6 +5114,59 @@ ], "time": "2023-11-08T09:30:43+00:00" }, + { + "name": "oscarotero/html-parser", + "version": "v0.1.8", + "source": { + "type": "git", + "url": "https://github.com/oscarotero/html-parser.git", + "reference": "10f3219267a365d9433f2f7d1694209c9d436c8d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/oscarotero/html-parser/zipball/10f3219267a365d9433f2f7d1694209c9d436c8d", + "reference": "10f3219267a365d9433f2f7d1694209c9d436c8d", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.11", + "phpunit/phpunit": "^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "HtmlParser\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oscar Otero", + "email": "oom@oscarotero.com", + "homepage": "http://oscarotero.com", + "role": "Developer" + } + ], + "description": "Parse html strings to DOMDocument", + "homepage": "https://github.com/oscarotero/html-parser", + "keywords": [ + "dom", + "html", + "parser" + ], + "support": { + "email": "oom@oscarotero.com", + "issues": "https://github.com/oscarotero/html-parser/issues", + "source": "https://github.com/oscarotero/html-parser/tree/v0.1.8" + }, + "time": "2023-11-29T20:28:41+00:00" + }, { "name": "paragonie/random_compat", "version": "v9.99.100", diff --git a/docs/pages/docs/features/observability/observable-task-table/index.md b/docs/pages/docs/features/observability/observable-task-table/index.md index 0f23b9aa723cf48d05b681f297b3e1b04772c2f8..181e0f6b8fc2bea92b096a90120d28b9177d3dd9 100644 --- a/docs/pages/docs/features/observability/observable-task-table/index.md +++ b/docs/pages/docs/features/observability/observable-task-table/index.md @@ -14,6 +14,8 @@ description: > Observable task table is a shared memory table that stores the status of observable tasks. It is used to observe the status of long-running tasks. +https://www.youtube.com/watch?v=Ac5Ww4PBPlY + # Usage ## Updating Status of Observable Task diff --git a/resources/css/docs-page-document.css b/resources/css/docs-page-document.css index 77e3c3fdcae980b317d909f16fad0c02ecb572fb..02e4758521ef38e3af0a5b8b09dabf90ad64f1da 100644 --- a/resources/css/docs-page-document.css +++ b/resources/css/docs-page-document.css @@ -70,6 +70,11 @@ .documentation__article { grid-area: article; + + iframe { + align-self: center; + width: 100%; + } } .documentation__aside, diff --git a/src/StaticPageMarkdownParser.php b/src/StaticPageMarkdownParser.php index fa62488e2d2ad530d0aaefcce36320cd0a3bac00..d5f7c5197db45d751ae0032544a91dbc9d5624c8 100644 --- a/src/StaticPageMarkdownParser.php +++ b/src/StaticPageMarkdownParser.php @@ -6,11 +6,14 @@ namespace Distantmagic\Resonance; use Distantmagic\Resonance\Attribute\GrantsFeature; use Distantmagic\Resonance\Attribute\Singleton; +use Embed\Embed; use League\CommonMark\Environment\Environment; use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; use League\CommonMark\Extension\CommonMark\Node\Block\FencedCode; use League\CommonMark\Extension\CommonMark\Node\Inline\Code; use League\CommonMark\Extension\DescriptionList\DescriptionListExtension; +use League\CommonMark\Extension\Embed\Bridge\OscaroteroEmbedAdapter; +use League\CommonMark\Extension\Embed\EmbedExtension; use League\CommonMark\Extension\ExternalLink\ExternalLinkExtension; use League\CommonMark\Extension\GithubFlavoredMarkdownExtension; use League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkExtension; @@ -27,7 +30,23 @@ readonly class StaticPageMarkdownParser StaticPageAggregate $staticPageAggregate, StaticPageConfiguration $staticPageConfiguration, ) { + $embed = new Embed(); + $embed->setSettings([ + 'oembed:query_parameters' => [ + 'maxwidth' => 800, + 'maxheight' => 600, + ], + ]); + $this->environment = new Environment([ + 'embed' => [ + 'adapter' => new OscaroteroEmbedAdapter($embed), + 'allowed_domains' => [ + 'github.com', + 'youtube.com', + ], + 'fallback' => 'link', + ], 'external_link' => [ 'html_class' => 'external-link', 'internal_hosts' => [ @@ -44,6 +63,7 @@ readonly class StaticPageMarkdownParser $this->environment->addExtension(new CommonMarkCoreExtension()); $this->environment->addExtension(new DescriptionListExtension()); + $this->environment->addExtension(new EmbedExtension()); $this->environment->addExtension(new ExternalLinkExtension()); $this->environment->addExtension(new GithubFlavoredMarkdownExtension()); $this->environment->addExtension(new HeadingPermalinkExtension());