forked from CenterForOpenScience/ember-osf-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
1,671 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{docs-header}} | ||
{{outlet}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{source}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{#if model.isComponent}} | ||
{{api/x-component component=model}} | ||
{{else if model.isClass}} | ||
{{api/x-class class=model}} | ||
{{else}} | ||
{{api/x-module module=model}} | ||
{{/if}} |
7 changes: 7 additions & 0 deletions
7
lib/handbook/addon/docs/components/loading-indicator/demo-dark/template.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{#docs-demo as |demo|}} | ||
{{#demo.example name='loading-indicator.dark.hbs'}} | ||
{{loading-indicator dark=true}} | ||
{{/demo.example}} | ||
|
||
{{demo.snippet 'loading-indicator.dark.hbs'}} | ||
{{/docs-demo}} |
3 changes: 3 additions & 0 deletions
3
lib/handbook/addon/docs/components/loading-indicator/demo-default/styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.dark-background { | ||
background-color: #666; | ||
} |
11 changes: 11 additions & 0 deletions
11
lib/handbook/addon/docs/components/loading-indicator/demo-default/template.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{#docs-demo as |demo|}} | ||
{{#demo.example}} | ||
<div local-class='dark-background'> | ||
{{! BEGIN-SNIPPET loading-indicator.default.hbs }} | ||
{{loading-indicator}} | ||
{{! END-SNIPPET }} | ||
</div> | ||
{{/demo.example}} | ||
|
||
{{demo.snippet 'loading-indicator.default.hbs'}} | ||
{{/docs-demo}} |
9 changes: 9 additions & 0 deletions
9
lib/handbook/addon/docs/components/loading-indicator/template.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Loading Indicator | ||
|
||
This component indicates loading. | ||
|
||
## For dark backgrounds | ||
{{docs/components/loading-indicator/demo-default}} | ||
|
||
## For light backgrounds | ||
{{docs/components/loading-indicator/demo-dark}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# How to Contribute | ||
|
||
Make a PR! | ||
|
||
To enable the handbook locally, add the following to your `ember-osf-web/config/local.js`: | ||
```js | ||
module.exports = { | ||
HANDBOOK_ENABLED: true, | ||
}; | ||
``` | ||
|
||
## Adding a docs page | ||
These pages are nice, friendly markdown files that live in `lib/handbook/addon/docs/`. | ||
To add a new page: | ||
|
||
1. Add a route to `lib/handbook/addon/routes.js`: | ||
```js | ||
this.route('docs', function() { | ||
// ... | ||
this.route('my-new-page'); | ||
} | ||
``` | ||
1. Add a link to the sidebar nav in `lib/handbook/addon/docs/template.hbs`: | ||
```hbs | ||
{{#docs-viewer as |viewer|}} | ||
{{#viewer.nav project=model as |nav|}} | ||
[...] | ||
{{nav.item 'My new page' 'docs.my-new-page'}} | ||
{{/viewer.nav}} | ||
{{/docs-viewer}} | ||
``` | ||
1. Let your thoughts fall into markdown at `lib/handbook/addon/docs/my-new-page/template.md` | ||
## Adding a component to the gallery | ||
Follow the steps above to add a markdown page for your component at | ||
`docs.components.my-component`, then use `{{docs-demo}}` to display your | ||
component next to the actual code used to render it. | ||
Check out the | ||
{{#link-to 'docs.components.loading-indicator'}}`{{loading-indicator}}` demo{{/link-to}} | ||
for a simple example. | ||
## Docs TODO | ||
- Fill out all the docs pages with useful info | ||
- Add more components to the component gallery | ||
- Improve auto-generated API reference | ||
- Move to another section, a second link in the header | ||
- Add `@ignore` to things that shouldn't be there | ||
- Add docstrings to more stuff | ||
- Fix import paths (`app/models/...` should be `ember-osf-web/models/...`) | ||
- Component arguments aren't internal | ||
- Easy deployment to Github Pages | ||
- Fix bugs | ||
- Intermittent error on rebuild? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Coding Conventions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Dev Environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# OSF Front-end Developer Handbook | ||
|
||
Yay new handbook! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Quickstart | ||
|
||
First, create the universe. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Additional Resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Route from '@ember/routing/route'; | ||
|
||
export default class DocsRoute extends Route { | ||
model() { | ||
return this.store.findRecord('project', 'osf-components'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pre { | ||
border: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{{#docs-viewer as |viewer|}} | ||
{{#viewer.nav project=model as |nav|}} | ||
{{nav.section 'Introduction'}} | ||
{{nav.item 'What is this handbook?' 'docs.index'}} | ||
{{nav.item 'How to contribute' 'docs.contributing'}} | ||
|
||
{{nav.section 'Development'}} | ||
{{nav.item 'Quickstart' 'docs.quickstart'}} | ||
{{nav.item 'Dev environment' 'docs.dev-env'}} | ||
{{nav.item 'Coding conventions' 'docs.conventions'}} | ||
{{nav.item 'Testing' 'docs.testing'}} | ||
{{nav.item 'Additional resources' 'docs.resources'}} | ||
|
||
{{nav.section 'Component gallery'}} | ||
{{nav.item 'Loading indicator' 'docs.components.loading-indicator'}} | ||
|
||
{{nav.section 'Style guide'}} | ||
{{nav.item 'Visual style' 'docs.visual-style'}} | ||
{{nav.item 'Written style' 'docs.written-style'}} | ||
{{/viewer.nav}} | ||
|
||
{{#viewer.main}} | ||
<div class="docs-container"> | ||
<div class="docs-section"> | ||
{{outlet}} | ||
</div> | ||
</div> | ||
{{/viewer.main}} | ||
{{/docs-viewer}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Testing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Visual Style |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Written Style |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Engine from 'ember-engines/engine'; | ||
import loadInitializers from 'ember-load-initializers'; | ||
import config from './config/environment'; | ||
import Resolver from './resolver'; | ||
|
||
const { modulePrefix } = config; | ||
|
||
const Eng = Engine.extend({ | ||
modulePrefix, | ||
Resolver, | ||
dependencies: { | ||
services: [ | ||
'router', | ||
], | ||
}, | ||
|
||
// HACK: ec-tailwind (used by ec-addon-docs) doesn't understand engines | ||
rootElement: 'body', | ||
}); | ||
|
||
loadInitializers(Eng, modulePrefix); | ||
|
||
export default Eng; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.Link { | ||
display: flex; | ||
justify-content: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{docs-hero | ||
logo='ember' | ||
slimHeading='OSF' | ||
strongHeading='Web' | ||
byline='Front-end Developer Handbook' | ||
}} | ||
|
||
<div local-class='Link'> | ||
{{#link-to 'docs' class='btn btn-primary'}}Begin!{{/link-to}} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Resolver from 'ember-resolver'; | ||
|
||
export default Resolver; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import buildRoutes from 'ember-engines/routes'; | ||
|
||
export default buildRoutes(function() { | ||
this.route('docs', function() { | ||
this.route('intro'); | ||
this.route('assumptions'); | ||
this.route('contributing'); | ||
|
||
// Dev | ||
this.route('quickstart'); | ||
this.route('git'); | ||
this.route('dev-env'); | ||
this.route('conventions'); | ||
this.route('testing'); | ||
this.route('community'); | ||
this.route('resources'); | ||
|
||
// Style guide | ||
this.route('visual-style'); | ||
this.route('written-style'); | ||
|
||
this.route('components', function() { | ||
this.route('loading-indicator'); | ||
}); | ||
|
||
this.route('api', function() { | ||
this.route('item', { path: '/*path' }); | ||
}); | ||
}); | ||
|
||
this.route('not-found', { path: '/*path' }); | ||
}); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const AddonDocsConfig = require('ember-cli-addon-docs/lib/config'); | ||
|
||
module.exports = class extends AddonDocsConfig { | ||
}; |
Oops, something went wrong.