From 1e3a25da9cca91b741e0a9cbadb2f801105f2bde Mon Sep 17 00:00:00 2001 From: Benjamin Brahmer Date: Sat, 16 Aug 2025 11:10:08 +0200 Subject: [PATCH] improve docs --- .github/workflows/build-docs.yml | 2 +- .gitignore | 4 +++- README.md | 3 +++ {doc => docs}/specifications-support.md | 4 ++-- .../upgrades/UPGRADE-3.0.md | 10 ++++++++- .../upgrades/UPGRADE-4.0.md | 22 ++++++++++++------- .../upgrades/UPGRADE-5.0.md | 0 .../upgrades/UPGRADE-6.0.md | 0 mkdocs.yml | 19 ++++++++++++++++ 9 files changed, 51 insertions(+), 13 deletions(-) rename {doc => docs}/specifications-support.md (98%) rename UPGRADE-3.0.md => docs/upgrades/UPGRADE-3.0.md (90%) rename UPGRADE-4.0.md => docs/upgrades/UPGRADE-4.0.md (77%) rename UPGRADE-5.0.md => docs/upgrades/UPGRADE-5.0.md (100%) rename UPGRADE-6.0.md => docs/upgrades/UPGRADE-6.0.md (100%) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index df868344..fc3adff9 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -23,7 +23,7 @@ jobs: # Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + EXTRA_PACKAGES: build-base pygments #CUSTOM_DOMAIN: optionaldomain.com #CONFIG_FILE: folder/mkdocs.yml - #EXTRA_PACKAGES: build-base # GITHUB_DOMAIN: github.myenterprise.com diff --git a/.gitignore b/.gitignore index 9eb7b2db..8f9ffe82 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,6 @@ vendor/ .php-cs-fixer.cache phpunit.xml .vscode/ -phpstan.neon \ No newline at end of file +phpstan.neon +# mkdocs +site \ No newline at end of file diff --git a/README.md b/README.md index c9d010fd..bb3ac6eb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # feed-io [![Packagist](https://img.shields.io/packagist/v/php-feed-io/feed-io.svg)](https://packagist.org/packages/php-feed-io/feed-io) +[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://php-feed-io.github.io/feed-io/) + +**📖 [Read the full documentation](https://php-feed-io.github.io/feed-io/)** [feed-io](https://github.com/php-feed-io/feed-io) is a PHP library built to consume and serve news feeds. It features: diff --git a/doc/specifications-support.md b/docs/specifications-support.md similarity index 98% rename from doc/specifications-support.md rename to docs/specifications-support.md index 6a1d63b8..eb07deac 100644 --- a/doc/specifications-support.md +++ b/docs/specifications-support.md @@ -4,7 +4,7 @@ This document explains which attributes are supported by feed-io and how to acce ## top level document : feed (atom) / channel (rss) / top-level (json) -interface : FeedInterface +**interface : FeedInterface** | atom | rss | json | getter | setter | | --------------- | ----------------------- | ------------- | --------------- | --------------- | @@ -36,7 +36,7 @@ interface : FeedInterface ## entry (atom) / item (rss) / item (json) -Interface : ItemInterface +**Interface : ItemInterface** | atom | rss | json | getter | setter | | ------------------- | ----------- | --------------------------- | --------------- | --------------- | diff --git a/UPGRADE-3.0.md b/docs/upgrades/UPGRADE-3.0.md similarity index 90% rename from UPGRADE-3.0.md rename to docs/upgrades/UPGRADE-3.0.md index 48dc61ab..f1c26a51 100644 --- a/UPGRADE-3.0.md +++ b/docs/upgrades/UPGRADE-3.0.md @@ -7,6 +7,8 @@ In version 2.x FeedIo::format() returned a DomDocument. Now that feed-io support Before : ```php +getFeedIo(); $result = $feedIo->read('http://php.net/feed.atom'); @@ -54,6 +60,8 @@ $dom = $result->getDocument(); After : ```php +getFeedIo(); $result = $feedIo->read('http://php.net/feed.atom'); @@ -62,7 +70,7 @@ $dom = $result->getDocument()->getDOMDocument(); ``` -This is because Result::getDocument()'s return value is a wrapper for both XML and JSON streams. +This is because `Result::getDocument()`'s return value is a wrapper for both XML and JSON streams. ### That's it diff --git a/UPGRADE-4.0.md b/docs/upgrades/UPGRADE-4.0.md similarity index 77% rename from UPGRADE-4.0.md rename to docs/upgrades/UPGRADE-4.0.md index 21e7ce60..947fe700 100644 --- a/UPGRADE-4.0.md +++ b/docs/upgrades/UPGRADE-4.0.md @@ -6,18 +6,20 @@ The major change in version 4.0 is the full migration to PHP 7.1. It has an impa From now on, all types are explicits in method signatures. It has an impact on classes that implements : - - \FeedIo\FeedInterface - - \FeedIo\Feed\ItemInterface - - \FeedIo\Feed\NodeInterface - - \FeedIo\Feed\ElementsAwareInterface - - \FeedIo\Feed\Item\AuthorInterface - - \FeedIo\Feed\Item\MediaInterface - - \FeedIo\Feed\Node\CategoryInterface - - \FeedIo\Feed\Node\ElementInterface + - `\FeedIo\FeedInterface` + - `\FeedIo\Feed\ItemInterface` + - `\FeedIo\Feed\NodeInterface` + - `\FeedIo\Feed\ElementsAwareInterface` + - `\FeedIo\Feed\Item\AuthorInterface` + - `\FeedIo\Feed\Item\MediaInterface` + - `\FeedIo\Feed\Node\CategoryInterface` + - `\FeedIo\Feed\Node\ElementInterface` For instance, `FeedIo\FeedInterface::setUrl($url)` becomes : ```php +