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 HTML docs to Pages #62

Merged
merged 16 commits into from
May 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,34 @@ on:
- master

jobs:
pages:
name: Documentation for Pages
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Generate Documentation for Pages
uses: sersoft-gmbh/swifty-docs-action@v1
- name: Upload to GitHub Pages
uses: crazy-max/[email protected]
with:
build_dir: "docs"
env:
GITHUB_PAT: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
wiki:
name: Documentation
name: Documentation for Wiki
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install swift-doc
run: |
git clone https://github.com/SwiftDocOrg/swift-doc
cd swift-doc
sudo make install
cd ..
- name: Generate Documentation for Wiki
run: swift-doc generate Sources/Fluxor* --module-name Fluxor --output Documentation-Wiki
uses: SwiftDocOrg/swift-doc@master
with:
inputs: "Sources"
format: "commonmark"
module-name: Fluxor
output: "Documentation-Wiki"
- name: Upload to Wiki
uses: SwiftDocOrg/github-wiki-publish-action@v1
with:
path: "Documentation-Wiki"
env:
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
# - name: Generate Documentation for Pages
# run: swift-doc generate Sources/Fluxor* --module-name Fluxor --output Documentation-Pages --format html
# - name: Upload to GitHub Pages
# uses: crazy-max/[email protected]
# with:
# build_dir: "Documentation-Pages"
45 changes: 45 additions & 0 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module: Fluxor
author: Morten Bjerg Gregersen
github_url: https://github.com/FluxorOrg/Fluxor
copyright: '© 2020 under [open source license](https://github.com/FluxorOrg/Fluxor/blob/master/LICENSE).'
swift_version: 5.2

documentation: "Documentation/Guides/*.md"
abstract: "Documentation/Abstracts/*.md"

custom_categories:
- name: Store
children:
- Store
- name: Actions
children:
- Action
- ActionTemplate
- AnonymousAction
- name: Reducers
children:
- Reducer
- ReduceOn
- name: Selectors
children:
- SelectorProtocol
- Selector
- name: Effects
children:
- Effects
- Effect
- name: Extensions
children:
- Publisher
- name: Debugging
children:
- Interceptor
- PrintInterceptor
- name: SwiftUI
children:
- ObservableValue
- ValueBinding
- name: Test Support
children:
- MockStore
- TestInterceptor
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ class SettingsEffectsTests: XCTestCase {
XCTAssertEqual(result[0], Actions.hideColorPicker())
}
}
```
```
2 changes: 1 addition & 1 deletion Sources/Fluxor/Action.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Fluxor
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Sources/Fluxor/Effects.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Fluxor
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Sources/Fluxor/Interceptor.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Fluxor
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Sources/Fluxor/Interceptors/PrintInterceptor.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Fluxor
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Sources/Fluxor/Operators/ActionPublisher+OfType.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Fluxor
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Fluxor
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Fluxor
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Sources/Fluxor/Reducer.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Fluxor
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Sources/Fluxor/Selector.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Fluxor
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
12 changes: 6 additions & 6 deletions Sources/Fluxor/Store.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Fluxor
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand All @@ -13,15 +13,15 @@ import struct Foundation.UUID

A `Store` is configured by registering all the desired `Reducer`s and `Effects`s.

# Usage
## Usage
To update the `State` callers dispatch `Action`s on the `Store`.

# Interceptors
It is possible to intercept all `Action`s and `State` changes by registering an `Interceptor`.

# Selecting
## Selecting
To select a value in the `State` the callers can either use a `Selector` or a key path.
It is possible to get a `Publisher` for the value or just to select the current value.

## Interceptors
It is possible to intercept all `Action`s and `State` changes by registering an `Interceptor`.
*/
open class Store<State: Encodable> {
internal private(set) var state: CurrentValueSubject<State, Never>
Expand Down
2 changes: 1 addition & 1 deletion Sources/FluxorSwiftUI/ObservableValue.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* FluxorSwiftUI
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Sources/FluxorSwiftUI/ValueBinding.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* FluxorSwiftUI
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
18 changes: 9 additions & 9 deletions Sources/FluxorTestSupport/Effect+Run.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* FluxorTestSupport
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand All @@ -10,14 +10,8 @@ import Fluxor
import XCTest

public extension Effect {
/// `Error`s which can be thrown when running `Effect`s
enum RunError: Error {
/// The `Effect` can't be run this way
case wrongType
}

/**
Run the `Effect` with the specified `Action` and return the published `Action`s.
__TestSupport:__ Run the `Effect` with the specified `Action` and return the published `Action`s.

The `expectedCount` defines how many `Action`s the `Publisher` should publish before they are returned.

Expand All @@ -43,7 +37,7 @@ public extension Effect {
}

/**
Run the `Effect` with the specified `Action`.
__TestSupport:__ Run the `Effect` with the specified `Action`.

- Parameter action: The `Action` to send to the `Effect`
*/
Expand All @@ -54,6 +48,12 @@ public extension Effect {
effectCreator(actions.eraseToAnyPublisher()).store(in: &cancellables)
actions.send(action)
}

/// `Error`s which can be thrown when running `Effect`s
internal enum RunError: Error {
/// The `Effect` can't be run this way
case wrongType
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Sources/FluxorTestSupport/MockStore.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* FluxorTestSupport
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Sources/FluxorTestSupport/TestInterceptor.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* FluxorTestSupport
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Tests/FluxorSwiftUITests/ObservableValueTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* FluxorSwiftUITests
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Tests/FluxorSwiftUITests/ValueBindingTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* FluxorSwiftUITests
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Tests/FluxorTests/ActionTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* FluxorTests
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Tests/FluxorTests/EffectsTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* FluxorTests
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Tests/FluxorTests/Interceptors/PrintInterceptorTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* FluxorTests
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Tests/FluxorTests/Interceptors/TestInterceptorTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* FluxorTests
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Tests/FluxorTests/MockStoreTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* FluxorTests
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* FluxorTests
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* FluxorTests
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Tests/FluxorTests/SelectorTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* FluxorTests
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down
2 changes: 1 addition & 1 deletion Tests/FluxorTests/StoreTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* FluxorTests
* Copyright (c) Morten Bjerg Gregersen 2020
* MIT license, see LICENSE file for details
Expand Down