Skip to content

Commit 120ac00

Browse files
authored
Merge pull request #1 from Shubhaankar-Sharma/master
Documentation Migration
2 parents ef4f3fb + 7d4b005 commit 120ac00

13 files changed

Lines changed: 1879 additions & 2 deletions

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
go-chi.io

README.md

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,50 @@
1-
# docs
2-
chi docs
1+
# chi
2+
3+
## 👋 Hi, Let's Get You Started With chi <!-- {docsify-ignore} -->
4+
5+
<!-- # chi -->
6+
7+
`chi` is a lightweight, idiomatic and composable router for building Go HTTP services. It's
8+
especially good at helping you write large REST API services that are kept maintainable as your
9+
project grows and changes. `chi` is built on the new `context` package introduced in Go 1.7 to
10+
handle signaling, cancelation and request-scoped values across a handler chain.
11+
12+
The focus of the project has been to seek out an elegant and comfortable design for writing
13+
REST API servers, written during the development of the Pressly API service that powers our
14+
public API service, which in turn powers all of our client-side applications.
15+
16+
The key considerations of chi's design are: project structure, maintainability, standard http
17+
handlers (stdlib-only), developer productivity, and deconstructing a large system into many small
18+
parts. The core router `github.com/go-chi/chi` is quite small (less than 1000 LOC), but we've also
19+
included some useful/optional subpackages: [middleware](https://github.com/go-chi/chi/tree/master/middleware), [render](https://github.com/go-chi/render)
20+
and [docgen](https://github.com/go-chi/docgen). We hope you enjoy it too!
21+
22+
## Features <!-- {docsify-ignore} -->
23+
24+
* **Lightweight** - cloc'd in ~1000 LOC for the chi router
25+
* **Fast** - yes, see [benchmarks](https://github.com/go-chi/chi#benchmarks)
26+
* **100% compatible with net/http** - use any http or middleware pkg in the ecosystem that is also compatible with `net/http`
27+
* **Designed for modular/composable APIs** - middlewares, inline middlewares, route groups and sub-router mounting
28+
* **Context control** - built on new `context` package, providing value chaining, cancellations and timeouts
29+
* **Robust** - in production at Pressly, CloudFlare, Heroku, 99Designs, and many others (see [discussion](https://github.com/go-chi/chi/issues/91))
30+
* **Doc generation** - `docgen` auto-generates routing documentation from your source to JSON or Markdown
31+
* **Go.mod support** - as of v5, go.mod support (see [CHANGELOG](https://github.com/go-chi/chi/blob/master/CHANGELOG.md))
32+
* **No external dependencies** - plain ol' Go stdlib + net/http
33+
34+
35+
36+
## Examples <!-- {docsify-ignore} -->
37+
38+
See [examples](https://github.com/go-chi/chi/blob/master/_examples/) for a variety of examples.
39+
40+
41+
## License <!-- {docsify-ignore} -->
42+
43+
Copyright (c) 2015-present [Peter Kieltyka](https://github.com/pkieltyka)
44+
45+
Licensed under [MIT License](https://github.com/go-chi/chi/blob/master/LICENSE)
46+
47+
[GoDoc]: https://pkg.go.dev/github.com/go-chi/chi?tab=versions
48+
[GoDoc Widget]: https://godoc.org/github.com/go-chi/chi?status.svg
49+
[Travis]: https://travis-ci.org/go-chi/chi
50+
[Travis Widget]: https://travis-ci.org/go-chi/chi.svg?branch=master

_coverpage.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
![logo](https://cdn.rawgit.com/go-chi/chi/master/_examples/chi.svg)
2+
3+
> A lightweight, idiomatic and composable router for building Go HTTP services.
4+
5+
- 🚀 Lightweight
6+
- ⚡️️ Fast
7+
- 🔥 Robust
8+
- 📼 No external dependencies
9+
10+
<div class="buttons">
11+
<a href="https://github.com/go-chi/chi/" target="_blank"><span>GitHub</span></a>
12+
<a href="#/README"><span>Get Started</span></a>
13+
</div>
14+
15+
<!-- background color -->
16+
17+
![color](#000000)

_sidebar.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!-- docs/_sidebar.md -->
2+
<!-- - [🏃‍♂️ Quick Start Tutorial](quickstart.md) -->
3+
<!-- - Tutorial - User Guide
4+
- [First Steps]()
5+
- [Routing Basics]()
6+
- [Routing Patterns & URL Params]()
7+
- [Mounting Routers and Sub Routers]()
8+
- [Middleware]() -->
9+
<!-- docs/advanced_pages/_sidebar.md -->
10+
- [👋 Introduction](README.md)
11+
- [⚡ Getting Started](pages/getting_started.md)
12+
- [🔌 Routing](pages/routing.md)
13+
- [🧬 Middleware](pages/middleware.md)
14+
- [🧪 Testing](pages/testing.md)
15+
- [🍳 Examples](https://github.com/go-chi/chi/tree/master/_examples)
16+
- [⚖️ License](https://github.com/go-chi/chi/blob/master/LICENSE)
17+
<!-- - [📚 User Guide](pages/index.md)
18+
- [👋 First Steps](pages/first_steps.md)
19+
- [🔌 Routing](pages/routing.md)
20+
- [🧬 Middleware](pages/middleware.md)
21+
- [🧪 Testing](pages/testing.md)
22+
- [🍳 Examples](https://github.com/go-chi/chi/tree/master/_examples) -->

assets/chi.png

3.7 KB
Loading

assets/styles.css

Lines changed: 269 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
.loader-wrapper {
2+
width: 100%;
3+
height: 100%;
4+
position: absolute;
5+
top: 0;
6+
left: 0;
7+
background-color: #242f3f;
8+
display:flex;
9+
justify-content: center;
10+
align-items: center;
11+
}
12+
13+
.loader {
14+
display: inline-block;
15+
width: 30px;
16+
height: 30px;
17+
position: relative;
18+
border: 4px solid #Fff;
19+
animation: loader 2s infinite ease;
20+
}
21+
22+
.loader-inner {
23+
vertical-align: top;
24+
display: inline-block;
25+
width: 100%;
26+
background-color: #fff;
27+
animation: loader-inner 2s infinite ease-in;
28+
}
29+
@keyframes loader {
30+
0% { transform: rotate(0deg);}
31+
25% { transform: rotate(180deg);}
32+
50% { transform: rotate(180deg);}
33+
75% { transform: rotate(360deg);}
34+
100% { transform: rotate(360deg);}
35+
}
36+
@keyframes loader-inner {
37+
0% { height: 0%;}
38+
25% { height: 0%;}
39+
50% { height: 100%;}
40+
75% { height: 100%;}
41+
100% { height: 0%;}
42+
}
43+
/****** Cover Page ******/
44+
section.cover {
45+
padding-bottom: 112px; /* fixed footer (Netflix) height */
46+
height: auto;
47+
min-height: 100vh;
48+
color: var(--textColor);
49+
}
50+
51+
section.cover .cover-main {
52+
display: flex;
53+
justify-content: center;
54+
align-items: center;
55+
flex-direction: column;
56+
margin: 0;
57+
padding: 32px 16px 0;
58+
}
59+
60+
section.cover img {
61+
width: 400px;
62+
}
63+
64+
section.cover h1 {
65+
margin: 0.625rem 0 1rem;
66+
}
67+
68+
section.cover blockquote,
69+
section.cover blockquote p {
70+
margin: 0;
71+
}
72+
73+
section.cover ul {
74+
font-size: 1.25rem;
75+
line-height: 2rem;
76+
display: grid;
77+
text-align: left;
78+
grid-column-gap: 16px;
79+
grid-row-gap: 20px;
80+
grid-template-columns: repeat(2, 50%);
81+
list-style: none;
82+
max-width: unset;
83+
margin: 1.5em 0;
84+
}
85+
86+
section.cover ul li {
87+
white-space: nowrap;
88+
}
89+
90+
section.cover.show ~ .sidebar,
91+
section.cover.show ~ .sidebar-toggle {
92+
display: none;
93+
}
94+
95+
96+
.cover-main .buttons {
97+
width: 100%;
98+
}
99+
100+
.cover-main .buttons a {
101+
font-weight: 700;
102+
position: relative;
103+
display: inline-block;
104+
padding: 12px 25px;
105+
font-size: 14px;
106+
text-align: center;
107+
line-height: 18px;
108+
color: #221f1f;
109+
background: var(--coverBackground);
110+
outline: none;
111+
border: none;
112+
background-color: var(--coverBackground);
113+
-webkit-appearance: none;
114+
-moz-appearance: none;
115+
cursor: pointer;
116+
margin: 0 1rem;
117+
color: var(--theme-color);
118+
overflow: hidden;
119+
transition: color 0.25s cubic-bezier(0.215, 0.61, 0.355, 1);
120+
vertical-align: baseline;
121+
text-transform: uppercase;
122+
}
123+
124+
.cover-main .buttons a:before,
125+
.cover-main .buttons a:after {
126+
content: '';
127+
display: block;
128+
position: absolute;
129+
width: 100%;
130+
height: 100%;
131+
top: 0;
132+
left: 0;
133+
border: 2px solid var(--theme-color);
134+
box-sizing: border-box;
135+
}
136+
137+
.cover-main .buttons a:after {
138+
background: var(--theme-color);
139+
transform: translateX(-101%);
140+
transition: all 0.2s cubic-bezier(0.215, 0.61, 0.355, 1);
141+
}
142+
143+
.cover-main .buttons a:hover {
144+
color: white;
145+
box-shadow: 0 5px 16px rgba(229, 9, 20, 0.3);
146+
}
147+
148+
.cover-main .buttons a:hover:after {
149+
transform: translateX(0);
150+
}
151+
152+
.cover-main .buttons a span {
153+
position: relative;
154+
z-index: 1;
155+
}
156+
157+
@media (max-width: 850px) {
158+
section.cover ul {
159+
grid-template-columns: 100%;
160+
padding: 0;
161+
}
162+
163+
section.cover ul li {
164+
text-align: center;
165+
}
166+
}
167+
168+
@media (max-width: 450px) {
169+
section.cover ul li {
170+
white-space: normal;
171+
}
172+
173+
.cover-main .buttons a {
174+
width: 100%;
175+
margin: 0.2rem 0;
176+
}
177+
}
178+
179+
180+
/****** Sidebar ******/
181+
.sidebar .app-name-link img {
182+
height: 150px;
183+
}
184+
185+
.sidebar ul li a {
186+
font-size: 15px;
187+
}
188+
189+
.sidebar ul li a:hover {
190+
color: var(--theme-color);
191+
}
192+
193+
.app-sub-sidebar li:before {
194+
display: none;
195+
}
196+
197+
.sidebar .search .clear-button {
198+
cursor: pointer;
199+
}
200+
201+
/****** Sidebar Toggle ******/
202+
.sidebar-toggle {
203+
cursor: pointer;
204+
}
205+
206+
body .sidebar-toggle {
207+
background: none;
208+
top: 1.5rem;
209+
left: calc(300px + 1.5rem);
210+
cursor: pointer;
211+
width: 1.5rem;
212+
height: 1.5rem;
213+
padding: 0;
214+
transition: left 0.25s ease-out;
215+
}
216+
217+
body .sidebar-toggle span {
218+
background-color: var(--theme-color);
219+
height: 0.2rem;
220+
width: 1.5rem;
221+
position: absolute;
222+
left: 0;
223+
margin: 0;
224+
transform-origin: 0;
225+
border-radius: 1px;
226+
}
227+
228+
body.close .sidebar-toggle {
229+
transition: left 0.25s ease-out;
230+
width: 1.5rem;
231+
height: 1.5rem;
232+
left: 1.5rem;
233+
}
234+
235+
body.close .sidebar-toggle span {
236+
transform-origin: center;
237+
}
238+
239+
body .sidebar-toggle span:nth-child(1) {
240+
top: 0;
241+
}
242+
body .sidebar-toggle span:nth-child(2) {
243+
top: 0.5rem;
244+
}
245+
body .sidebar-toggle span:nth-child(3) {
246+
top: 1rem;
247+
}
248+
249+
.sidebar-toggle:hover {
250+
opacity: 0.8;
251+
}
252+
.sidebar-toggle .sidebar-toggle-button:hover {
253+
opacity: 1;
254+
}
255+
256+
@media screen and (max-width: 768px) {
257+
body .sidebar-toggle {
258+
left: 1rem;
259+
}
260+
261+
body.close .sidebar-toggle {
262+
left: calc(300px + 1.5rem);
263+
}
264+
}
265+
266+
/****** COPY TO CLIPBOARD ******/
267+
.docsify-copy-code-button {
268+
font-size: 0.7em !important;
269+
}

favicon.ico

3.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)