Skip to content

Commit f0d47af

Browse files
committed
Github Action : Documentation
1 parent 1a2d70e commit f0d47af

10 files changed

Lines changed: 354 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
### MkDocs
16+
- name: Setup Python
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: 3.x
20+
- name: Install Python Dependencies
21+
run: pip install mkdocs-material autolink-references-mkdocs-plugin
22+
- name: Build documentation
23+
run: mkdocs build --site-dir public
24+
### PHPUnit
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: 7.1
29+
extensions: dom, xml
30+
coverage: xdebug
31+
- name: Create directory public/coverage
32+
run: mkdir ./public/coverage
33+
- name: Install PHP Dependencies
34+
run: composer install --ansi --prefer-dist --no-interaction --no-progress
35+
- name: Build Coverage Report
36+
run: XDEBUG_MODE=coverage ./vendor/bin/phpunit -c ./ --coverage-text --coverage-html ./public/coverage
37+
### PHPDoc
38+
#- name: Create directory public/docs
39+
# run: mkdir ./public/docs
40+
#- name: Install PhpDocumentor
41+
# run: wget https://phpdoc.org/phpDocumentor.phar && chmod +x phpDocumentor.phar
42+
#- name: Build Documentation
43+
# run: ./phpDocumentor.phar run -d ./src -t ./public/docs
44+
45+
### Deploy
46+
- name: Deploy
47+
uses: peaceiris/actions-gh-pages@v3
48+
if: github.ref == 'refs/heads/master'
49+
with:
50+
github_token: ${{ secrets.GITHUB_TOKEN }}
51+
publish_dir: ./public

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
.phpunit.result.cache
33
.php-cs-fixer.cache
44
composer.lock
5+
phpDocumentor.phar
56

