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: introduce documentation website #2279

Merged
merged 21 commits into from
Dec 20, 2023
Merged

Conversation

wellwelwel
Copy link
Collaborator

@wellwelwel wellwelwel commented Nov 14, 2023

Introducing a documentation website 🦖✨

For now, I'm testing it in a temporary repository to see everything working on GitHub Pages.
Feel free to check how it's going in https://wellwelwel.github.io/node-mysql2-website-test.


How it works (for now)?

  • After merged, it will create a new branch (gh-pages) and compile the website in this branch.
  • By setting the Pages settings to gh-pages branch, it will create a GitHub URL (https://sidorares.github.io/node-mysql2) with this branch content
  • Both the website's package.json and package-lock.json are separate from main code.

Required actions:

If you decide to keep GitHub Pages

  • Before merge it:

    • Settings > Actions > General > Workflow permissions:
      • Check if it's flagged as Read and write permissions.
  • After merge it:

    • Settings > Pages > Source:
      • Select Deploy from a branch
    • Settings > Pages > Branch:
      • Select gh-pages

Unofficial temporary favicon (this isn't a logo):

Example:
Screenshot 2023-11-21 at 01 35 42


TODO

  • Include all .md files
  • Include a free search tool (similar to Algolia)
  • Migrate translations
  • Check for lint rules and build tests
  • Include examples
  • Components
    • History
    • Stability
    • FAQ
  • Pages
    • Stability Badges
    • FAQ
      • At least one question
  • Review and test links
  • Create the website Contributing

Tech stack includes:


Naturally, ask any questions you like 🧙🏻


To discuss (resolved)

  • I opted for a 100% free format, so it uses GitHub Pages to serve the website and provides a free domain.~
  • I've chosen to show examples based on promise-based first.
  • As said in Documentation missing simple examples. How to insert using variables etc ... #2263 (comment), I'm using the current documentation and examples to start it. Naturally, increasing more complete documentation in the long term.
  • Only after (if) this PR is approved, remove the "old" documentation and direct it to the website (in a new PR).

@wellwelwel
Copy link
Collaborator Author

Testing the documentation search 🕵🏻

Screenshot 2023-11-14 at 05 09 02

@sidorares
Copy link
Owner

I'd like to balance "light and simple to navigate" vs "complete" so feel free to push on these suggestions. What do you think about adding:

happy to discuss that later and if we agree to add have as a later change

@sidorares
Copy link
Owner

we could potentially use https://mysql2.js.org domain . To get it we would need to open https://github.com/js-org/js.org/pulls PR and get it approved and merged

@wellwelwel
Copy link
Collaborator Author

wellwelwel commented Nov 15, 2023

I'd like to balance "light and simple to navigate" vs "complete"

Yes, in a simple way, Docusaurs can be seen as a React App that parses markdowns to React Components ⚛️

So we have a flexible way to create documentations using both markdown (.md and .mdx) and entire pages in ReactJS (.tsx).

The "stability" badge for example, could be a React page.
And yes, we can set some sections as external links 🧑🏻‍🔧


An important point is that it should be easy to maintain by:

  • creating a Contributing.md exclusive for the website, showing:
    • how to start the server locally
    • how the routes work
    • how to add a new sidebar section
    • how to add a new page (like faq, etc.)

history ( at least "version when api was introduced" )

I don't get it 😟
Do you say something like v3.x, v4.x, etc.? If so, yes, we can do it 🙋🏻‍♂️


By lastly, you can set a custom domain on GitHub Pages settings, case not, it will be the default https://sidorares.github.io/node-mysql2 🌞

@sidorares
Copy link
Owner

version when api was introduced

see "history" blocks in nodejs docs, for example here https://nodejs.org/api/async_hooks.html#class-asynchook

Basically an earliest version before which documented api cannot be used

image

@wellwelwel

This comment has been minimized.

@wellwelwel
Copy link
Collaborator Author

wellwelwel commented Nov 20, 2023

Hey @sidorares, a simple question about options: A or B?

For now, I'll keep it as it is (A) 👩🏻‍🎤

  • A (original):

    • Screenshot 2023-11-20 at 06 05 40
  • B:

    • Screenshot 2023-11-20 at 06 04 09

@sidorares
Copy link
Owner

Both look good, I trust your taste here

website/static/examples/execute.js Fixed Show fixed Hide fixed
website/static/examples/pass-sha.js Fixed Show fixed Hide fixed
website/static/examples/mysqlproxy.js Fixed Show fixed Hide fixed
website/static/examples/pool-test.js Fixed Show fixed Hide fixed
website/static/examples/prepare.js Fixed Show fixed Hide fixed
website/static/examples/queries/select.js Fixed Show fixed Hide fixed
@wellwelwel
Copy link
Collaborator Author

wellwelwel commented Nov 27, 2023

@sidorares, finally, it's ready 🎉✨


Notes

  • This PR keeps everything intact with absolutely 0 deletions
    • Everything happens in the "website" directory
  • No documentation was modified or added, except for:
    • In README documentation section, I've added both promise and callback examples
    • I've used the Stability Badges and History in the TypeScript documentation
  • Documentation and examples can now be searched dynamically
  • The search works for all languages and searches all pages for each language
    • 🇺🇸
    • 🇨🇳
    • 🇧🇷
  • I introduced some of the ideas we discussed:
    • History
    • Stability
    • Stability Badges page (derived and shaped from the equivalent section in the Node.js documentation)
    • FAQ page
      • I created the "How to handle errors?" FAQ as a starting point for subsequent FAQ contents

What's Next?

  • About the https://mysql2.js.org domain, it needs the link working before to open a PR.
    • They're going to review the content first before approving the domain.
  • Next up, the new challenge is to create all the long-term documentation.
    • That we can work on with the community's help 🤝
  • And the most important question:
    • How do you feel about this documentation website initial state? 🙋🏻‍♂️

An Overview of the New Sections

@wellwelwel
Copy link
Collaborator Author

wellwelwel commented Dec 5, 2023

Just some refinements and a Donate following link to https://github.com/sponsors/sidorares 🧑🏻‍🔧

@sidorares
Copy link
Owner

sorry very busy last few days but I promise I'll give some attention very soon!

@wellwelwel
Copy link
Collaborator Author

wellwelwel commented Dec 5, 2023

sorry very busy last few days but I promise I'll give some attention very soon!

Hey, everything's fine.
Thank you and no worries! 🤝✨

@wellwelwel wellwelwel added the website Website features, issues, etc. that aren't directly related to the documentation. label Dec 18, 2023
@sidorares sidorares merged commit 15f1669 into sidorares:master Dec 20, 2023
58 checks passed
@sidorares
Copy link
Owner

its live 🎉

Thank you for this amazing effort @wellwelwel ❤️

I'll think about domain later and next steps in improving documentation ( I have few new topics in mind for FAQ ) but this is already looking very very good

@wellwelwel
Copy link
Collaborator Author

wellwelwel commented Dec 20, 2023

Yeah 🎉

The second step would be to remove the "old" docs and examples from /docs and /examples, and then adapt README.md to suggest the website, naturally concentrating/focusing the documentation and examples in just one place.

Still not changing any current documentation

I'd like to get this done before I go on my vacation 🌞

@wellwelwel wellwelwel deleted the website branch December 20, 2023 21:10
@wellwelwel
Copy link
Collaborator Author

@sidorares , a small suggestion would be to flag the "Use your GitHub Pages website" on repository details:

Screenshot 2023-12-20 at 18 55 01

Then:

Screenshot 2023-12-20 at 18 58 31

@sidorares
Copy link
Owner

done, thanks for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation website Website features, issues, etc. that aren't directly related to the documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants