Skip to content

Commit 58d2300

Browse files
committed
Add initial generated markdown for API
1 parent 92710d6 commit 58d2300

File tree

103 files changed

+9909
-8
lines changed

Some content is hidden

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

103 files changed

+9909
-8
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
_site
22
.sass-cache
3+
generate/nodegit
4+
node_modules/

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
11
`script/bootstrap`
22
`script/server`
3+
`open http://localhost:4000`
4+
5+
## Generating the site
6+
7+
While in development, the generator will not clone the nodegit repo. You'll need to soft-link the nodegit repository into `generate/`.
8+
9+
```bash
10+
ln -s /path/to/nodegit generate/nodegit
11+
```
12+
13+
Once linked, generate the site.
14+
15+
```bash
16+
node generate
17+
```
18+
19+
If you're running `script/server` in another terminal tab, it will read the changes and regenerate the site.

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ other_nodegit_versions:
1010

1111
# Build settings
1212
markdown: redcarpet
13+
redcarpet:
14+
extensions: [tables, no_intra_emphasis, autolink]
1315
highlighter: pygments
1416
permalink: pretty
1517
exclude: ["node_modules","generate","package.json","README.md"]

_includes/header.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ <h1><a class="site-title" href="{{ site.baseurl }}/"><img src="/img/nodegit.svg"
2323
<nav>
2424
<ul>
2525
<li{% if page.menu_item == 'getting_started' %} class="active"{% endif %}><a href="{{ site.baseurl }}/{% if page.nodegit_version %}{{ page.nodegit_version }}/{% endif %}">Getting Started</a></li>
26-
<li><a href="{{ site.baseurl }}/{% if page.nodegit_version %}{{ page.nodegit_version }}/{% endif %}guides/">Guides</a></li>
27-
<li><a href="{{ site.baseurl }}/{% if page.nodegit_version %}{{ page.nodegit_version }}/{% endif %}api/">API Documentation</a></li>
26+
<li{% if page.menu_item == 'guides' %} class="active"{% endif %}><a href="{{ site.baseurl }}/{% if page.nodegit_version %}{{ page.nodegit_version }}/{% endif %}guides/">Guides</a></li>
27+
<li{% if page.menu_item == 'api' %} class="active"{% endif %}><a href="{{ site.baseurl }}/{% if page.nodegit_version %}{{ page.nodegit_version }}/{% endif %}api/">API Documentation</a></li>
2828
<li><a href="https://github.com/nodegit/nodegit/{% if page.nodegit_version %}tree/{{ page.nodegit_version }}/{% endif %}">Source</a></li>
29-
<li><a href="{{ site.baseurl }}/blog/">Blog</a></li>
29+
<li{% if page.menu_item == 'blog' %} class="active"{% endif %}><a href="{{ site.baseurl }}/blog/">Blog</a></li>
3030
</ul>
3131
</nav>
3232

_layouts/default.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
<div class="page-content">
1111
<div class="wrapper">
1212
<div class="outline">
13+
{% if page.return_to %}
14+
{% for section_hash in page.return_to %}
15+
<h5><a href="{{section_hash[1]}}">{{section_hash[0]}}</a></h5>
16+
{% endfor %}
17+
{% endif %}
1318
<ul>
1419
{% for section_hash in page.sections %}
1520
<li><a href="{{section_hash[1]}}">{{section_hash[0]}}</a></li>

_sass/_layout.scss

Lines changed: 95 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
/**
44
* Set `margin-bottom` to maintain vertical rhythm
55
*/
6-
h1, h2, h3, h4, h5, h6,
6+
h1, h2, h3,
77
p, blockquote, pre,
88
ul, ol, dl, figure, .highlight
99
%vertical-rhythm {
1010
margin-bottom: $spacing-unit / 2;
1111
}
1212

