Skip to content

Commit 14166b9

Browse files
authored
Removed babel (#56)
* removed babel * fixed formatter * adjusted travis
1 parent 1f91a9b commit 14166b9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+10657
-7721
lines changed

.eslintrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"plugins": ["prettier"],
3+
"rules": {
4+
"prettier/prettier": "error"
5+
},
6+
"env": {
7+
"node": true,
8+
"es6": true
9+
}
10+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ docs.json
66
npm-debug.log*
77
.DS_Store
88
lerna-debug.log
9+
.cache
910

1011
# Runtime data
1112
pids

.prettierignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
logs
2+
docs.json
3+
*.log
4+
npm-debug.log*
5+
.DS_Store
6+
inch.json
7+
coverage
8+
.nyc_output
9+
/**/test/fixtures
10+
dist
11+
.cache

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"arrowParens": "avoid",
3+
"bracketSpacing": false,
4+
"jsxBracketSameLine": false,
5+
"printWidth": 80,
6+
"proseWrap": "always",
7+
"singleQuote": true,
8+
"tabWidth": 2,
9+
"trailingComma": "es5",
10+
"useTabs": false
11+
}

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
language: node_js
2-
node_js: "8"
3-
before_script:
2+
node_js: '8'
3+
before_install:
4+
- npm install lerna
45
- lerna bootstrap
5-
- lerna link
6+
before_script:
7+
- lerna run prepare
68
script:
79
- npm run coverage
810
after_success:

README.md

Lines changed: 63 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
---
44

5-
A tool for generating usage and styles guides for html components using css block comments.
5+
A tool for generating usage and styles guides for html components using css
6+
block comments.
67

78
## Quick Intro
89

9-
By adding a Topdoc block to your css you can describe an html/css component and that information can be used to generate a styleguide.
10+
By adding a Topdoc block to your css you can describe an html/css component and
11+
that information can be used to generate a styleguide.
1012

1113
Here's an example component:
1214

@@ -32,19 +34,25 @@ tags:
3234

3335
### Why create another css block comment format?
3436