7+
public/
68
vendor/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 PhpSpreadsheet Authors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# WMF
2+
3+
[![Latest Stable Version](https://poser.pugx.org/phpoffice/wmf/v)](https://packagist.org/packages/phpoffice/wmf)
4+
[![Coverage Status](https://coveralls.io/repos/github/PHPOffice/WMF/badge.svg?branch=master)](https://coveralls.io/github/PHPOffice/WMF?branch=master)
5+
[![Total Downloads](https://poser.pugx.org/phpoffice/wmf/downloads)](https://packagist.org/packages/phpoffice/wmf)
6+
[![License](https://poser.pugx.org/phpoffice/wmf/license)](https://packagist.org/packages/phpoffice/wmf)
7+
[![CI](https://github.com/PHPOffice/WMF/actions/workflows/php.yml/badge.svg)](https://github.com/PHPOffice/WMF/actions/workflows/php.yml)
8+
9+
WMF is a library written in pure PHP that provides a set of classes to read WMF based file (like `.wmf` or `.emf` files).
10+
11+
WMF is an open source project licensed under the terms of [MIT](https://github.com/PHPOffice/WMF/blob/master/LICENCE). WMF is aimed to be a high quality software product by incorporating [continuous integration and unit testing](https://github.com/PHPOffice/WMF/actions/workflows/php.yml). You can learn more about WMF by reading this Developers'Documentation and the [API Documentation](http://phpoffice.github.io/WMF/docs/develop/)
12+
13+
If you have any questions, please ask on [StackOverFlow](https://stackoverflow.com/questions/tagged/phpoffice-wmf)
14+
15+
Read more about WMF:
16+
17+
- [Features](#features)
18+
- [Requirements](#requirements)
19+
- [Installation](#installation)
20+
- [Contributing](#contributing)
21+
- [Developers' Documentation](https://phpoffice.github.io/WMF/)
22+
23+
## Features
24+
25+
- Read files
26+
27+
* WMF files
28+
* (EMF files, not for the moment)
29+
* (EMF+ files, not for the moment)
30+
31+
## Requirements
32+
33+
WMF requires the following:
34+
35+
- PHP 7.1+
36+
37+
## Installation
38+
39+
WMF is installed via [Composer](https://getcomposer.org/).
40+
To [add a dependency](https://getcomposer.org/doc/04-schema.md#package-links) to WMF in your project, either
41+
42+
Run the following to use the latest stable version
43+
```sh
44+
composer require phpoffice/wmf
45+
```
46+
or if you want the latest unreleased version
47+
```sh
48+
composer require phpoffice/wmf:dev-master
49+
```
50+
51+
## Contributing
52+
53+
We welcome everyone to contribute to PHPWord. Below are some of the things that you can do to contribute.
54+
55+
- [Fork us](https://github.com/PHPOffice/WMF/fork) and [request a pull](https://github.com/PHPOffice/WMF/pulls) to the [master](https://github.com/PHPOffice/WMF/tree/master) branch.
56+
- Submit [bug reports or feature requests](https://github.com/PHPOffice/WMF/issues) to GitHub.
57+
- Follow [@PHPOffice](https://twitter.com/PHPOffice) on Twitter.

docs/changes/0.1.0.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# 0.1.0
2+
3+
## Enhancements
4+
5+
- Initial version by [@Progi1984](https://github/Progi1984)
6+
- Enable/Disable Exceptions in [#3](https://github.com/PHPOffice/WMF/pull/3) by [@Progi1984](https://github/Progi1984)
7+
8+
## Bug fixes
9+
10+
- N/A
11+
12+
## Miscellaneous
13+
14+
- Github Action : PHP (PHPCSFixer / PHPStan / PHPUnit) in [#1](https://github.com/PHPOffice/WMF/pull/1) by [@Progi1984](https://github/Progi1984)
15+
- Refactored WMF Reader in [#2](https://github.com/PHPOffice/WMF/pull/2) by [@Progi1984](https://github/Progi1984)
16+
- Github Action : Documentation in [#4](https://github.com/PHPOffice/WMF/pull/4) by [@Progi1984](https://github/Progi1984)
17+

docs/credits.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## References
2+
3+
### WMF
4+
5+
### EMF
6+
7+
### EMF+

docs/index.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
3+
WMF is a library written in pure PHP that provides a set of classes to read WMF based file (like `.wmf` or `.emf` files).
4+
5+
WMF is an open source project licensed under the terms of [MIT](https://github.com/PHPOffice/WMF/blob/master/LICENCE). WMF is aimed to be a high quality software product by incorporating [continuous integration and unit testing](https://github.com/PHPOffice/WMF/actions/workflows/php.yml). You can learn more about WMF by reading this Developers'Documentation and the [API Documentation](http://phpoffice.github.io/WMF/docs/develop/)
6+
7+
## Features
8+
9+
- Read files
10+
11+
* WMF files
12+
* (EMF files, not for the moment)
13+
* (EMF+ files, not for the moment)
14+
15+
## Contributing
16+
17+
We welcome everyone to contribute to WMF. Below are some of the things that you can do to contribute:
18+
19+
- [Fork us](https://github.com/PHPOffice/WMF/fork) and [request a pull](https://github.com/PHPOffice/WMF/pulls) to the [master](https://github.com/PHPOffice/WMF/tree/master) branch
20+
- Submit [bug reports or feature requests](https://github.com/PHPOffice/WMF/issues) to GitHub
21+
- Follow [@PHPOffice](https://twitter.com/PHPOffice) on Twitter

docs/install.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Installation
2+
3+
## Requirements
4+
5+
Mandatory:
6+
7+
- PHP 7.1+
8+
9+
## Installation
10+
11+
### Using Composer
12+
13+
To install via [Composer](http://getcomposer.org), add the following lines to your `composer.json`:
14+
15+
``` json
16+
{
17+
"require": {
18+
"phpoffice/wmf": "dev-master"
19+
}
20+
}
21+
```

docs/usage/wmf.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# WMF
2+
3+
You can load `.wmf` files.
4+
5+
## Backends
6+
7+
You can one of two current backends : `gd` or `imagick`.
8+
If you don't know which one used, you can use the magic one.
9+
10+
```php
11+
<?php
12+
13+
use PhpOffice\WMF\Reader\WMF\GD;
14+
use PhpOffice\WMF\Reader\WMF\Imagick;
15+
use PhpOffice\WMF\Reader\WMF\Magic;
16+
17+
// Choose which backend you want
18+
$reader = new GD();
19+
$reader = new Imagick();
20+
$reader = new Magic();
21+
22+
$reader->load('sample.wmf');
23+
```
24+
25+
For next sample, I will use the magic one.
26+
27+
## Methods
28+
29+
### `getResource`
30+
31+
The method returns the resource used in internal by the library.
32+
33+
The `GD` backend returns a `GDImage` object or resource, depending the PHP version.
34+
The `Imagick` backend returns a `Imagick` object.
35+
36+
```php
37+
<?php
38+
39+
use PhpOffice\WMF\Reader\WMF\Magic;
40+
41+
$reader = new Magic();
42+
43+
$wmf = $reader->load('sample.wmf');
44+
45+
var_dump($wmf->getResource());
46+
```
47+
48+
### `getMediaType`
49+
50+
The method returns the media type for a WMF file
51+
52+
```php
53+
<?php
54+
55+
use PhpOffice\WMF\Reader\WMF\Magic;
56+
57+
$reader = new Magic();
58+
59+
$mediaType = $reader->getMediaType();
60+
61+
echo 'The media type for a WMF file is ' . $$mediaType;
62+
```
63+
64+
### `isWMF`
65+
66+
The method allows to know if the file is supported by the library.
67+
68+
```php
69+
<?php
70+
71+
use PhpOffice\WMF\Reader\WMF\Magic;
72+
73+
$reader = new Magic();
74+
75+
$isWMF = $reader->isWMF('sample.wmf');
76+
77+
echo 'The file sample.wmf ' . ($isWMF ? 'is a WMF file' : 'is not a WMF file');
78+
```
79+
80+
### `load`
81+
82+
The method load a WMF file in the object
83+
84+
```php
85+
<?php
86+
87+
use PhpOffice\WMF\Reader\WMF\Magic;
88+
89+
$reader = new Magic();
90+
91+
$wmf = $reader->load('sample.wmf');
92+
```
93+
94+
### `save`
95+
96+
The method transforms the loaded WMF file in an another image.
97+
98+
```php
99+
<?php
100+
101+
use PhpOffice\WMF\Reader\WMF\Magic;
102+
103+
$reader = new Magic();
104+
105+
$wmf = $reader->load('sample.wmf');
106+
$wmf->save('sample.png', 'png');
107+
```

mkdocs.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
site_name: WMF
2+
site_url: https://phpoffice.github.io/WMF
3+
repo_url: https://github.com/PHPOffice/WMF
4+
repo_name: PHPOffice/WMF
5+
edit_uri: edit/master/docs/
6+
7+
## Theme
8+
theme:
9+
name: material
10+
palette:
11+
primary: grey
12+
features:
13+
- search.highlight
14+
- search.suggest
15+
16+
## Plugins
17+
plugins:
18+
- search
19+
20+
## Config
21+
extra:
22+
generator: false
23+
extra_javascript:
24+
- https://polyfill.io/v3/polyfill.min.js?features=es6
25+
markdown_extensions:
26+
## Syntax highlighting
27+
- pymdownx.highlight
28+
- pymdownx.superfences
29+
## Support for emojis
30+
- pymdownx.emoji:
31+
emoji_index: !!python/name:materialx.emoji.twemoji
32+
emoji_generator: !!python/name:materialx.emoji.to_svg
33+
## Support for call-outs
34+
- admonition
35+
- pymdownx.details
36+
use_directory_urls: false
37+
38+
## Navigation
39+
nav:
40+
- Introduction: 'index.md'
41+
- Install: 'install.md'
42+
- Usage:
43+
- WMF: 'usage/wmf.md'
44+
- Credits: 'credits.md'
45+
- Releases:
46+
- '0.1.0 (WIP)': 'changes/0.1.0.md'
47+
- Developers:
48+
- 'Coveralls': 'https://coveralls.io/github/PHPOffice/WMF'
49+
- 'Code Coverage': 'coverage/index.html'
50+
- 'PHPDoc': 'docs/index.html'

0 commit comments

Comments
 (0)