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

Docusaurus v2 #174

Closed
wants to merge 22 commits into from
Closed

Docusaurus v2 #174

wants to merge 22 commits into from

Conversation

m-allanson
Copy link
Member

@m-allanson m-allanson commented Feb 3, 2021

Link to deploy preview

Which issue, if any, is this issue related to?

Related to #125

Is there anything in the PR that needs further explanation?

This doesn't need merging yet. We can leave it in draft state until Docusaurus v2 is out of alpha.

I noticed some dependabot security alerts for Docusaurus v1, so I was curious to see what the v2 migration would be like.

(The v1 alerts seem ok to ignore for now, see facebook/docusaurus#4093)

This mostly works, there are a few bits to investigate:

  • Can any more of the v1 custom CSS be deleted?
  • Maybe a bit more work on custom styling, colours in particular?
  • I've used patch-package to add closing slashes to <img> tags in the stylelint README. This should be done directly in stylelint instead
  • The demo doesn't work very well with dark mode. Some of the panels get a dark background and some don't. This should be fixed in the demo repo.

This also picked up a couple of broken links. e.g. the improve the documentation link on the contributing page.

@m-allanson m-allanson marked this pull request as draft February 3, 2021 16:47
@m-allanson m-allanson mentioned this pull request Feb 3, 2021
@jeddy3
Copy link
Member

jeddy3 commented May 29, 2021

I've just pushed up a couple of commits to reduce maintenance by bring us closer to the default preset: minimum config and custom styles.

Styling dark mode is tricky to get right, so we'll want to offload this to Docusaurus. We'll need to rustle up something for the demo, though.

The only custom styling is for validity patterns, which I've used a subtle box shadow for (in colours that work for both modes) so that we don't have to worry about clashes with the prism theme.

There's not much left to do before we can go live:

I reckon I'll have time to look into the demo styles, but not the other two items. Shout if you fancy picking up these.

@jeddy3
Copy link
Member

jeddy3 commented May 29, 2021

Latest commit fixes 2 of the 3 rule page issues listed in #125 (comment).

Unlike docusaurus 1, version 2 can:

  • have more than two levels of links in the sidebar
  • autogenerate parts or all of the sidebar

We can leverage this, and simplify the generation step to:

  1. restructure the file system, e.g. extract all the rule READMEs into one folder
  2. rewrite links within the markdown files to match this structure
  3. write frontmatter into the markdown files, e.g. title

Docusaurus can then do the rest.

@jeddy3
Copy link
Member

jeddy3 commented May 29, 2021

The next step is making pattern-validity.js compatible with docusaurus 2. I'm out of time, so this is available to pick up.

@jeddy3 jeddy3 mentioned this pull request May 30, 2021
@jeddy3 jeddy3 closed this May 30, 2021
@jeddy3 jeddy3 deleted the docusaurus-v2 branch October 21, 2021 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants