Skip to content

Commit

Permalink
Added Read The Docs support
Browse files Browse the repository at this point in the history
  • Loading branch information
jkphl committed May 15, 2016
1 parent 5b41a44 commit 63949ee
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 23 deletions.
26 changes: 5 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Apparat Resources
# apparat/resource

Purpose of this module:

* Provide an abstract low-level interface for basic file operations
* [x] Creating
* [x] Reading
Expand All @@ -27,27 +28,9 @@ Purpose of this module:
* Implementing several file types and structures (see below)
* Possibly special behaviour based on file type

### File types planned to be supported

* [x] Text
* [x] Markdown (CommonMark)
* [x] YAML
* [x] JSON
* [x] YFM-Markdown (Markdown with YAML front matter)
* [x] JFM-Markdown (Markdown with JSON front matter)
* [ ] MIME Messages (?)

Each file consists of one or more **file parts**. The content model of a file is described in terms of

* **content parts** (containing true file content like text or image data) and / or
* **part aggregates** (each consisting of one or more subparts).

A part aggregage may either be a

* **part sequence** (a predefined sequence of subparts of particular types) or a
* **part choice** (one of several allowed subpart types)
## Documentation

and may be repeated more than once.
Please find the [project documentation](doc/index.md) in the `doc` directory. I recommend [reading it](http://apparat-kernel.readthedocs.io/) via *Read the Docs*.

## Installation

Expand All @@ -59,6 +42,7 @@ This library requires PHP 5.6 or later. I recommend using the latest available v
[![Coverage Status](https://coveralls.io/repos/apparat/resource/badge.svg?branch=master&service=github)](https://coveralls.io/github/apparat/resource?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/apparat/resource/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/apparat/resource/?branch=master)
[![Code Climate](https://codeclimate.com/github/apparat/resource/badges/gpa.svg)](https://codeclimate.com/github/apparat/resource)
[![Documentation Status](https://readthedocs.org/projects/apparat-resource/badge/?version=latest)](http://apparat-resource.readthedocs.io/en/latest/?badge=latest)

To run the unit tests at the command line, issue `composer install` and then `phpunit` at the package root. This requires [Composer](http://getcomposer.org/) to be available as `composer`, and [PHPUnit](http://phpunit.de/manual/) to be available as `phpunit`.

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"require": {
"php": ">=5.6.0",
"apparat/kernel": "@dev",
"league/commonmark": "^0.12.0",
"league/commonmark": "^0.13",
"symfony/yaml": "^3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"phpunit/phpunit": "^5.3",
"codeclimate/php-test-reporter": "dev-master"
},
"repositories": [
Expand Down
57 changes: 57 additions & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# apparat/resource

Purpose of this module:

* Provide an abstract low-level interface for basic file operations
* [x] Creating
* [x] Reading
* [x] Writing / Updating
* [x] Deleting
* [x] Copying (= Reading + Writing with a different name)
* [x] Moving / Renaming
* Provide an easy-to-use interface for multipart files (e.g. files with YAML front matter)
* Support for arbitrary content models
* [x] Parsing
* [x] Serialisation
* File part operations
* [x] Creating
* [x] Reading
* [x] Writing / Updating
* [ ] Deleting (?)
* [ ] Copying (?)
* Reading from / writing to different sources
* [x] In-Memory
* [x] File system
* [ ] Standard input / output (?)
* [ ] FTP (?)
* [ ] Remote storage (?)
* Implementing several file types and structures (see below)
* Possibly special behaviour based on file type

### File types planned to be supported

* [x] Text
* [x] Markdown (CommonMark)
* [x] YAML
* [x] JSON
* [x] YFM-Markdown (Markdown with YAML front matter)
* [x] JFM-Markdown (Markdown with JSON front matter)
* [ ] MIME Messages (?)

Each file consists of one or more **file parts**. The content model of a file is described in terms of

* **content parts** (containing true file content like text or image data) and / or
* **part aggregates** (each consisting of one or more subparts).

A part aggregage may either be a

* **part sequence** (a predefined sequence of subparts of particular types) or a
* **part choice** (one of several allowed subpart types)

and may be repeated more than once.

# Documentation

I recommend reading [the project documentation](http://apparat-resource.readthedocs.io/) on *Read the Docs*.

[![Documentation Status](https://readthedocs.org/projects/apparat-resource/badge/?version=latest)](http://apparat-resource.readthedocs.io/en/latest/?badge=latest)
31 changes: 31 additions & 0 deletions doc/ports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Ports

All available ports use the PHP namespace `Apparat\Kernel\Resource`.

## Facades

### `Resource`

Provides factory methods for the supported file types:

* text files (`text`),
* YAML files (`yaml`),
* JSON files (`json`),
* CommonMark files (`commonMark`),
* text files with CommonMark front matter (`frontMark`).

### `Tools`

Utility methods for dealing with resources:

* copy a resource (`copy`),
* move a resource (`move`),
* delete a resource (`delete`),
* create a reader instance (`reader`),
* create a writer instance (`writer`).

## Exceptions

### `InvalidArgumentException`

Exception thrown if a reader or writer stream wrapper is invalid.
2 changes: 2 additions & 0 deletions doc/todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
To-Do
=====
9 changes: 9 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
site_name: apparat/resource
site_description: Apparat resource abstraction layer
site_author: Joschi Kuphal
repo_url: https://github.com/apparat/resource/
docs_dir: doc
pages:
- Home: 'index.md'
- Ports: 'ports.md'
- To-Do: 'todo.md'

0 comments on commit 63949ee

Please sign in to comment.