Skip to content
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
36 changes: 14 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ The example found in the repo can be taken for a test-drive [here](http://tylors
Here is a rundown of the `example` provided with this repo in the folder `/example`. This should allow a better understanding of how to use cyclic-router, for simplicity the styling has been removed here.

Starting in the file which has Cycle `run`, router driver needs to be created here along with the other drivers that you might be using.
Looking at the imports below, [cyclic-history](https://github.com/tylors/cyclic-history) is being used instead of cycle-history.

```js
// main.js
import {run} from '@cycle/core'
import {makeDOMDriver} from 'cycle-snabbdom'
import {makeHistoryDriver} from 'cyclic-history'
import {makeRouterDriver} from 'cyclic-router'
import {createHashHistory} from 'history'

Expand All @@ -47,12 +45,10 @@ import app from './app' // the function of your app
run(app, {
DOM: makeDOMDriver('#app'),
// Notice how you need to feed in funcs from cyclic-history + history
router: makeRouterDriver(makeHistoryDriver(createHashHistory())),
router: makeRouterDriver(createHashHistory()),
})
```

In this instance we are using `cyclic-history` and `history` to deal with the history API, have a read of the history [docs](https://github.com/rackt/history/tree/master/docs#readme) to find out more information on how that all works.

###2.

App.js will be used as the place for showing the correct component in reference to current url (what you'd expect from a router!).
Expand Down Expand Up @@ -86,15 +82,15 @@ function view(sidebar, children) {

function App(sources) {
const {router} = sources // get router out of sources
const {path$, value$} = router.define(routes) // pass routes into the router
const sidebar = Sidebar(sources, path$) // pass in sources and path$ into our sidebar
const match$ = router.define(routes) // pass routes into the router
const sidebar = Sidebar(sources, match$.pluck('path')) // pass in sources and path$ into our sidebar

// childrenDOM$ takes path$ from `router.define(routes)` above and zips it with values, here is where
// the components swap in reference to the current url, notice router.path(path) is also passed in
// for later use in nested routes.
// This allows components to be nested without ever knowing they are actually nested.
const childrenDOM$ = path$.zip(value$,
(path, value) => value({...sources, router: router.path(path)}).DOM
const childrenDOM$ = match$.map(
({path, value}) => value({...sources, router: router.path(path)}).DOM
)

return {
Expand Down Expand Up @@ -161,35 +157,31 @@ const routes = {
'/compose': Compose,
}

function view(createHref, path$, children) {
return path$.map(() => {
return div({},[
function view(createHref) {
return (children) =>
div({}, [
ul([
li([
a({props: {href: createHref('/why')},
}, 'Why Cyclic Router?'),
a({props: {href: createHref('/why')}}, 'Why Cyclic Router?'),
]),
li([
a({props: {href: createHref('/built')},
}, 'Built For Cycle.js'),
a({props: {href: createHref('/built')}}, 'Built For Cycle.js'),
]),
li([
a({props: {href: createHref('/compose')},
}, 'Compose a Message'),
a({props: {href: createHref('/compose')}}, 'Compose a Message'),
]),
]),
children,
])
})
}

function Inbox(sources) {
const {router} = sources
const {path$, value$} = router.define(routes)
const match$ = router.define(routes)

const childrenDOM$ = value$.map(value => value(sources).DOM)
const childrenDOM$ = match$.map(({value}) => value(sources).DOM)

return {DOM: view(router.createHref, path$, childrenDOM$)}
return {DOM: childrenDOM$.map(view(router.createHref))}
}

export default Inbox
Expand Down
93 changes: 93 additions & 0 deletions docs/assets/fonts/source-code-pro/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.

This Font Software is licensed under the SIL Open Font License, Version 1.1.

This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
20 changes: 20 additions & 0 deletions docs/assets/fonts/source-code-pro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Source Code Pro

Source Code Pro is a set of OpenType fonts that have been designed to work well
in user interface (UI) environments. In addition to a functional OpenType font, this open
source project provides all of the source files that were used to build this OpenType font
by using the AFDKO makeotf tool.

## Font installation instructions

* [Mac OS X](http://support.apple.com/kb/HT2509)
* [Windows](http://windows.microsoft.com/en-us/windows-vista/install-or-uninstall-fonts)
* [Linux/Unix-based systems](https://github.com/adobe-fonts/source-code-pro/issues/17#issuecomment-8967116)

## Getting Involved

Send suggestions for changes to the Source Code OpenType font project maintainer, [Paul D. Hunt](mailto:[email protected]?subject=[GitHub] Source Code Pro), for consideration.

## Further information

For information about the design and background of Source Code, please refer to the [official font readme file](http://www.adobe.com/products/type/font-information/source-code-pro-readme.html).
Binary file not shown.
15 changes: 15 additions & 0 deletions docs/assets/fonts/source-code-pro/source-code-pro.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@font-face{
font-family: 'Source Code Pro';
font-weight: 400;
font-style: normal;
font-stretch: normal;
src: url('WOFF/OTF/SourceCodePro-Regular.otf.woff') format('woff');
}

@font-face{
font-family: 'Source Code Pro';
font-weight: 500;
font-style: normal;
font-stretch: normal;
src: url('WOFF/OTF/SourceCodePro-Medium.otf.woff') format('woff');
}
93 changes: 93 additions & 0 deletions docs/assets/fonts/source-sans-pro/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2010, 2012, 2014 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.

This Font Software is licensed under the SIL Open Font License, Version 1.1.

This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
20 changes: 20 additions & 0 deletions docs/assets/fonts/source-sans-pro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Source Sans Pro

Source Sans Pro is a set of OpenType fonts that have been designed to work well
in user interface (UI) environments. In addition to a functional OpenType font, this open
source project provides all of the source files that were used to build this OpenType font
by using the AFDKO makeotf tool.

## Font installation instructions

* [Mac OS X](http://support.apple.com/kb/HT2509)
* [Windows](http://windows.microsoft.com/en-us/windows-vista/install-or-uninstall-fonts)
* [Linux/Unix-based systems](https://github.com/adobe-fonts/source-code-pro/issues/17#issuecomment-8967116)

## Getting Involved

Send suggestions for changes to the Source Sans OpenType font project maintainer, [Paul D. Hunt](mailto:[email protected]?subject=[GitHub] Source Sans Pro), for consideration.

## Further information

For information about the design and background of Source Sans, please refer to the [official font readme file](http://www.adobe.com/products/type/font-information/source-sans-pro-readme.html).
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions docs/assets/fonts/source-sans-pro/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "source-sans-pro",
"version": "2.020R-ro/1.075R-it",
"main": "source-sans-pro.css",
"homepage": "https://github.com/adobe-fonts/source-sans-pro",
"repository": {
"type": "git",
"url": "https://github.com/adobe-fonts/source-sans-pro.git"
},
"authors": [
{ "name": "Paul D. Hunt" }
],
"description": "Source Sans Pro font family by Adobe",
"license": "SIL OFL 1.1",
"keywords": ["font", "sourcesans", "sourcesanspro", "source sans", "source sans pro"],
"ignore": ["**/.*"]
}
31 changes: 31 additions & 0 deletions docs/assets/fonts/source-sans-pro/source-sans-pro.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@font-face{
font-family: 'Source Sans Pro';
font-weight: 300;
font-style: normal;
font-stretch: normal;
src: url('WOFF/OTF/SourceSansPro-Light.otf.woff') format('woff');
}

@font-face{
font-family: 'Source Sans Pro';
font-weight: 400;
font-style: normal;
font-stretch: normal;
src: url('WOFF/OTF/SourceSansPro-Regular.otf.woff') format('woff');
}

@font-face{
font-family: 'Source Sans Pro';
font-weight: 600;
font-style: normal;
font-stretch: normal;
src: url('WOFF/OTF/SourceSansPro-Semibold.otf.woff') format('woff');
}

@font-face{
font-family: 'Source Sans Pro';
font-weight: 700;
font-style: normal;
font-stretch: normal;
src: url('WOFF/OTF/SourceSansPro-Bold.otf.woff') format('woff');
}
3 changes: 3 additions & 0 deletions docs/assets/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@import url(fonts/source-sans-pro/source-sans-pro.css);
@import url(fonts/source-code-pro/source-code-pro.css);

.documentation a {
color: #1184CE;
}
Expand Down
Loading