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

Replace documentation website with Docusaurus #259

Merged
merged 78 commits into from
May 18, 2022
Merged

Replace documentation website with Docusaurus #259

merged 78 commits into from
May 18, 2022

Conversation

GabLeRoux
Copy link
Member

@GabLeRoux GabLeRoux commented Apr 24, 2022

While working on replacing on #218 I found that there is a docsearch Docusaurus v2 template available and felt it would be interesting to give this optimized site generator a try.

Changes

[WARNING] Duplicate routes found!
- Attempting to create page at /docs/docker/versions, but a page already exists at this route.
This could lead to non-deterministic routing behavior.

This is due to a workaround to get the versions page to show in the navigation, but the page itself is handled by a docusaurus page.


For this deployment to work, vercel settings needs to be updated to docusaurus 2:

image

⚠️ caution, this has an impact for other deployments. When working on this branch, update the value. When you're done, switch back to Next.

Concerning NodeJS version, it doesn't need to be updated as it can be determined from package.json's value 👍. Docusaurus is not compatible with Node 12, but it is compatible with Node 14 and 16. Vercel is not compatible with Node 16 so we're sticking with Node 14 for now.

Checklist

  • Read the contribution guide and accept the code of conduct
  • Readme (updated or not needed)
  • Tests (added, updated or not needed)

@vercel
Copy link

vercel bot commented Apr 24, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
website ✅ Ready (Inspect) Visit Preview May 18, 2022 at 6:29AM (UTC)

@github-actions
Copy link

Cat Gif

@GabLeRoux
Copy link
Member Author

GabLeRoux commented Apr 24, 2022

Tried deployment using docusaurus 2 template in Vercel and getting some small issues.

image

offending urls so far:

  • /docs/github/getting-started#workflow-examples
  • /docs/github/getting-started#il2cpp-example
  • /docs/docker/versions
  • /docs/github/getting-started#simple-example

The docker/versions will need to be recreated. The other ones seems to be caused by url versioning. I'll do a small workaround by moving docs from github/v2 to github/ for now. We can determine later how to handle docs versioning again as per https://docusaurus.io/docs/versioning

@GabLeRoux
Copy link
Member Author

GabLeRoux commented May 18, 2022

* Linting works

* and is enforced using lefthook

I just tested that locally, I modified src/pages/docs/docker/versions.tsx with bad spaces and it got fixed so yes it works for me too here 👍

Details about what I tried
yarn
echo "    " >> src/pages/docs/docker/versions.tsx
git add src/pages/docs/docker/versions.tsx
git commit -m "test"

The hook executed and fixed the file:
ScreenShot iTerm2 2022-05-18 at 00 12 48@2x

On a side note, it took more time than what I expected. I think it can be improved later tho. I think it's better to have this than it is to skip it even if it takes some time.

Observations concerning eslint execution time I tried it again and still getting similar result:
eslint '*/**/*.{js,ts,tsx}' --quiet --fix src/pages/docs/docker/versions.tsx
✨  Done in 11.36s.

Maybe it's just eslint that takes time and I'm not used to it. I tried these:

# similar to how it's invoked by lefthook
 time ./node_modules/.bin/eslint  '*/**/*.{js,ts,tsx}' --quiet --fix src/pages/docs/docker/versions.tsx
./node_modules/.bin/eslint '*/**/*.{js,ts,tsx}' --quiet --fix   17.17s user 1.48s system 157% cpu 11.832 total
# tried without '*/**/*.{js,ts,tsx}', seems to be a bit better
time ./node_modules/.bin/eslint --quiet --fix src/pages/docs/docker/versions.tsx
./node_modules/.bin/eslint --quiet --fix src/pages/docs/docker/versions.tsx  12.93s user 1.34s system 148% cpu 9.618 total

This was only useful when tailwindcss base css was loaded, this is not the case anymore
@GabLeRoux
Copy link
Member Author

GabLeRoux commented May 18, 2022

I did a quick pass on each of the pages and everything seems fine.

The only thing I found that I felt it was worth fixing is that the dracula theme (used in dark theme) wasn't as nice as the github theme (used in light theme) or our previous one as we can see here:

Left side: docusaurus, right side, previous implementation.

ScreenShot Firefox Developer Edition 2022-05-18 at 01 05 59@2x

ScreenShot Firefox Developer Edition 2022-05-18 at 01 05 25@2x

My main complain about it is that most of the yaml keys aren't colored. I might be picky tho, but I use dracula theme every day in my IDE and my yaml files looks much better than the one from FormidableLabs/prism-react-renderer default dracula theme.

I went ahead with 57294e6

Before:

ScreenShot Firefox Developer Edition 2022-05-18 at 02 25 31@2x

After:

ScreenShot Firefox Developer Edition 2022-05-18 at 02 25 56@2x

The dark theme is also much closer to the github light theme.

@GabLeRoux GabLeRoux changed the title WIP: Replace documentation website with docusaurus Replace documentation website with Docusaurus May 18, 2022
@GabLeRoux
Copy link
Member Author

lgtm 🚀

@webbertakken
Copy link
Member

webbertakken commented May 18, 2022

@GabLeRoux thanks for pointing that out. Fixing in #272

* Linting works

* and is enforced using lefthook

I just tested that locally, I modified src/pages/docs/docker/versions.tsx with bad spaces and it got fixed so yes it works for me too here 👍

Details about what I tried
On a side note, it took more time than what I expected. I think it can be improved later tho. I think it's better to have this than it is to skip it even if it takes some time.

Observations concerning eslint execution time

@GabLeRoux thanks for pointing that out. Fixing in #272

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

Successfully merging this pull request may close these issues.

3 participants