Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: added code link to fiber config fields #2385

Merged
merged 5 commits into from
Apr 4, 2023

Conversation

shahriarsohan
Copy link
Contributor

Description

When reading the docs , It was hard to see what Colors and DefaultColors really mean in Fiber.New() config fields. I added direct code link, now we can click that and see the code.

Type of change

Checklist:

  • For new functionalities I follow the inspiration of the express js framework and built them similar in usage
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation - /docs/ directory for https://docs.gofiber.io/
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • If new dependencies exist, I have checked that they are really necessary and agreed with the maintainers/community (we want to have as few dependencies as possible)
  • I tried to make my code as fast as possible with as few allocations as possible
  • For new code I have written benchmarks so that they can be analyzed and improved

@welcome
Copy link

welcome bot commented Mar 26, 2023

Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

@leonklingele
Copy link
Member

leonklingele commented Mar 26, 2023 via email

@shahriarsohan
Copy link
Contributor Author

Hey @leonklingele . It seems after every change in color.go, those links will become invalid. But now i added the permalink . It will always be the same because it referring to the current commit.

In Future, If we specifically update Colors and DefaultColors then we just have to update those links.

Thanks

@leonklingele
Copy link
Member

leonklingele commented Mar 26, 2023 via email

@shahriarsohan
Copy link
Contributor Author

shahriarsohan commented Mar 27, 2023

That also make sense because color.go is a small file. I updated those links
Thanks

@shahriarsohan
Copy link
Contributor Author

@leonklingele any update on this?

@leonklingele
Copy link
Member

@shahriarsohan it seems the API docs are autogenerated nowadays, so you need to make this change at another place (the Markdown file which you modified will get overwritten and lose your changes after the next auto docs update).

Instead, do your change here:

fiber/app.go

Lines 384 to 392 in e954194

// You can define custom color scheme. They'll be used for startup message, route list and some middlewares.
//
// Optional. Default: DefaultColors
ColorScheme Colors `json:"color_scheme"`
// RequestMethods provides customizibility for HTTP methods. You can add/remove methods as you wish.
//
// Optional. Default: DefaultMethods
RequestMethods []string

And use this kind of reference style:

https://github.com/fluhus/godoc-tricks/blob/4591e94c7b265f433db7aa658fa914beb532b9af/doc.go#L262
and
https://github.com/fluhus/godoc-tricks/blob/4591e94c7b265f433db7aa658fa914beb532b9af/doc.go#L276

Copy link
Member

@leonklingele leonklingele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the confusing, was under the impression we auto-gen the docs nowadays.

I've opened #2401 as a feature request for this.

@ReneWerner87 ReneWerner87 merged commit 74a9fa9 into gofiber:master Apr 4, 2023
@welcome
Copy link

welcome bot commented Apr 4, 2023

Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants