docs: Add comprehensive Docusaurus documentation site#165
Conversation
- Add complete documentation structure with guides, concepts, and recipes - Add Algolia search configuration
CarstenLeue
left a comment
There was a problem hiding this comment.
I have two main points:
- the build output should go to the
gh-pagesbranch - the examples should NOT be part of the markdown files, but rather go examples pulled into the markdown at build time
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 |
There was a problem hiding this comment.
should use the latest LTS
|
|
||
| deploy: | ||
| environment: | ||
| name: github-pages |
There was a problem hiding this comment.
Where does this deploy to?
In a github pages deployment I would expect this to be deployed to the branch that actually serves up github pages.
| Transform data through a series of operations using function composition. | ||
|
|
||
| <CodeCard file="basic-pipeline.go"> | ||
| {`package main |
There was a problem hiding this comment.
This code should not live in this MD file, because nothing validates that this is actually compilable code.
Instead all code examples should reference an _test.go file and in that file an ExampleXXX function. That way all examples are executed at compile time and we are sure they compile.
When the docusaurus site gets build the examples need to be inserted into the docusaurus markdown.
This can e.g. be done via the https://github.com/campoy/embedmd tool (running as a pre-processor over the docusaurus files) or via a remark plugin.
|
|
||
| <CodeCard file="processUser.go" status="tested"> | ||
| {`// fp-go v2 approach | ||
| func processUser(id string) ioresult.IOResult[User] { |
There was a problem hiding this comment.
Should be
func processUser() readerioresult.ReaderIOResult[string, *User] {
return function.Flow3(
fetchUser,
ioresult.Chain(validateUser),
ioresult.Chain(saveUser),
)
}| "github.com/IBM/fp-go/v2/function" | ||
| ) | ||
|
|
||
| func processUser(id string) result.Result[User] { |
There was a problem hiding this comment.
The example should be
func processUser() readerresult.ReaderResult[string, User] {
return function.Flow4(
fetchUser,
result.Chain(validateUser),
result.Chain(enrichUser),
result.Chain(saveUser),
)
}
https://teyouale.github.io/fp-go/docs/concepts/monads/