Skip to content

Commit

Permalink
Migrate documentation to VuePress
Browse files Browse the repository at this point in the history
GitBook development seems a bit stuck right now so let's switch to VuePress which, IMO, is more user friendly. Update the documentation to include the version number in which features were added and use custom container to display notes and warnings.
  • Loading branch information
simonbrunel committed Sep 9, 2018
1 parent 051fed5 commit eebcb4f
Show file tree
Hide file tree
Showing 38 changed files with 297 additions and 155 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<a href="https://promisesaplus.com/" title="Promises/A+ 1.1"><img src="https://promisesaplus.com/assets/logo-small.png" alt="Promises/A+" align="right"/></a>

# QtPromise

[![qpm](https://img.shields.io/github/release/simonbrunel/qtpromise.svg?style=flat-square&label=qpm&colorB=4CAF50)](https://www.qpm.io/packages/com.github.simonbrunel.qtpromise/index.html) [![Travis](https://img.shields.io/travis/simonbrunel/qtpromise/master.svg?style=flat-square)](https://travis-ci.org/simonbrunel/qtpromise) [![coverage](https://img.shields.io/codecov/c/github/simonbrunel/qtpromise.svg?style=flat-square)](https://codecov.io/gh/simonbrunel/qtpromise)

[Promises/A+](https://promisesaplus.com/) implementation for [Qt/C++](https://www.qt.io/).
Expand All @@ -9,10 +10,11 @@ Requires [Qt 5.6](https://www.qt.io/download/) (or later) with [C++11 support en

## Documentation

* [Getting Started](https://qtpromise.netlify.com/qtpromise/getting-started)
* [Thread-Safety](https://qtpromise.netlify.com/qtpromise/thread-safety)
* [QtConcurrent](https://qtpromise.netlify.com/qtpromise/qtconcurrent)
* [API Reference](https://qtpromise.netlify.com/qtpromise/api-reference)
* [Getting Started](https://qtpromise.netlify.com/qtpromise/getting-started.html)
* [QtConcurrent](https://qtpromise.netlify.com/qtpromise/qtconcurrent.html)
* [Thread-Safety](https://qtpromise.netlify.com/qtpromise/thread-safety.html)
* [API Reference](https://qtpromise.netlify.com/qtpromise/api-reference.html)

## License

QtPromise is available under the [MIT license](LICENSE).
40 changes: 0 additions & 40 deletions book.json

This file was deleted.

54 changes: 54 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
module.exports = {
title: 'QtPromise',
description: 'Promises/A+ implementation for Qt/C++',
ga: 'UA-113899811-1',
head: [
['link', { rel: 'icon', href: `/favicon.png` }],
],
themeConfig: {
repo: 'simonbrunel/qtpromise',
lastUpdated: 'Last Updated',
editLinks: true,
docsDir: 'docs',
sidebar: [
'qtpromise/getting-started',
'qtpromise/qtconcurrent',
'qtpromise/thread-safety',
'qtpromise/api-reference',
{
title: 'QPromise',
children: [
'qtpromise/qpromise/constructor',
'qtpromise/qpromise/delay',
'qtpromise/qpromise/each',
'qtpromise/qpromise/fail',
'qtpromise/qpromise/filter',
'qtpromise/qpromise/finally',
'qtpromise/qpromise/isfulfilled',
'qtpromise/qpromise/ispending',
'qtpromise/qpromise/isrejected',
'qtpromise/qpromise/map',
'qtpromise/qpromise/tap',
'qtpromise/qpromise/tapfail',
'qtpromise/qpromise/then',
'qtpromise/qpromise/timeout',
'qtpromise/qpromise/wait',
'qtpromise/qpromise/all.md',
'qtpromise/qpromise/reject.md',
'qtpromise/qpromise/resolve.md'
]
},
{
title: 'Helpers',
children: [
'qtpromise/helpers/attempt',
'qtpromise/helpers/each',
'qtpromise/helpers/filter',
'qtpromise/helpers/map',
'qtpromise/helpers/qpromise',
'qtpromise/helpers/qpromiseall'
]
}
]
}
}
2 changes: 2 additions & 0 deletions docs/.vuepress/override.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$accentColor = #23b223
$textColor = #404244
Binary file added docs/.vuepress/public/favicon.ico
Binary file not shown.
Binary file added docs/.vuepress/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/.vuepress/style.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import 'override.styl'

.content a code
color: $accentColor
6 changes: 0 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,5 @@

Requires [Qt 5.6](https://www.qt.io/download/) (or later) with [C++11 support enabled](https://wiki.qt.io/How_to_use_C++11_in_your_Qt_Projects).

## QtPromise for C++
* [Getting Started](qtpromise/getting-started.md)
* [Thread-Safety](qtpromise/thread-safety.md)
* [QtConcurrent](qtpromise/qtconcurrent.md)
* [API Reference](qtpromise/api-reference.md)

## License
QtPromise is available under the [MIT license](https://github.com/simonbrunel/qtpromise/blob/master/LICENSE).
29 changes: 0 additions & 29 deletions docs/SUMMARY.md

This file was deleted.

15 changes: 0 additions & 15 deletions docs/assets/style.css

This file was deleted.

10 changes: 5 additions & 5 deletions docs/qtpromise/api-reference.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## QPromise
# API Reference

### Public Members
## Functions

* [`QPromise<T>::QPromise`](qpromise/constructor.md)
* [`QPromise<T>::delay`](qpromise/delay.md)
Expand All @@ -18,17 +18,17 @@
* [`QPromise<T>::timeout`](qpromise/timeout.md)
* [`QPromise<T>::wait`](qpromise/wait.md)

### Public Static Members
## Static Functions

* [`[static] QPromise<T>::all`](qpromise/all.md)
* [`[static] QPromise<T>::reject`](qpromise/reject.md)
* [`[static] QPromise<T>::resolve`](qpromise/resolve.md)

## Helpers

* [`qPromise`](helpers/qpromise.md)
* [`qPromiseAll`](helpers/qpromiseall.md)
* [`QtPromise::attempt`](helpers/attempt.md)
* [`QtPromise::each`](helpers/each.md)
* [`QtPromise::filter`](helpers/filter.md)
* [`QtPromise::map`](helpers/map.md)
* [`qPromise`](helpers/qpromise.md)
* [`qPromiseAll`](helpers/qpromiseall.md)
4 changes: 3 additions & 1 deletion docs/qtpromise/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Getting Started

## Installation

QtPromise is a [header-only](https://en.wikipedia.org/wiki/Header-only) library, simply download the [latest release](https://github.com/simonbrunel/qtpromise/releases/latest) (or [`git submodule`](https://git-scm.com/docs/git-submodule)) and include `qtpromise.pri` from your project `.pro`.

## qpm
### qpm

Alternatively and **only** if your project relies on [qpm](https://www.qpm.io/), you can install QtPromise as follow:

Expand Down
8 changes: 7 additions & 1 deletion docs/qtpromise/helpers/attempt.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## `QtPromise::attempt`
---
title: attempt
---

# QtPromise::attempt

*Since: 0.4.0*

```cpp
QtPromise::attempt(Functor functor, Args...) -> QPromise<R>
Expand Down
14 changes: 10 additions & 4 deletions docs/qtpromise/helpers/each.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## `QtPromise::each`
---
title: each
---

# QtPromise::each

*Since: 0.4.0*

```cpp
QtPromise::each(Sequence<T> values, Functor functor) -> QPromise<Sequence<T>>
Expand All @@ -8,10 +14,10 @@ QtPromise::each(Sequence<T> values, Functor functor) -> QPromise<Sequence<T>>
// - Functor: Function(T value, int index) -> void | QPromise<void>
```
Calls the given `functor` on each element in `values` then resolves to the original sequence
unmodified. If `functor` throws, `output` is rejected with the new exception.
Calls the given `functor` on each element in `values` then resolves to the original sequence
unmodified. If `functor` throws, `output` is rejected with the new exception.
If `functor` returns a promise (or `QFuture`), the `output` promise is delayed until all the
If `functor` returns a promise (or `QFuture`), the `output` promise is delayed until all the
promises are resolved. If any of the promises fail, `output` immediately rejects with the error
of the promise that rejected, whether or not the other promises are resolved.
Expand Down
12 changes: 10 additions & 2 deletions docs/qtpromise/helpers/filter.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## `QtPromise::filter`
---
title: filter
---

# QtPromise::filter

*Since: 0.4.0*

```cpp
QtPromise::filter(Sequence<T> values, Filterer filterer) -> QPromise<Sequence<T>>
Expand Down Expand Up @@ -38,7 +44,9 @@ output.then([](const QVector<QUrl>& res) {
});
```

> **Note:** the order of the output sequence values is guarantee to be the same as the original
::: tip NOTE
The order of the output sequence values is guarantee to be the same as the original
sequence, regardless of completion order of the promises returned by `filterer`.
:::

See also: [`QPromise<T>::filter`](../qpromise/filter.md)
12 changes: 10 additions & 2 deletions docs/qtpromise/helpers/map.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## `QtPromise::map`
---
title: map
---

# QtPromise::map

*Since: 0.4.0*

```cpp
QtPromise::map(Sequence<T> values, Mapper mapper) -> QPromise<QVector<R>>
Expand Down Expand Up @@ -37,7 +43,9 @@ output.then([](const QVector<QByteArray>& res) {
});
```

> **Note:** the order of the output sequence values is guarantee to be the same as the original
::: tip NOTE
The order of the output sequence values is guarantee to be the same as the original
sequence, regardless of completion order of the promises returned by `mapper`.
:::

See also: [`QPromise<T>::map`](../qpromise/map.md)
8 changes: 7 additions & 1 deletion docs/qtpromise/helpers/qpromise.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## `qPromise`
---
title: qPromise
---

# qPromise

*Since: 0.1.0*

```
qPromise(T value) -> QPromise<R>
Expand Down
8 changes: 7 additions & 1 deletion docs/qtpromise/helpers/qpromiseall.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## `qPromiseAll`
---
title: qPromiseAll
---

# qPromiseAll

*Since: 0.1.0*

```
qPromiseAll(Sequence<QPromise<T>> promises) -> QPromise<QVector<T>>
Expand Down
8 changes: 7 additions & 1 deletion docs/qtpromise/qpromise/all.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## `[static] QPromise<T>::all`
---
title: ::all [static]
---

# QPromise::all [static]

*Since: 0.1.0*

```
[static] QPromise<T>::all(Sequence<QPromise<T>> promises) -> QPromise<QVector<T>>
Expand Down
14 changes: 11 additions & 3 deletions docs/qtpromise/qpromise/constructor.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
## `QPromise<T>::QPromise`
---
title: constructor
---

```
# QPromise::QPromise

*Since: 0.1.0*

```cpp
QPromise<T>::QPromise(Function resolver)
```

Expand All @@ -18,7 +24,9 @@ QPromise<int> promise([](const QPromiseResolve<int>& resolve, const QPromiseReje
});
```
> **Note:** `QPromise<void>` is specialized to not contain any value, meaning that the `resolve` callback takes no argument.
::: tip NOTE
`QPromise<void>` is specialized to not contain any value, meaning that the `resolve` callback takes no argument.
:::
**C++14**
Expand Down
10 changes: 8 additions & 2 deletions docs/qtpromise/qpromise/delay.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
## `QPromise<T>::delay`
---
title: .delay
---

```
# QPromise::delay

*Since: 0.2.0*

```cpp
QPromise<T>::delay(int msec) -> QPromise<T>
```

Expand Down
Loading

0 comments on commit eebcb4f

Please sign in to comment.