diff --git a/composer.json b/composer.json index 37593c2d6..7694e3163 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,8 @@ "phpdocumentor/guides-graphs": "^2.0@dev || ^1.0", "phpdocumentor/guides-markdown": "^2.0@dev || ^1.0", "phpdocumentor/guides-restructured-text": "^2.0@dev || ^1.0", - "phpdocumentor/guides-theme-bootstrap": "^2.0@dev || ^1.0" + "phpdocumentor/guides-theme-bootstrap": "^2.0@dev || ^1.0", + "phpdocumentor/guides-theme-rst": "^2.0@dev || ^1.0" }, "require-dev": { "ext-dom": "*", diff --git a/composer.lock b/composer.lock index 05555282b..ac24de967 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": "f83f0cdc167c36787e7026d10be5078e", + "content-hash": "a03662fdb7da89567982cd13c1a47e47", "packages": [ { "name": "dflydev/dot-access-data", @@ -1220,7 +1220,7 @@ "dist": { "type": "path", "url": "./packages/guides", - "reference": "639a663e7f7be15cde017d7564869534db7385f9" + "reference": "ec8d912809df7878d82010d34a3161c3ed97e946" }, "require": { "doctrine/deprecations": "^1.1", @@ -1232,9 +1232,9 @@ "php": "^8.1", "phpdocumentor/flyfinder": "^1.1", "psr/event-dispatcher": "^1.0", - "symfony/clock": "^6.4.7", - "symfony/http-client": "^6.4.7", - "symfony/string": "^6.4.7", + "symfony/clock": "^6.4.8", + "symfony/http-client": "^6.4.9", + "symfony/string": "^6.4.9", "symfony/translation-contracts": "^3.5.0", "twig/twig": "~2.15 || ^3.0", "webmozart/assert": "^1.11" @@ -1522,6 +1522,45 @@ "relative": true } }, + { + "name": "phpdocumentor/guides-theme-rst", + "version": "dev-main", + "dist": { + "type": "path", + "url": "./packages/guides-theme-rst", + "reference": "70ef007a53221f1c725d02d6cc71adb4e7648177" + }, + "require": { + "php": "^8.1", + "phpdocumentor/guides": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Guides\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "phpDocumentor\\Guides\\": [ + "tests/unit/" + ] + } + }, + "license": [ + "MIT" + ], + "description": "Adds a reStructuredText theme used to convert Markdown into reStructuredText", + "homepage": "https://www.phpdoc.org", + "transport-options": { + "relative": true + } + }, { "name": "psr/clock", "version": "1.0.0", @@ -1675,20 +1714,20 @@ }, { "name": "psr/http-factory", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", + "php": ">=7.1", "psr/http-message": "^1.0 || ^2.0" }, "type": "library", @@ -1712,7 +1751,7 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -1724,9 +1763,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2023-04-10T20:10:41+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", @@ -1911,16 +1950,16 @@ }, { "name": "symfony/clock", - "version": "v6.4.7", + "version": "v6.4.8", "source": { "type": "git", "url": "https://github.com/symfony/clock.git", - "reference": "83667074bdae743f8cd884ac50b266d2af287ea8" + "reference": "7a4840efd17135cbd547e41ec49fb910ed4f8b98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/clock/zipball/83667074bdae743f8cd884ac50b266d2af287ea8", - "reference": "83667074bdae743f8cd884ac50b266d2af287ea8", + "url": "https://api.github.com/repos/symfony/clock/zipball/7a4840efd17135cbd547e41ec49fb910ed4f8b98", + "reference": "7a4840efd17135cbd547e41ec49fb910ed4f8b98", "shasum": "" }, "require": { @@ -1965,7 +2004,7 @@ "time" ], "support": { - "source": "https://github.com/symfony/clock/tree/v6.4.7" + "source": "https://github.com/symfony/clock/tree/v6.4.8" }, "funding": [ { @@ -1981,7 +2020,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:22:46+00:00" + "time": "2024-05-31T14:51:39+00:00" }, { "name": "symfony/config", @@ -2522,16 +2561,16 @@ }, { "name": "symfony/http-client", - "version": "v6.4.7", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "3683d8107cf1efdd24795cc5f7482be1eded34ac" + "reference": "b5e498f763e0bf5eed8dcd946e50a3b3f71d4ded" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/3683d8107cf1efdd24795cc5f7482be1eded34ac", - "reference": "3683d8107cf1efdd24795cc5f7482be1eded34ac", + "url": "https://api.github.com/repos/symfony/http-client/zipball/b5e498f763e0bf5eed8dcd946e50a3b3f71d4ded", + "reference": "b5e498f763e0bf5eed8dcd946e50a3b3f71d4ded", "shasum": "" }, "require": { @@ -2595,7 +2634,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.4.7" + "source": "https://github.com/symfony/http-client/tree/v6.4.10" }, "funding": [ { @@ -2611,7 +2650,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:22:46+00:00" + "time": "2024-07-15T09:26:24+00:00" }, { "name": "symfony/http-client-contracts", @@ -2693,16 +2732,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { @@ -2752,7 +2791,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" }, "funding": [ { @@ -2768,20 +2807,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", "shasum": "" }, "require": { @@ -2830,7 +2869,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" }, "funding": [ { @@ -2846,20 +2885,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", "shasum": "" }, "require": { @@ -2911,7 +2950,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" }, "funding": [ { @@ -2927,20 +2966,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -2991,7 +3030,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { @@ -3007,20 +3046,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", "shasum": "" }, "require": { @@ -3071,7 +3110,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" }, "funding": [ { @@ -3087,25 +3126,100 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/3fb075789fb91f9ad9af537c4012d523085bd5af", + "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/polyfill-php83", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php83.git", - "reference": "86fcae159633351e5fd145d1c47de6c528f8caff" + "reference": "dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/86fcae159633351e5fd145d1c47de6c528f8caff", - "reference": "86fcae159633351e5fd145d1c47de6c528f8caff", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9", + "reference": "dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9", "shasum": "" }, "require": { - "php": ">=7.1", - "symfony/polyfill-php80": "^1.14" + "php": ">=7.1" }, "type": "library", "extra": { @@ -3148,7 +3262,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php83/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php83/tree/v1.30.0" }, "funding": [ { @@ -3164,7 +3278,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:35:24+00:00" }, { "name": "symfony/process", @@ -3312,16 +3426,16 @@ }, { "name": "symfony/string", - "version": "v6.4.7", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "ffeb9591c61f65a68d47f77d12b83fa530227a69" + "reference": "ccf9b30251719567bfd46494138327522b9a9446" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/ffeb9591c61f65a68d47f77d12b83fa530227a69", - "reference": "ffeb9591c61f65a68d47f77d12b83fa530227a69", + "url": "https://api.github.com/repos/symfony/string/zipball/ccf9b30251719567bfd46494138327522b9a9446", + "reference": "ccf9b30251719567bfd46494138327522b9a9446", "shasum": "" }, "require": { @@ -3378,7 +3492,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.7" + "source": "https://github.com/symfony/string/tree/v6.4.10" }, "funding": [ { @@ -3394,7 +3508,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:22:46+00:00" + "time": "2024-07-22T10:21:14+00:00" }, { "name": "symfony/translation-contracts", @@ -3553,16 +3667,16 @@ }, { "name": "twig/twig", - "version": "v3.9.3", + "version": "v3.11.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "a842d75fed59cdbcbd3a3ad7fb9eb768fc350d58" + "reference": "e80fb8ebba85c7341a97a9ebf825d7fd4b77708d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/a842d75fed59cdbcbd3a3ad7fb9eb768fc350d58", - "reference": "a842d75fed59cdbcbd3a3ad7fb9eb768fc350d58", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/e80fb8ebba85c7341a97a9ebf825d7fd4b77708d", + "reference": "e80fb8ebba85c7341a97a9ebf825d7fd4b77708d", "shasum": "" }, "require": { @@ -3570,7 +3684,8 @@ "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "^1.8", "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-php80": "^1.22" + "symfony/polyfill-php80": "^1.22", + "symfony/polyfill-php81": "^1.29" }, "require-dev": { "psr/container": "^1.0|^2.0", @@ -3616,7 +3731,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.9.3" + "source": "https://github.com/twigphp/Twig/tree/v3.11.0" }, "funding": [ { @@ -3628,7 +3743,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T11:59:33+00:00" + "time": "2024-08-08T16:15:16+00:00" }, { "name": "webmozart/assert", @@ -7973,7 +8088,8 @@ "phpdocumentor/guides-graphs": 20, "phpdocumentor/guides-markdown": 20, "phpdocumentor/guides-restructured-text": 20, - "phpdocumentor/guides-theme-bootstrap": 20 + "phpdocumentor/guides-theme-bootstrap": 20, + "phpdocumentor/guides-theme-rst": 20 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/config.subsplit-publish.json b/config.subsplit-publish.json index 30bc21248..6c10e9680 100644 --- a/config.subsplit-publish.json +++ b/config.subsplit-publish.json @@ -34,6 +34,11 @@ "name": "guides-code", "directory": "packages/guides-code", "target": "git@github.com:phpDocumentor/guides-code.git" + }, + { + "name": "guides-theme-rst", + "directory": "packages/guides-rst-theme", + "target": "git@github.com:phpDocumentor/guides-theme-rst.git" } ] } diff --git a/packages/guides-theme-rst/.gitattributes b/packages/guides-theme-rst/.gitattributes new file mode 100644 index 000000000..29d77c0df --- /dev/null +++ b/packages/guides-theme-rst/.gitattributes @@ -0,0 +1,4 @@ +/.gitattributes export-ignore +/.gitignore export-ignore +/docs export-ignore +/tests export-ignore diff --git a/packages/guides-theme-rst/.gitignore b/packages/guides-theme-rst/.gitignore new file mode 100644 index 000000000..140fada73 --- /dev/null +++ b/packages/guides-theme-rst/.gitignore @@ -0,0 +1 @@ +vendor/* diff --git a/packages/guides-theme-rst/CONTRIBUTING.rst b/packages/guides-theme-rst/CONTRIBUTING.rst new file mode 100644 index 000000000..799a7918a --- /dev/null +++ b/packages/guides-theme-rst/CONTRIBUTING.rst @@ -0,0 +1,23 @@ +====================================== +Contribute to the phpDocumentor Guides +====================================== + +Go to the mono-repository +========================= + +This project is developed in the mono-repository `phpDocumentor Guides `__. +The repository you are currently in gets auto-created by splitting the mono-repository. You **must not** contribute +to this repository directly but always to the mono-repository linked above. + +Create Issues +============= + +* If you find something missing or something is wrong in this library, you are welcome to write an issue + describing the problem: `Issues on GitHub `__. +* If you can, please try to fix the problem yourself. + +Make changes (create pull requests) +=================================== + +See the `Contribution chapter `__ in the +`Documentation` `__. diff --git a/packages/guides-theme-rst/LICENSE b/packages/guides-theme-rst/LICENSE new file mode 100644 index 000000000..792e4040f --- /dev/null +++ b/packages/guides-theme-rst/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2010 Mike van Riel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/packages/guides-theme-rst/README.rst b/packages/guides-theme-rst/README.rst new file mode 100644 index 000000000..4457b1028 --- /dev/null +++ b/packages/guides-theme-rst/README.rst @@ -0,0 +1,37 @@ + +.. image:: http://poser.pugx.org/phpdocumentor/guides-restructured-text/require/php + :alt: PHP Version Require + :target: https://packagist.org/packages/phpdocumentor/guides-restructured-text + +.. image:: http://poser.pugx.org/phpdocumentor/guides-restructured-text/v/stable + :alt: Latest Stable Version + :target: https://packagist.org/packages/phpdocumentor/guides-restructured-text + +.. image:: http://poser.pugx.org/phpdocumentor/guides-restructured-text/v/unstable + :alt: Latest Unstable Version + :target: https://packagist.org/packages/phpdocumentor/guides-restructured-text + +.. image:: https://poser.pugx.org/phpdocumentor/guides-restructured-text/d/total + :alt: Total Downloads + :target: https://packagist.org/packages/phpdocumentor/guides-restructured-text + +.. image:: https://poser.pugx.org/phpdocumentor/guides-restructured-text/d/monthly + :alt: Monthly Downloads + :target: https://packagist.org/packages/phpdocumentor/guides-restructured-text + +==================== +phpDocumentor Guides +==================== + +This repository is part of `phpDocumentor's Guides library `__, a framework +designed to take hand-written documentation in code repositories and create an AST (abstract syntax tree) from it. +This AST is then fed to a renderer, which produces the desired output, such as HTML. + +The package `phpdocumentor/guides-restructured-text `__ adds +`reStructuredText Markup `__ support to the +phpDocumentor's Guides library. + +:Mono-Repository: https://github.com/phpDocumentor/guides +:Documentation: https://github.com/phpDocumentor/guides/tree/main/docs/index.rst +:Packagist: https://packagist.org/packages/phpdocumentor/guides-restructured-text +:Contribution: https://github.com/phpDocumentor/guides/tree/main/CONTRIBUTING.rst diff --git a/packages/guides-theme-rst/composer.json b/packages/guides-theme-rst/composer.json new file mode 100644 index 000000000..7a3681a80 --- /dev/null +++ b/packages/guides-theme-rst/composer.json @@ -0,0 +1,32 @@ +{ + "name": "phpdocumentor/guides-theme-rst", + "description": "Adds a reStructuredText theme used to convert Markdown into reStructuredText", + "type": "library", + "license": "MIT", + "homepage": "https://www.phpdoc.org", + "config": { + "sort-packages": true + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Guides\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "phpDocumentor\\Guides\\": [ + "tests/unit/" + ] + } + }, + "minimum-stability": "stable", + "require": { + "php": "^8.1", + "phpdocumentor/guides": "^1.0 || ^2.0" + }, + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + } +} diff --git a/packages/guides-theme-rst/resources/config/guides-theme-rst.php b/packages/guides-theme-rst/resources/config/guides-theme-rst.php new file mode 100644 index 000000000..291b4f635 --- /dev/null +++ b/packages/guides-theme-rst/resources/config/guides-theme-rst.php @@ -0,0 +1,37 @@ +services() + ->defaults() + ->autowire() + ->autoconfigure() + /* + ->load( + 'phpDocumentor\\Guides\RstTheme\\NodeRenderers\\Rst\\', + '%vendor_dir%/phpdocumentor/guides-rst-theme/src/RstTheme/NodeRenderers/Rst', + ) + ->tag('phpdoc.guides.noderenderer.rst') + */ + + ->set(RstRenderer::class) + ->tag( + 'phpdoc.renderer.typerenderer', + [ + 'noderender_tag' => 'phpdoc.guides.noderenderer.rst', + 'format' => 'rst', + ], + ) + + ->set(RstExtension::class) + ->arg('$nodeRenderer', service('phpdoc.guides.output_node_renderer')) + ->tag('twig.extension') + ->autowire(); +}; diff --git a/packages/guides-theme-rst/resources/template/rst/body/code.rst.twig b/packages/guides-theme-rst/resources/template/rst/body/code.rst.twig new file mode 100644 index 000000000..9c3bbe505 --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/body/code.rst.twig @@ -0,0 +1,3 @@ +``` +{{ node.value|raw }} +``` diff --git a/packages/guides-theme-rst/resources/template/rst/body/list/list.rst.twig b/packages/guides-theme-rst/resources/template/rst/body/list/list.rst.twig new file mode 100644 index 000000000..0b47d0965 --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/body/list/list.rst.twig @@ -0,0 +1,9 @@ +{% if node.isOrdered -%} + {%- for item in node.value -%} + #. {{ renderNode(item.value)|raw }}{{ "\n\n" }} + {% endfor -%} +{%- else -%} + {%- for item in node.value -%} + * {{ renderNode(item.value)|raw }}{{ "\n" }} + {%- endfor -%} +{%- endif -%} diff --git a/packages/guides-theme-rst/resources/template/rst/body/paragraph.rst.twig b/packages/guides-theme-rst/resources/template/rst/body/paragraph.rst.twig new file mode 100644 index 000000000..92a9742fe --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/body/paragraph.rst.twig @@ -0,0 +1,4 @@ +{%- set text = renderNode(node.value)|raw -%} +{%- if text|trim %} + {{- text|raw -}} +{% endif -%} diff --git a/packages/guides-theme-rst/resources/template/rst/body/quote.rst.twig b/packages/guides-theme-rst/resources/template/rst/body/quote.rst.twig new file mode 100644 index 000000000..7821689a8 --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/body/quote.rst.twig @@ -0,0 +1 @@ + {{ renderNode(node.value) }} diff --git a/packages/guides-theme-rst/resources/template/rst/body/separator.rst.twig b/packages/guides-theme-rst/resources/template/rst/body/separator.rst.twig new file mode 100644 index 000000000..693a05c9a --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/body/separator.rst.twig @@ -0,0 +1 @@ +==== diff --git a/packages/guides-theme-rst/resources/template/rst/guides/inline/br.rst.twig b/packages/guides-theme-rst/resources/template/rst/guides/inline/br.rst.twig new file mode 100644 index 000000000..ae7ddaf01 --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/guides/inline/br.rst.twig @@ -0,0 +1 @@ +\\\\\\\\\n diff --git a/packages/guides-theme-rst/resources/template/rst/guides/inline/emphasis.rst.twig b/packages/guides-theme-rst/resources/template/rst/guides/inline/emphasis.rst.twig new file mode 100644 index 000000000..f74bede9a --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/guides/inline/emphasis.rst.twig @@ -0,0 +1 @@ +\textit{{ '{' }}{{ text|raw }}{{ '}' }} diff --git a/packages/guides-theme-rst/resources/template/rst/guides/inline/link.rst.twig b/packages/guides-theme-rst/resources/template/rst/guides/inline/link.rst.twig new file mode 100644 index 000000000..34797c039 --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/guides/inline/link.rst.twig @@ -0,0 +1,5 @@ +{% if type == 'ref' %} +\ref{{ '{' }}{{ url }}{{ '}' }} +{% else %} +\href{{ '{' }}{{ url }}{{ '}' }}{{ '{' }}{{ title }}{{ '}' }} +{% endif %} diff --git a/packages/guides-theme-rst/resources/template/rst/guides/inline/literal.rst.twig b/packages/guides-theme-rst/resources/template/rst/guides/inline/literal.rst.twig new file mode 100644 index 000000000..c883ec94d --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/guides/inline/literal.rst.twig @@ -0,0 +1 @@ +\verb|{{ node.value|raw }}| diff --git a/packages/guides-theme-rst/resources/template/rst/guides/inline/nbsp.rst.twig b/packages/guides-theme-rst/resources/template/rst/guides/inline/nbsp.rst.twig new file mode 100644 index 000000000..54bcf3046 --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/guides/inline/nbsp.rst.twig @@ -0,0 +1 @@ +~ diff --git a/packages/guides-theme-rst/resources/template/rst/guides/inline/strong-emphasis.rst.twig b/packages/guides-theme-rst/resources/template/rst/guides/inline/strong-emphasis.rst.twig new file mode 100644 index 000000000..9802bb260 --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/guides/inline/strong-emphasis.rst.twig @@ -0,0 +1 @@ +\textbf{{ '{' }}{{ text|raw }}{{ '}' }} diff --git a/packages/guides-theme-rst/resources/template/rst/guides/structure/header/meta.rst.twig b/packages/guides-theme-rst/resources/template/rst/guides/structure/header/meta.rst.twig new file mode 100644 index 000000000..e69de29bb diff --git a/packages/guides-theme-rst/resources/template/rst/guides/structure/header/title.rst.twig b/packages/guides-theme-rst/resources/template/rst/guides/structure/header/title.rst.twig new file mode 100644 index 000000000..ae1d71fe2 --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/guides/structure/header/title.rst.twig @@ -0,0 +1 @@ +\{{ type }}{{ '{' }}{{ renderNode(titleNode.value) }}{{ '}' }} diff --git a/packages/guides-theme-rst/resources/template/rst/inline/image.rst.twig b/packages/guides-theme-rst/resources/template/rst/inline/image.rst.twig new file mode 100644 index 000000000..90e1a94ff --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/inline/image.rst.twig @@ -0,0 +1,2 @@ +.. figure:: {{ node.url }} + :alt: {{ node.altText }} diff --git a/packages/guides-theme-rst/resources/template/rst/inline/inline-node.rst.twig b/packages/guides-theme-rst/resources/template/rst/inline/inline-node.rst.twig new file mode 100644 index 000000000..065c6a06b --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/inline/inline-node.rst.twig @@ -0,0 +1,3 @@ +{%- for child in node.children -%} + {{- renderNode(child) -}} +{%- endfor -%} diff --git a/packages/guides-theme-rst/resources/template/rst/inline/link.rst.twig b/packages/guides-theme-rst/resources/template/rst/inline/link.rst.twig new file mode 100644 index 000000000..edde6ce9c --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/inline/link.rst.twig @@ -0,0 +1,7 @@ +{%- if node.url -%} + `{{ node.value|raw }} <{{- node.url -}}>`__ +{%- elseif node.targetReference -%} + :doc:`{{ node.value|raw }} <{{- node.targetReference -}}>` +{%- else -%} + {{- node.value -}} +{%- endif -%} diff --git a/packages/guides-theme-rst/resources/template/rst/inline/literal.rst.twig b/packages/guides-theme-rst/resources/template/rst/inline/literal.rst.twig new file mode 100644 index 000000000..d83616bec --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/inline/literal.rst.twig @@ -0,0 +1 @@ +`{{- node.value -}}` diff --git a/packages/guides-theme-rst/resources/template/rst/inline/plain-text.rst.twig b/packages/guides-theme-rst/resources/template/rst/inline/plain-text.rst.twig new file mode 100644 index 000000000..7fd22d7bc --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/inline/plain-text.rst.twig @@ -0,0 +1 @@ +{{- node.value|raw -}} diff --git a/packages/guides-theme-rst/resources/template/rst/structure/document.rst.twig b/packages/guides-theme-rst/resources/template/rst/structure/document.rst.twig new file mode 100644 index 000000000..c69fc7445 --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/structure/document.rst.twig @@ -0,0 +1,3 @@ +{% for child in node.children -%} + {{- renderNode(child) -}} +{%- endfor %} diff --git a/packages/guides-theme-rst/resources/template/rst/structure/header-title.rst.twig b/packages/guides-theme-rst/resources/template/rst/structure/header-title.rst.twig new file mode 100644 index 000000000..bf9f3bfbb --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/structure/header-title.rst.twig @@ -0,0 +1 @@ +{{ renderRstTitle(node, renderNode(node.value)) }} diff --git a/packages/guides-theme-rst/resources/template/rst/structure/project.rst.twig b/packages/guides-theme-rst/resources/template/rst/structure/project.rst.twig new file mode 100644 index 000000000..adbd7d6c3 --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/structure/project.rst.twig @@ -0,0 +1,3 @@ +{%- for document in documents %} + {{- renderNode(document) }} +{%- endfor -%} diff --git a/packages/guides-theme-rst/resources/template/rst/structure/section.rst.twig b/packages/guides-theme-rst/resources/template/rst/structure/section.rst.twig new file mode 100644 index 000000000..e9538aa5d --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/structure/section.rst.twig @@ -0,0 +1,4 @@ +{% for childNode in node.children -%} + {{- renderNode(childNode) }} + +{% endfor -%} diff --git a/packages/guides-theme-rst/resources/template/rst/template.php b/packages/guides-theme-rst/resources/template/rst/template.php new file mode 100644 index 000000000..14bd87902 --- /dev/null +++ b/packages/guides-theme-rst/resources/template/rst/template.php @@ -0,0 +1,110 @@ + 'inline/anchor.rst.twig', + FigureNode::class => 'body/figure.rst.twig', + MetaNode::class => 'structure/header/meta.rst.twig', + ParagraphNode::class => 'body/paragraph.rst.twig', + QuoteNode::class => 'body/quote.rst.twig', + SeparatorNode::class => 'body/separator.rst.twig', + TitleNode::class => 'structure/header-title.rst.twig', + SectionNode::class => 'structure/section.rst.twig', + DocumentNode::class => 'structure/document.rst.twig', + ImageNode::class => 'body/image.rst.twig', + CodeNode::class => 'body/code.rst.twig', + DefinitionListNode::class => 'body/definition-list.rst.twig', + DefinitionNode::class => 'body/definition.rst.twig', + FieldListNode::class => 'body/field-list.rst.twig', + ListNode::class => 'body/list/list.rst.twig', + ListItemNode::class => 'body/list/list-item.rst.twig', + LiteralBlockNode::class => 'body/literal-block.rst.twig', + CitationNode::class => 'body/citation.rst.twig', + FootnoteNode::class => 'body/footnote.rst.twig', + AnnotationListNode::class => 'body/annotation-list.rst.twig', + // Inline + ImageInlineNode::class => 'inline/image.rst.twig', + InlineCompoundNode::class => 'inline/inline-node.rst.twig', + AbbreviationInlineNode::class => 'inline/textroles/abbreviation.rst.twig', + CitationInlineNode::class => 'inline/citation.rst.twig', + DocReferenceNode::class => 'inline/doc.rst.twig', + EmphasisInlineNode::class => 'inline/emphasis.rst.twig', + FootnoteInlineNode::class => 'inline/footnote.rst.twig', + HyperLinkNode::class => 'inline/link.rst.twig', + LiteralInlineNode::class => 'inline/literal.rst.twig', + NewlineInlineNode::class => 'inline/newline.rst.twig', + WhitespaceInlineNode::class => 'inline/nbsp.rst.twig', + PlainTextInlineNode::class => 'inline/plain-text.rst.twig', + ReferenceNode::class => 'inline/ref.rst.twig', + StrongInlineNode::class => 'inline/strong.rst.twig', + VariableInlineNode::class => 'inline/variable.rst.twig', + GenericTextRoleInlineNode::class => 'inline/textroles/generic.rst.twig', + // Output as Metatags + AuthorNode::class => 'structure/header/author.rst.twig', + CopyrightNode::class => 'structure/header/copyright.rst.twig', + DateNode::class => 'structure/header/date.rst.twig', + NoSearchNode::class => 'structure/header/no-search.rst.twig', + TopicNode::class => 'structure/header/topic.rst.twig', + // No output in page header in tex - might be output in i.e. LaTex + AddressNode::class => 'structure/header/blank.rst.twig', + AuthorsNode::class => 'structure/header/blank.rst.twig', + ContactNode::class => 'structure/header/blank.rst.twig', + NoCommentsNode::class => 'structure/header/blank.rst.twig', + OrganizationNode::class => 'structure/header/blank.rst.twig', + OrphanNode::class => 'structure/header/blank.rst.twig', + RevisionNode::class => 'structure/header/blank.rst.twig', + TocDepthNode::class => 'structure/header/blank.rst.twig', + VersionNode::class => 'structure/header/blank.rst.twig', +]; diff --git a/packages/guides-theme-rst/src/RstTheme/Configuration/HeaderSyntax.php b/packages/guides-theme-rst/src/RstTheme/Configuration/HeaderSyntax.php new file mode 100644 index 000000000..ba1d1858a --- /dev/null +++ b/packages/guides-theme-rst/src/RstTheme/Configuration/HeaderSyntax.php @@ -0,0 +1,43 @@ + '=', + HeaderSyntax::H3 => '-', + HeaderSyntax::H4 => '~', + HeaderSyntax::H5 => '#', + HeaderSyntax::H6 => '*', + }; + } + + public function hasTopDelimiter(): bool + { + return match ($this) { + HeaderSyntax::H1 => true, + default => false, + }; + } +} diff --git a/packages/guides-theme-rst/src/RstTheme/DependencyInjection/RstThemeExtension.php b/packages/guides-theme-rst/src/RstTheme/DependencyInjection/RstThemeExtension.php new file mode 100644 index 000000000..8913e0624 --- /dev/null +++ b/packages/guides-theme-rst/src/RstTheme/DependencyInjection/RstThemeExtension.php @@ -0,0 +1,53 @@ +load('guides-theme-rst.php'); + } + + public function prepend(ContainerBuilder $container): void + { + $container->prependExtensionConfig('guides', [ + 'themes' => ['rst' => dirname(__DIR__, 3) . '/resources/template/rst'], + ]); + + $container->prependExtensionConfig( + 'guides', + [ + 'templates' => templateArray( + require dirname(__DIR__, 3) . '/resources/template/rst/template.php', + 'rst', + ), + ], + ); + } +} diff --git a/packages/guides-theme-rst/src/RstTheme/Renderer/RstRenderer.php b/packages/guides-theme-rst/src/RstTheme/Renderer/RstRenderer.php new file mode 100644 index 000000000..4144dabf5 --- /dev/null +++ b/packages/guides-theme-rst/src/RstTheme/Renderer/RstRenderer.php @@ -0,0 +1,20 @@ + $nodeRenderer */ + public function __construct( + private readonly NodeRenderer $nodeRenderer, + ) { + $this->menuExtension = new GlobalMenuExtension($this->nodeRenderer); + } + + /** @return TwigFunction[] */ + public function getFunctions(): array + { + return [ + new TwigFunction('renderRstTitle', $this->renderRstTitle(...), ['is_safe' => ['rst'], 'needs_context' => false]), + ]; + } + + public function renderRstTitle(TitleNode $node, string $content): string + { + $headerSyntax = HeaderSyntax::from(min($node->getLevel(), 6)); + $ret = ''; + if ($headerSyntax->hasTopDelimiter()) { + $ret .= str_repeat($headerSyntax->delimiter(), strlen($content)) . "\n"; + } + + $ret .= $content . "\n" . str_repeat($headerSyntax->delimiter(), strlen($content)); + + return $ret; + } +} diff --git a/tests/Integration/tests-full/md-to-rst/index-md-to-rst/expected/index.rst b/tests/Integration/tests-full/md-to-rst/index-md-to-rst/expected/index.rst new file mode 100644 index 000000000..085ca0399 --- /dev/null +++ b/tests/Integration/tests-full/md-to-rst/index-md-to-rst/expected/index.rst @@ -0,0 +1,15 @@ +================ +Markdown Example +================ + +This is a Markdown document with some basic formatting. + +Headings +======== + +You can create headings using hash symbols. + +This text is part of a paragraph under the "Headings" heading. + + + diff --git a/tests/Integration/tests-full/md-to-rst/index-md-to-rst/input/guides.xml b/tests/Integration/tests-full/md-to-rst/index-md-to-rst/input/guides.xml new file mode 100644 index 000000000..a4d11241d --- /dev/null +++ b/tests/Integration/tests-full/md-to-rst/index-md-to-rst/input/guides.xml @@ -0,0 +1,11 @@ + + + + + rst + diff --git a/tests/Integration/tests-full/md-to-rst/index-md-to-rst/input/index.md b/tests/Integration/tests-full/md-to-rst/index-md-to-rst/input/index.md new file mode 100644 index 000000000..184118784 --- /dev/null +++ b/tests/Integration/tests-full/md-to-rst/index-md-to-rst/input/index.md @@ -0,0 +1,9 @@ +# Markdown Example + +This is a Markdown document with some basic formatting. + +## Headings + +You can create headings using hash symbols. + +This text is part of a paragraph under the "Headings" heading. diff --git a/tests/Integration/tests-full/md-to-rst/md-to-rst-list-link/expected/index.rst b/tests/Integration/tests-full/md-to-rst/md-to-rst-list-link/expected/index.rst new file mode 100644 index 000000000..d1accf572 --- /dev/null +++ b/tests/Integration/tests-full/md-to-rst/md-to-rst-list-link/expected/index.rst @@ -0,0 +1,65 @@ +========================================= +TYPO3 Extension powermail - Documentation +========================================= + +This documentation helps + +* Administrators to install and configure powermail +* Editors to use powermail +* Developers to extend powermail + + +Example Screenshots +=================== + +Frontend: Show a form with different field types +------------------------------------------------ + +.. figure:: Images/frontend1.png + :alt: Example form + +Example Form with Input, Textarea, Select, Multiselect, Checkboxes, Radiobuttons, and Submit + + + +Frontend: Multistep Form +------------------------ + +.. figure:: Images/frontend2.png + :alt: Example form2 + +Example Multistep Form with clientside validation + + + +Backend: Mail Listing +--------------------- + +.. figure:: Images/backend1.png + :alt: backend1 + +Manage the delivered mails with a fulltext search and some export possibilities + + + +Backend: Reporting +------------------ + +.. figure:: Images/backend2.png + :alt: backend2 + +See the reporting about the delivered mails (Form or Marketing Data Analyses are possible) + + + + + +Documentation overview +====================== + +* `Introduction `__ +* `Documentation for editors `__ + + + + diff --git a/tests/Integration/tests-full/md-to-rst/md-to-rst-list-link/input/guides.xml b/tests/Integration/tests-full/md-to-rst/md-to-rst-list-link/input/guides.xml new file mode 100644 index 000000000..a4d11241d --- /dev/null +++ b/tests/Integration/tests-full/md-to-rst/md-to-rst-list-link/input/guides.xml @@ -0,0 +1,11 @@ + + + + + rst + diff --git a/tests/Integration/tests-full/md-to-rst/md-to-rst-list-link/input/index.md b/tests/Integration/tests-full/md-to-rst/md-to-rst-list-link/input/index.md new file mode 100644 index 000000000..bf4885420 --- /dev/null +++ b/tests/Integration/tests-full/md-to-rst/md-to-rst-list-link/input/index.md @@ -0,0 +1,41 @@ +# TYPO3 Extension powermail - Documentation + +This documentation helps +* Administrators to install and configure powermail +* Editors to use powermail +* Developers to extend powermail + +## Example Screenshots + + +### Frontend: Show a form with different field types + +![Example form](Images/frontend1.png "Example Form") + +Example Form with Input, Textarea, Select, Multiselect, Checkboxes, Radiobuttons, and Submit + + +### Frontend: Multistep Form + +![Example form2](Images/frontend2.png "Example Form with validation") + +Example Multistep Form with clientside validation + +### Backend: Mail Listing + +![backend1](Images/backend1.png) + +Manage the delivered mails with a fulltext search and some export possibilities + + +### Backend: Reporting + +![backend2](Images/backend2.png) + +See the reporting about the delivered mails (Form or Marketing Data Analyses are possible) + + +## Documentation overview + +* [Introduction](https://github.com/in2code-de/powermail/blob/develop/Documentation/Readme.md) +* [Documentation for editors](https://github.com/in2code-de/powermail/blob/develop/Documentation/ForEditors/Readme.md)