35-
Topdoc was originally created for [Topcoat](http://topcoat.io) and the one feature missing from other generators was support for any and all custom properties. Topdoc is extremely tolerant of custom properties, it just passes them to the template which defines what to do with it.
37+
Topdoc was originally created for [Topcoat](http://topcoat.io) and the one
38+
feature missing from other generators was support for any and all custom
39+
properties. Topdoc is extremely tolerant of custom properties, it just passes
40+
them to the template which defines what to do with it.
3641

37-
The only required properties are `name` and `markup`, other than that, use whatever you need.
42+
The only required properties are `name` and `markup`, other than that, use
43+
whatever you need.
3844

3945
## Installation
4046

41-
Install with npm. It's meant to be command line tool, so you probably want to install it globally (with `-g`).
47+
Install with npm. It's meant to be command line tool, so you probably want to
48+
install it globally (with `-g`).
4249

4350
```sh
4451
npm install -g topdoc
4552
```
4653

47-
You can also use it as a npm script without install it globally. Super helpful for automating your styleguide building:
54+
You can also use it as a npm script without install it globally. Super helpful
55+
for automating your styleguide building:
4856

4957
```sh
5058
npm install --save-dev topdoc
@@ -68,7 +76,8 @@ npm run docs
6876

6977
### Comment Format
7078

71-
Topdoc uses [PostCSS](http://postcss.org/) to divide asunder your css document and find all the relevant component information.
79+
Topdoc uses [PostCSS](http://postcss.org/) to divide asunder your css document
80+
and find all the relevant component information.
7281

7382
Below is an example of a Topdoc comment.
7483

@@ -104,18 +113,25 @@ blarg: very true
104113
}
105114
```
106115

107-
Topdoc comments are identified by the `topdoc` keyword on the first comment line.
116+
Topdoc comments are identified by the `topdoc` keyword on the first comment
117+
line.
108118

109119
The rest of the data uses a [YAML](http://www.yaml.org/) friendly syntax.
110120

111121
The fields can be in any order, but this is a good example for consistency sake.
112122

113123
The following are recommend and/or required fields:
114124

115-
* `name` (required): The full name of the component. Feel free to use spaces, punctuation, etc (name: Sir Button III, esq.)
116-
* `description`: Something more descriptive then the title alone.
117-
* `modifiers`: These can be pseudo classes, or addition rules applied to the component. This must be a [YAML mapping](http://yaml4r.sourceforge.net/doc/page/collections_in_yaml.htm) (`*modifier*:*description*`) which becomes a js hash
118-
* `markup` (required): This is the magic; it's the html that will be used to display the component in the docs. As most markup fields are long, make sure to use the `|` for multiline values.
125+
- `name` (required): The full name of the component. Feel free to use spaces,
126+
punctuation, etc (name: Sir Button III, esq.)
127+
- `description`: Something more descriptive then the title alone.
128+
- `modifiers`: These can be pseudo classes, or addition rules applied to the
129+
component. This must be a
130+
[YAML mapping](http://yaml4r.sourceforge.net/doc/page/collections_in_yaml.htm)
131+
(`*modifier*:*description*`) which becomes a js hash
132+
- `markup` (required): This is the magic; it's the html that will be used to
133+
display the component in the docs. As most markup fields are long, make sure
134+
to use the `|` for multiline values.
119135
```css
120136
/* topdoc
121137
name: Button
@@ -125,16 +141,23 @@ The following are recommend and/or required fields:
125141
<a class="topcoat-button is-disabled">Button</a>
126142
*/
127143
```
128-
* `tags`: Just some obligatory metadata.
129-
* `blarg`: Since Topdoc uses a flexible YAML syntax, feel free to add any additional custom data you might need for your template.
144+
- `tags`: Just some obligatory metadata.
145+
- `blarg`: Since Topdoc uses a flexible YAML syntax, feel free to add any
146+
additional custom data you might need for your template.
130147

131148
### Components
132149

133-
Topdoc assumes everything between two Topdoc comments, and everything after the last Topdoc comment, is a component. Put anything that isn't a component (general styles) above the first Topdoc comment.
150+
Topdoc assumes everything between two Topdoc comments, and everything after the
151+
last Topdoc comment, is a component. Put anything that isn't a component
152+
(general styles) above the first Topdoc comment.
134153

135-
However, the idea of css components is pretty loose because it is rare to have all the required styles for a component in one place.
154+
However, the idea of css components is pretty loose because it is rare to have
155+
all the required styles for a component in one place.
136156

137-
Originally Topdoc was designed to split up the css into components to then use that css in the styleguild to show as a snippet, but honestly that snippet wasn't enough to make the component by itself so it really is only interesting as reference.
157+
Originally Topdoc was designed to split up the css into components to then use
158+
that css in the styleguild to show as a snippet, but honestly that snippet
159+
wasn't enough to make the component by itself so it really is only interesting
160+
as reference.
138161

139162
## Help
140163

@@ -168,31 +191,33 @@ $ topdoc --help
168191
169192
### Source
170193
171-
Specify a source directory with `-s` or `--source`. Defaults to `src/`.
194+
Specify a source directory with `-s` or `--source`. Defaults to `src/`.
172195
173196
```bash
174197
topdoc -s release/css/
175198
```
176199
177200
### Destination
178201
179-
Specify a destination with `-d` or `--destination`. Defaults to `docs/`.
202+
Specify a destination with `-d` or `--destination`. Defaults to `docs/`.
180203
181204
```bash
182205
topdoc -d topdocs/
183206
```
184207
185208
### Template
186209
187-
Specify a template with `-t` or `--template`. A default template is included in Topdoc if one is not provided.
210+
Specify a template with `-t` or `--template`. A default template is included in
211+
Topdoc if one is not provided.
188212
189213
The template can be a single [jade](https://github.com/visionmedia/jade) file:
190214
191215
```bash
192216
topdoc -t template/template.jade
193217
```
194218
195-
or a directory (it will duplicate the whole template directory and look for index.jade in the template folder provided):
219+
or a directory (it will duplicate the whole template directory and look for
220+
index.jade in the template folder provided):
196221
197222
```bash
198223
topdoc -t /template
@@ -226,9 +251,13 @@ yeilds:
226251
227252
## `package.json` Configuration
228253
229-
All the options can be configured in the package.json file. This is super helpful if you are always using the same configuration. It will look in the package.json file if it exists, but can be overridden by the command line options.
254+
All the options can be configured in the package.json file. This is super
255+
helpful if you are always using the same configuration. It will look in the
256+
package.json file if it exists, but can be overridden by the command line
257+
options.
230258
231-
Also, additional data can be passed through to the jade template. Below is an example:
259+
Also, additional data can be passed through to the jade template. Below is an
260+
example:
232261
233262
```json
234263
{
@@ -249,7 +278,7 @@ Also, additional data can be passed through to the jade template. Below is an e
249278
"download": {
250279
"url": "#",
251280
"label": "Download version 0.4"
252-
},
281+
},
253282
"homeURL": "http://topcoat.io",
254283
"siteNav": [
255284
{
@@ -288,7 +317,8 @@ The jade template has data passed through by default:
288317
289318
### Document Object
290319
291-
The `document` object contains relevant information about just the current document being generated below is an example:
320+
The `document` object contains relevant information about just the current
321+
document being generated below is an example:
292322
293323
```json
294324
{
@@ -318,7 +348,8 @@ The `document` object contains relevant information about just the current docum
318348
319349
### Nav Object
320350
321-
The `nav` object contains names and urls to all the generated html files. In the jade template this can utilized to create a navigation to the other pages.
351+
The `nav` object contains names and urls to all the generated html files. In the
352+
jade template this can utilized to create a navigation to the other pages.
322353
323354
```jade
324355
nav.site: ul
@@ -331,12 +362,16 @@ nav.site: ul
331362
332363
### Project Object
333364
334-
The `project` object contains relevant project information. Currently it only contains the `title` property. (passed through the command line `-p` option, or through the package.json information).
365+
The `project` object contains relevant project information. Currently it only
366+
contains the `title` property. (passed through the command line `-p` option, or
367+
through the package.json information).
335368
336369
```jade
337370
title=project.title
338371
```
339372
340373
### TemplateData Object
341374
342-
As mentioned above, additional data can be passed through to the template in the package.json file. This is accessible in the template as the `templateData` object. See the example above.
375+
As mentioned above, additional data can be passed through to the template in the
376+
package.json file. This is accessible in the template as the `templateData`
377+
object. See the example above.

lerna.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
22
"lerna": "3.0.0-rc.0",
3-
"packages": [
4-
"packages/*"
5-
],
3+
"packages": ["packages/*"],
64
"version": "independent"
75
}

0 commit comments

Comments
 (0)