Skip to content

Commit e495625

Browse files
committed
Update README.md
1 parent 274a705 commit e495625

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,35 @@
1-
sourcejs-spec-dependencies
2-
==========================
1+
# Spec Dependencies (crosslinks)
2+
3+
Spec Dependencies is [SourceJS](http://sourcejs.com) plugin for adding crosslinks section into each spec. It predicts used specs through the css selectors used in current spec.
4+
5+
![image](http://monosnap.com/image/gG9KatayyGGg5BxYt3704OIIQHUg0V.png)
6+
7+
Compatible with SourceJS v0.4+.
8+
9+
## How to use
10+
11+
Spec Dependencies automatically predicts all specs, that used in current spec ("most likely it uses" section on the picture above). If you also want to see next section to check which specs use current ("this spec used by"), you have to update info.json of the specs with "usedSpecs" property. Value of "usedSpecs" should be an array even for only element.
12+
13+
```
14+
// info.json of Example spec (/url/to/example/spec)
15+
{
16+
"author": ...,
17+
"title": ...,
18+
...,
19+
"usedSpecs": ["/url/to/used/spec", "/url/to/used/spec1", ...]
20+
}
21+
```
22+
23+
Next, SourceJS core builds inverted dependencies tree and save it to `data/spec_dependencies_tree.json`:
24+
```
25+
{
26+
"/url/to/used/spec": [
27+
"/url/to/example/spec"
28+
],
29+
"/url/to/used/spec1": [
30+
"/url/to/example/spec"
31+
]
32+
}
33+
```
34+
35+
After that plugin uses this tree to build the "this spec used by" section.

0 commit comments

Comments
 (0)