From 891f5a19ac5b5f6d5f7bd435043b98b27df918e2 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 8 Oct 2022 14:10:04 +0200 Subject: [PATCH] Build docs --- composer.json | 2 ++ docs | 2 +- tools/build_docs.php | 2 -- tools/fix_docs.sh | 4 ++++ tools/layerdiff.php | 4 ++-- 5 files changed, 9 insertions(+), 5 deletions(-) create mode 100755 tools/fix_docs.sh diff --git a/composer.json b/composer.json index ed17eef30..32a117048 100644 --- a/composer.json +++ b/composer.json @@ -105,6 +105,7 @@ "build": [ "@docs", "@phpdoc", + "@docs-fix", "@cs-fix", "@psalm" ], @@ -123,6 +124,7 @@ "psalm": "psalm", "phpdocMain": "php tools/phpdoc.php", "docs": "php tools/build_docs.php", + "docs-fix": "tools/fix_docs.sh", "test": "@php -dzend.assertions=1 -dassert.exception=1 ./vendor/bin/phpunit --coverage-text --config tests/phpunit.xml", "bin": "echo 'bin not installed'", "post-install-cmd": ["@composer bin all install --ansi"], diff --git a/docs b/docs index 55cb829ab..cf7737b8e 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 55cb829ab508e5d041b6baf1be196d9dbd114789 +Subproject commit cf7737b8eb889480b8ef37276e7f3a5cc1813f16 diff --git a/tools/build_docs.php b/tools/build_docs.php index fd0c0f3a1..268cf33bd 100755 --- a/tools/build_docs.php +++ b/tools/build_docs.php @@ -199,5 +199,3 @@ image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png include 'phpdoc.php'; - -\passthru('find -name \'*.md\' -exec sed \'s/\\.md/.html/g\' -i {} +'); diff --git a/tools/fix_docs.sh b/tools/fix_docs.sh new file mode 100755 index 000000000..d787d2bd8 --- /dev/null +++ b/tools/fix_docs.sh @@ -0,0 +1,4 @@ +#!/bin/bash -e + +find docs/ -name '*.md' -exec sed 's/\.md/\.html/g' -i {} + +sed 's:(danog:(/PHP/danog:g' -i docs/docs/PHP/index.md diff --git a/tools/layerdiff.php b/tools/layerdiff.php index 46de2109c..961a214e4 100644 --- a/tools/layerdiff.php +++ b/tools/layerdiff.php @@ -68,7 +68,7 @@ foreach (['methods', 'constructors'] as $type) { $name = $constructor[$key]; if (!$old[$type]->$finder($name)) { $name = getUrl($name, $type); - $res .= "Added $name\n"; + $res .= "- $name\n"; } } @@ -107,7 +107,7 @@ foreach (['methods', 'constructors'] as $type) { foreach ($old[$type]->by_id as $constructor) { $name = $constructor[$key]; if (!$new[$type]->$finder($name)) { - $res .= "Removed $name\n"; + $res .= "- $name\n"; } } }