Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs into the repo #756

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 2 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{css,js,json,sql}]
[*.{css,html,js,json,sql}]
indent_style = tab

[*.html]
indent_size = 2
indent_style = space

[*.{markdown,md}]
indent_size = 4
indent_size = 2
indent_style = space
max_line_length = off
trim_trailing_whitespace = false
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Docs

on:
push:
branches:
- master

jobs:
website:
runs-on: ubuntu-latest

name: "Build website"

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install PHP with latest composer
uses: shivammathur/setup-php@v2
with:
php-version: 8.1

- name: Build API docs
run: |
pushd docs/apigen
composer install
composer exec -- apigen
popd

- name: Build website
run: |
cd docs
wget -q -O - "https://github.com/getzola/zola/releases/download/v0.16.1/zola-v0.16.1-x86_64-unknown-linux-gnu.tar.gz" | tar xzf -
./zola build

- name: Copy demo & SimplePie
run: |
cp -r autoloader.php idn/ src/ library/ demo/ docs/public/
grep --perl-regexp --only-matching --null-data "(?s)(.+)(?=<!DOCTYPE html>)" demo/index.php > docs/public/demo/index.php
grep --perl-regexp --only-matching --null-data "(?s)(.+)(?=<!-- BODY START -->)" docs/public/demo/index.html >> docs/public/demo/index.php
grep --perl-regexp --only-matching --null-data "(?s)(?<=<!-- BODY START -->)(.+)(?=<!-- BODY END -->)" demo/index.php >> docs/public/demo/index.php
grep --perl-regexp --only-matching --null-data "(?s)(?<=<!-- BODY END -->)(.+)" docs/public/demo/index.html >> docs/public/demo/index.php
rm docs/public/demo/index.html

- name: Upload to web server
uses: SamKirkland/[email protected]
with:
local-dir: docs/public/
server: ${{ vars.SFTP_SERVER }}
port: ${{ vars.SFTP_SERVER }}
protocol: ftps
username: ${{ secrets.SFTP_USERNAME }}
password: ${{ secrets.SFTP_PASSWORD }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ demo/cache/*
SimplePie.compiled.php
bin/
vendor/
composer.lock
/composer.lock
phpunit.xml
.php-cs-fixer.cache
.phpunit.result.cache
docs/public/
docs/content/api/
docs/static/api/
3 changes: 2 additions & 1 deletion demo/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<div id="site">

<div id="content">

<!-- BODY START -->
<div class="chunk">
<form action="" method="get" name="sp_form" id="sp_form">
<div id="sp_input">
Expand Down Expand Up @@ -234,6 +234,7 @@
<?php endif; ?>

</div>
<!-- BODY END -->

<div>
<!-- Display how fast the page was rendered. -->
Expand Down
7 changes: 7 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This directory contains the source for the SimplePie website hosted at <https://simplepie.org>. It is mostly written in [CommonMark](https://commonmark.org/) and built using [Zola](https://www.getzola.org) static site generator.

After [installing Zola](https://www.getzola.org/documentation/getting-started/installation/), you can run `zola serve` in this directory to start a server that will allow you to preview the built site, automatically rebuilding on changes.

To build API docs run `composer exec -- apigen` in the `apigen/` directory.

You can also run `zola build`, which will generate the site inside the `public/` subdirectory.
24 changes: 24 additions & 0 deletions docs/apigen/apigen.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
parameters:
paths: [
'../../library',
'../../src',
]

exclude: []

excludeTagged: ['internal']

baseUrl: '/api/'

outputDir: '%workingDir%/../content/api'

themeDir: 'theme'

title: 'SimplePie 1.8'

# Override ApiGen implementation
services:
renderer.urlGenerator:
factory: SimplePie\ApiGen\MdUrlGenerator(ApiGen\Helpers::baseDir(%paths%), %baseUrl%)
renderer.latte.extension:
factory: SimplePie\ApiGen\LatteExtension
14 changes: 14 additions & 0 deletions docs/apigen/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"require": {
"php": "^8.0",
"psr/simple-cache": "^3.0"
},
"require-dev": {
"apigen/apigen": "^7.0.0-alpha.3"
},
"autoload": {
"psr-4": {
"SimplePie\\ApiGen\\": "src"
}
}
}