13+
html, body {
14+
background:#fff;
15+
}
16+
1317
body {
1418
padding:0 $spacing-unit $spacing-unit;
1519
}
@@ -25,6 +29,7 @@ body {
2529

2630
header {
2731
display:block;
32+
background:#fff;
2833
overflow:hidden;
2934

3035
.site-info {
@@ -212,15 +217,103 @@ header {
212217

213218
.outline {
214219
float:right;
215-
width:180px;
220+
width:220px;
216221
padding:0 0 0 $spacing-unit;
217222
font-size:$font-size * 0.9;
218223
display:block;
224+
225+
ul {
226+
border:none;
227+
}
219228
}
220229

221230
.main {
222231
overflow:hidden;
223232
width:auto;
233+
234+
table {
235+
a {
236+
color:$text-color;
237+
font-weight:500;
238+
239+
span {
240+
font-weight:normal;
241+
}
242+
243+
&:hover {
244+
color:$headline-color;
245+
}
246+
}
247+
248+
.tags {
249+
position:relative;
250+
top:-2px;
251+
right:-12px;
252+
253+
span {
254+
padding-top:2px;
255+
padding-bottom:2px;
256+
}
257+
}
258+
}
259+
}
260+
}
261+
262+
span.tags {
263+
margin:0 0 0 6px;
264+
position:relative;
265+
top:-0.23em;
266+
267+
span {
268+
font-size:12px;
269+
display:inline-block;
270+
padding:6px 8px;
271+
border-radius:3px;
272+
text-transform:uppercase;
273+
color:#fff;
274+
margin:0 8px 0 0;
275+
font-family:$font-family;
276+
font-weight:500;
277+
278+
&.enum {
279+
background:#92D4D3;
280+
}
281+
282+
&.sync {
283+
background:#FD8487;
284+
}
285+
286+
&.async {
287+
background:#77D971;
288+
}
289+
290+
&.experimental {
291+
background:#FFBB85;
292+
}
293+
}
294+
}
295+
296+
table {
297+
border-collapse:collapse;
298+
width:100%;
299+
margin:0 0 $spacing-unit/2;
300+
301+
th {
302+
font-weight:500;
303+
color:#aaa;
304+
}
305+
306+
td {
307+
border-top:1px solid #ededed;
308+
}
309+
310+
th, td {
311+
padding:8px $spacing-unit/2;
312+
text-align:left;
313+
314+
span {
315+
color:#aaa;
316+
}
224317
}
225318
}
226319

_sass/_type.scss

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body {
77
color:$text-color;
88
}
99

10-
h1, h2, h3, h4, h5, nav, .version, .version-menu, .buttons {
10+
h1, h2, h3, nav, .version, .version-menu, .buttons {
1111
font-family: Bitter, $font-family;
1212
line-height:1;
1313
}
@@ -20,6 +20,10 @@ h2 {
2020
font-size:$font-size * 2;
2121
margin-top:$spacing-unit;
2222

23+
span {
24+
color:#aaa;
25+
}
26+
2327
&:first-child {
2428
margin-top:0;
2529
}
@@ -29,16 +33,40 @@ h3 {
2933
font-size:$font-size * 1.2;
3034
}
3135

36+
h4 {
37+
font-weight:500;
38+
color:#999;
39+
}
40+
41+
h5 {
42+
border-bottom:1px solid #ededed;
43+
padding:0 0 $spacing-unit/4;
44+
margin:0 0 $spacing-unit/3;
45+
}
46+
3247
.version, .version-menu {
3348
font-size:$font-size*0.8;
3449
}
3550

51+
strong {
52+
font-weight:bold;
53+
color:#222;
54+
}
55+
3656
a {
3757
text-decoration:none;
3858
color:$key-color;
3959

60+
span {
61+
color:#aaa;
62+
}
63+
4064
&:hover {
4165
color:darken($key-color, 20%);
66+
67+
span {
68+
color:#727272;
69+
}
4270
}
4371
}
4472

api/attr/index.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
layout: default
3+
menu_item: api
4+
title: Attr
5+
description: Version 0.3.0
6+
menu_item: api
7+
return_to:
8+
"API Documentation Index": /api/
9+
sections:
10+
"STATES": "#STATES"
11+
---
12+
13+
## <a name="STATES"></a><span>Attr.</span>STATES <span class="tags"><span class="enum">ENUM</span></span>
14+
15+
| Flag | Value |
16+
| --- | --- | --- |
17+
| <span>Attr.STATES.</span>UNSPECIFIED_T | 0 |
18+
| <span>Attr.STATES.</span>TRUE_T | 1 |
19+
| <span>Attr.STATES.</span>FALSE_T | 2 |
20+
| <span>Attr.STATES.</span>VALUE_T | 3 |
21+

api/blame/index.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
layout: default
3+
menu_item: api
4+
title: Blame
5+
description: Version 0.3.0
6+
menu_item: api
7+
return_to:
8+
"API Documentation Index": /api/
9+
sections:
10+
"file": "#file"
11+
"#buffer": "#buffer"
12+
"#getHunkByIndex": "#getHunkByIndex"
13+
"#getHunkByLine": "#getHunkByLine"
14+
"#getHunkCount": "#getHunkCount"
15+
"FLAG": "#FLAG"
16+
---
17+
18+
## <a name="file"></a><span>Blame.</span>file <span class="tags"><span class="async">Async</span><span class="experimental">Experimental</span></span>
19+
20+
```js
21+
Blame.file(repo, path, options).then(function(blame) {
22+
// Use blame
23+
});
24+
```
25+
26+
| Parameters | Type | |
27+
| --- | --- | --- |
28+
| repo | [Repository](/api/repository/) | repository whose history is to be walked |
29+
| path | String | path to file to consider |
30+
| options | [BlameOptions](/api/blame_options/) | options for the blame operation. If NULL, this is treated as though GIT_BLAME_OPTIONS_INIT were passed. |
31+
32+
| Returns | |
33+
| --- | --- |
34+
| [Blame](/api/blame/) | pointer that will receive the blame object |
35+
36+
## <a name="buffer"></a><span>Blame#</span>buffer <span class="tags"><span class="async">Async</span><span class="experimental">Experimental</span></span>
37+
38+
```js
39+
blame.buffer(buffer, buffer_len).then(function(blame) {
40+
// Use blame
41+
});
42+
```
43+
44+
| Parameters | Type |
45+
| --- | --- | --- |
46+
| buffer | String | the (possibly) modified contents of the file |
47+
| buffer_len | Number | number of valid bytes in the buffer |
48+
49+
| Returns | |
50+
| --- | --- |
51+
| [Blame](/api/blame/) | pointer that will receive the resulting blame data |
52+
53+
## <a name="getHunkByIndex"></a><span>Blame#</span>getHunkByIndex <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span>
54+
55+
```js
56+
var blameHunk = blame.getHunkByIndex(index);
57+
```
58+
59+
| Parameters | Type |
60+
| --- | --- | --- |
61+
| index | Number | index of the hunk to retrieve |
62+
63+
| Returns | |
64+
| --- | --- |
65+
| [BlameHunk](/api/blame_hunk/) | the hunk at the given index, or NULL on error |
66+
67+
## <a name="getHunkByLine"></a><span>Blame#</span>getHunkByLine <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span>
68+
69+
```js
70+
var blameHunk = blame.getHunkByLine(lineno);
71+
```
72+
73+
| Parameters | Type |
74+
| --- | --- | --- |
75+
| lineno | Number | the (1-based) line number to find a hunk for |
76+
77+
| Returns | |
78+
| --- | --- |
79+
| [BlameHunk](/api/blame_hunk/) | the hunk that contains the given line, or NULL on error |
80+
81+
## <a name="getHunkCount"></a><span>Blame#</span>getHunkCount <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span>
82+
83+
```js
84+
var result = blame.getHunkCount();
85+
```
86+
87+
88+
| Returns | |
89+
| --- | --- |
90+
| Number | |
91+
92+
## <a name="FLAG"></a><span>Blame.</span>FLAG <span class="tags"><span class="enum">ENUM</span></span>
93+
94+
| Flag | Value |
95+
| --- | --- | --- |
96+
| <span>Blame.FLAG.</span>NORMAL | 0 |
97+
| <span>Blame.FLAG.</span>TRACK_COPIES_SAME_FILE | 1 |
98+
| <span>Blame.FLAG.</span>TRACK_COPIES_SAME_COMMIT_MOVES | 2 |
99+
| <span>Blame.FLAG.</span>TRACK_COPIES_SAME_COMMIT_COPIES | 4 |
100+
| <span>Blame.FLAG.</span>TRACK_COPIES_ANY_COMMIT_COPIES | 8 |
101+
| <span>Blame.FLAG.</span>FIRST_PARENT | 16 |
102+

0 commit comments

Comments
 (0)