repos / starfx

supercharged async flow control library.
git clone https://github.com/neurosnap/starfx.git

commit
da71852
parent
204ea79
author
Eric Bower
date
2024-02-18 17:45:17 +0000 UTC
chore: update pdocs
5 files changed,  +161, -163
M docs/go.mod
+1, -1
1@@ -2,7 +2,7 @@ module github.com/neurosnap/starfx/docs
2 
3 go 1.22
4 
5-require github.com/picosh/pdocs v0.0.0-20240216195759-cf9ace42f2f8
6+require github.com/picosh/pdocs v0.0.0-20240218162954-0dec737a7805
7 
8 require (
9 	github.com/alecthomas/chroma v0.10.0 // indirect
M docs/go.sum
+2, -6
 1@@ -6,10 +6,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
 2 github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
 3 github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
 4 github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
 5-github.com/picosh/pdocs v0.0.0-20240205045212-d44525ffbbf5 h1:AXSQbwThiGubFwnE1Sav6UoahzV/Ya/p4g/hcg2Z3Ew=
 6-github.com/picosh/pdocs v0.0.0-20240205045212-d44525ffbbf5/go.mod h1:4Ei1K68K1qYyqSx5shNdw4++PN1Ws3QhD1u5eJYBmsA=
 7-github.com/picosh/pdocs v0.0.0-20240216195759-cf9ace42f2f8 h1:guX7S4YlBswG1WUIu8nzy3teJr50ng0lpa/bjIZVCms=
 8-github.com/picosh/pdocs v0.0.0-20240216195759-cf9ace42f2f8/go.mod h1:4Ei1K68K1qYyqSx5shNdw4++PN1Ws3QhD1u5eJYBmsA=
 9+github.com/picosh/pdocs v0.0.0-20240218162954-0dec737a7805 h1:DlHwGHcZKm76+kK7EGG16ExG8S/GM+uz6VDVljmksxw=
10+github.com/picosh/pdocs v0.0.0-20240218162954-0dec737a7805/go.mod h1:4Ei1K68K1qYyqSx5shNdw4++PN1Ws3QhD1u5eJYBmsA=
11 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
12 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
13 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
14@@ -17,8 +15,6 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
15 github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
16 github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
17 github.com/yuin/goldmark v1.4.5/go.mod h1:rmuwmfZ0+bvzB24eSC//bk1R1Zp3hM0OXYv/G2LIilg=
18-github.com/yuin/goldmark v1.6.0 h1:boZcn2GTjpsynOsC0iJHnBWa4Bi0qzfJjthwauItG68=
19-github.com/yuin/goldmark v1.6.0/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
20 github.com/yuin/goldmark v1.7.0 h1:EfOIvIMZIzHdB/R/zVrikYLPPwJlfMcNczJFMs1m6sA=
21 github.com/yuin/goldmark v1.7.0/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
22 github.com/yuin/goldmark-highlighting v0.0.0-20220208100518-594be1970594 h1:yHfZyN55+5dp1wG7wDKv8HQ044moxkyGq12KFFMFDxg=
M docs/main.go
+156, -154
  1@@ -6,171 +6,173 @@ import (
  2 
  3 func main() {
  4 	pager := pdocs.Pager("./posts")
  5-	sitemap := []*pdocs.Sitemap{
  6-		{
  7-			Text: "Home",
  8-			Href: "/",
  9-			Page: pager("home.md"),
 10-		},
 11-		{
 12-			Text: "Sitemap",
 13-			Href: "/sitemap",
 14-			Page: pager("sitemap.md"),
 15-		},
 16-		{
 17-			Text: "Getting started",
 18-			Href: "/getting-started",
 19-			Page: pager("getting-started.md"),
 20-			Tag:  "Info",
 21-			Children: []*pdocs.Sitemap {
 22-				pdocs.AnchorTagSitemap("Design Philosophy"),
 23-				pdocs.AnchorTagSitemap("The Simplest Example"),
 24-				pdocs.AnchorTagSitemap("Effection"),
 25+	sitemap := &pdocs.Sitemap{
 26+		Children: []*pdocs.Sitemap{
 27+			{
 28+				Text: "Home",
 29+				Href: "/",
 30+				Page: pager("home.md"),
 31 			},
 32-		},
 33-		{
 34-			Text: "Thunks",
 35-			Href: "/thunks",
 36-			Page: pager("thunks.md"),
 37-			Tag:  "Side Effects",
 38-			Children: []*pdocs.Sitemap {
 39-				pdocs.AnchorTagSitemap("Thunk Action"),
 40-				pdocs.AnchorTagSitemap("Thunk Payload"),
 41-				pdocs.AnchorTagSitemap("Custom ctx"),
 42+			{
 43+				Text: "Sitemap",
 44+				Href: "/sitemap",
 45+				Page: pager("sitemap.md"),
 46 			},
 47-		},
 48-		{
 49-			Text: "Endpoints",
 50-			Href: "/endpoints",
 51-			Page: pager("endpoints.md"),
 52-			Tag:  "Side Effects",
 53-			Children: []*pdocs.Sitemap {
 54-				pdocs.AnchorTagSitemap("Enforcing fetch response type"),
 55-				pdocs.AnchorTagSitemap("The same API endpoints but different logic"),
 56-				pdocs.AnchorTagSitemap("Using variables inside the API endpoint"),
 57-				pdocs.AnchorTagSitemap("ctx.request"),
 58-				pdocs.AnchorTagSitemap("Using ctx.req"),
 59-				pdocs.AnchorTagSitemap("ctx.response"),
 60-				pdocs.AnchorTagSitemap("ctx.json"),
 61-				pdocs.AnchorTagSitemap("Middleware automation"),
 62+			{
 63+				Text: "Getting started",
 64+				Href: "/getting-started",
 65+				Page: pager("getting-started.md"),
 66+				Tag:  "Info",
 67+				Children: []*pdocs.Sitemap{
 68+					pdocs.AnchorTagSitemap("Design Philosophy"),
 69+					pdocs.AnchorTagSitemap("The Simplest Example"),
 70+					pdocs.AnchorTagSitemap("Effection"),
 71+				},
 72 			},
 73-		},
 74-		{
 75-			Text: "Store",
 76-			Href: "/store",
 77-			Page: pager("store.md"),
 78-			Tag:  "Store",
 79-			Children: []*pdocs.Sitemap {
 80-				pdocs.AnchorTagSitemap("How to update state"),
 81-				pdocs.AnchorTagSitemap("Updating state from view"),
 82+			{
 83+				Text: "Thunks",
 84+				Href: "/thunks",
 85+				Page: pager("thunks.md"),
 86+				Tag:  "Side Effects",
 87+				Children: []*pdocs.Sitemap{
 88+					pdocs.AnchorTagSitemap("Thunk Action"),
 89+					pdocs.AnchorTagSitemap("Thunk Payload"),
 90+					pdocs.AnchorTagSitemap("Custom ctx"),
 91+				},
 92 			},
 93-		},
 94-		{
 95-			Text: "React",
 96-			Href: "/react",
 97-			Page: pager("react.md"),
 98-			Tag:  "View",
 99-			Children: []*pdocs.Sitemap {
100-				pdocs.AnchorTagSitemap("useSelector"),
101-				pdocs.AnchorTagSitemap("useLoader"),
102-				pdocs.AnchorTagSitemap("useApi"),
103-				pdocs.AnchorTagSitemap("useQuery"),
104-				pdocs.AnchorTagSitemap("useCache"),
105-				pdocs.AnchorTagSitemap("useLoaderSuccess"),
106+			{
107+				Text: "Endpoints",
108+				Href: "/endpoints",
109+				Page: pager("endpoints.md"),
110+				Tag:  "Side Effects",
111+				Children: []*pdocs.Sitemap{
112+					pdocs.AnchorTagSitemap("Enforcing fetch response type"),
113+					pdocs.AnchorTagSitemap("The same API endpoints but different logic"),
114+					pdocs.AnchorTagSitemap("Using variables inside the API endpoint"),
115+					pdocs.AnchorTagSitemap("ctx.request"),
116+					pdocs.AnchorTagSitemap("Using ctx.req"),
117+					pdocs.AnchorTagSitemap("ctx.response"),
118+					pdocs.AnchorTagSitemap("ctx.json"),
119+					pdocs.AnchorTagSitemap("Middleware automation"),
120+				},
121 			},
122-		},
123-		{
124-			Text: "Schema",
125-			Href: "/schema",
126-			Page: pager("schema.md"),
127-			Tag:  "Store",
128-			Children: []*pdocs.Sitemap {
129-				pdocs.AnchorTagSitemap("Schema Assumptions"),
130-				pdocs.AnchorTagSitemap("any"),
131-				pdocs.AnchorTagSitemap("str"),
132-				pdocs.AnchorTagSitemap("num"),
133-				pdocs.AnchorTagSitemap("obj"),
134-				pdocs.AnchorTagSitemap("table"),
135-				pdocs.AnchorTagSitemap("loader"),
136-				pdocs.AnchorTagSitemap("Build your own slice"),
137+			{
138+				Text: "Store",
139+				Href: "/store",
140+				Page: pager("store.md"),
141+				Tag:  "Store",
142+				Children: []*pdocs.Sitemap{
143+					pdocs.AnchorTagSitemap("How to update state"),
144+					pdocs.AnchorTagSitemap("Updating state from view"),
145+				},
146 			},
147-		},
148-		{
149-			Text: "Caching",
150-			Href: "/caching",
151-			Page: pager("caching.md"),
152-			Tag:  "Store",
153-			Children: []*pdocs.Sitemap {
154-				pdocs.AnchorTagSitemap("Manual"),
155-				pdocs.AnchorTagSitemap("Automatic"),
156+			{
157+				Text: "React",
158+				Href: "/react",
159+				Page: pager("react.md"),
160+				Tag:  "View",
161+				Children: []*pdocs.Sitemap{
162+					pdocs.AnchorTagSitemap("useSelector"),
163+					pdocs.AnchorTagSitemap("useLoader"),
164+					pdocs.AnchorTagSitemap("useApi"),
165+					pdocs.AnchorTagSitemap("useQuery"),
166+					pdocs.AnchorTagSitemap("useCache"),
167+					pdocs.AnchorTagSitemap("useLoaderSuccess"),
168+				},
169 			},
170-		},
171-		{
172-			Text: "Dependent Queries",
173-			Href: "/dependent-queries",
174-			Page: pager("dependent.md"),
175-			Tag:  "Side Effects",
176-			Children: []*pdocs.Sitemap {
177-				pdocs.AnchorTagSitemap("Dispatch the thunk as an action"),
178-				pdocs.AnchorTagSitemap("Call the middleware stack directly"),
179+			{
180+				Text: "Schema",
181+				Href: "/schema",
182+				Page: pager("schema.md"),
183+				Tag:  "Store",
184+				Children: []*pdocs.Sitemap{
185+					pdocs.AnchorTagSitemap("Schema Assumptions"),
186+					pdocs.AnchorTagSitemap("any"),
187+					pdocs.AnchorTagSitemap("str"),
188+					pdocs.AnchorTagSitemap("num"),
189+					pdocs.AnchorTagSitemap("obj"),
190+					pdocs.AnchorTagSitemap("table"),
191+					pdocs.AnchorTagSitemap("loader"),
192+					pdocs.AnchorTagSitemap("Build your own slice"),
193+				},
194 			},
195-		},
196-		{
197-			Text: "Middleware",
198-			Href: "/middleware",
199-			Page: pager("mdw.md"),
200-			Tag:  "Side Effects",
201-			Children: []*pdocs.Sitemap {
202-				pdocs.AnchorTagSitemap("Context"),
203+			{
204+				Text: "Caching",
205+				Href: "/caching",
206+				Page: pager("caching.md"),
207+				Tag:  "Store",
208+				Children: []*pdocs.Sitemap{
209+					pdocs.AnchorTagSitemap("Manual"),
210+					pdocs.AnchorTagSitemap("Automatic"),
211+				},
212 			},
213-		},
214-		{
215-			Text: "Loaders",
216-			Href: "/loaders",
217-			Page: pager("loader.md"),
218-			Tag:  "Side Effects",
219-			Children: []*pdocs.Sitemap {
220-				pdocs.AnchorTagSitemap("Usage"),
221-				pdocs.AnchorTagSitemap("Shape"),
222+			{
223+				Text: "Dependent Queries",
224+				Href: "/dependent-queries",
225+				Page: pager("dependent.md"),
226+				Tag:  "Side Effects",
227+				Children: []*pdocs.Sitemap{
228+					pdocs.AnchorTagSitemap("Dispatch the thunk as an action"),
229+					pdocs.AnchorTagSitemap("Call the middleware stack directly"),
230+				},
231 			},
232-		},
233-		{
234-			Text: "Structured Concurrency",
235-			Href: "/structured-concurrency",
236-			Page: pager("structured-concurrency.md"),
237-			Tag:  "Info",
238-		},
239-		{
240-			Text: "Supervisors",
241-			Href: "/supervisors",
242-			Page: pager("supervisors.md"),
243-			Tag:  "Advanced",
244-			Children: []*pdocs.Sitemap {
245-				pdocs.AnchorTagSitemap("poll"),
246-				pdocs.AnchorTagSitemap("timer"),
247+			{
248+				Text: "Middleware",
249+				Href: "/middleware",
250+				Page: pager("mdw.md"),
251+				Tag:  "Side Effects",
252+				Children: []*pdocs.Sitemap{
253+					pdocs.AnchorTagSitemap("Context"),
254+				},
255 			},
256-		},
257-		{
258-			Text: "Testing",
259-			Href: "/testing",
260-			Page: pager("testing.md"),
261-			Tag:  "Advanced",
262-		},
263-		{
264-			Text: "API",
265-			Href: "/api",
266-			Page: pager("api.md"),
267-			Tag:  "Info",
268-		},
269-		{
270-			Text: "Resources",
271-			Href: "/resources",
272-			Page: pager("resources.md"),
273-			Tag:  "Info",
274-			Children: []*pdocs.Sitemap {
275-				pdocs.AnchorTagSitemap("Quick Links"),
276-				pdocs.AnchorTagSitemap("Talk"),
277-				pdocs.AnchorTagSitemap("Other Notable Libraries"),
278+			{
279+				Text: "Loaders",
280+				Href: "/loaders",
281+				Page: pager("loader.md"),
282+				Tag:  "Side Effects",
283+				Children: []*pdocs.Sitemap{
284+					pdocs.AnchorTagSitemap("Usage"),
285+					pdocs.AnchorTagSitemap("Shape"),
286+				},
287+			},
288+			{
289+				Text: "Structured Concurrency",
290+				Href: "/structured-concurrency",
291+				Page: pager("structured-concurrency.md"),
292+				Tag:  "Info",
293+			},
294+			{
295+				Text: "Supervisors",
296+				Href: "/supervisors",
297+				Page: pager("supervisors.md"),
298+				Tag:  "Advanced",
299+				Children: []*pdocs.Sitemap{
300+					pdocs.AnchorTagSitemap("poll"),
301+					pdocs.AnchorTagSitemap("timer"),
302+				},
303+			},
304+			{
305+				Text: "Testing",
306+				Href: "/testing",
307+				Page: pager("testing.md"),
308+				Tag:  "Advanced",
309+			},
310+			{
311+				Text: "API",
312+				Href: "/api",
313+				Page: pager("api.md"),
314+				Tag:  "Info",
315+			},
316+			{
317+				Text: "Resources",
318+				Href: "/resources",
319+				Page: pager("resources.md"),
320+				Tag:  "Info",
321+				Children: []*pdocs.Sitemap{
322+					pdocs.AnchorTagSitemap("Quick Links"),
323+					pdocs.AnchorTagSitemap("Talk"),
324+					pdocs.AnchorTagSitemap("Other Notable Libraries"),
325+				},
326 			},
327 		},
328 	}
M docs/tmpl/footer.partial.tmpl
+1, -1
1@@ -1,7 +1,7 @@
2 {{define "footer"}}
3 <footer>
4   <div>
5-    Built by <a href="https://bower.sh">Eric Bower</a>
6+    Built by <a href="https://bower.sh">Eric Bower</a> and published with <a href="https://pgs.sh">pgs.sh</a>
7   </div>
8 </footer>
9 {{end}}
M docs/tmpl/post.page.tmpl
+1, -1
1@@ -43,7 +43,7 @@
2 </main>
3 
4 <div class="sitemap text-sm mb-4 text-center">
5-{{range .Sitemap -}}
6+{{range .Sitemap.Children -}}
7   <div>
8   {{- if (and $.Prev (eq $.Prev.GenHref .GenHref)) -}}
9   <a href="{{.GenHref}}" class="link-alt-adj">{{.Text}}</a>