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

feat(documentation): migrate documentation to Starlight #1742

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

huijing
Copy link
Contributor

@huijing huijing commented Aug 17, 2023

Closes #1739

Changes proposed in this pull request

  • This is a mega-PR that migrates the entire documentation package from Docusaurus to Starlight
  • There are a number of things that I would like to discuss with the team before this PR can be finalised
    1. What to do about the APIs section?
    2. Better table design, will probably introduce a Table component or something
    3. Discussed before but found Mermaid code in the docs, so asking again, I thought we agreed to generate the diagrams and import?

Context

As part of the docs site consolidation project (see https://www.notion.so/Docusaurus-alternative-RnD-ec117420956f4e5781347631dfdc5c13?pvs=4), we will be migrating the site to Starlight, an Astro-based docs framework.

Checklist

  • Related issues linked using fixes #number
  • Tests added/updated
  • Documentation added
  • Make sure that all checks pass
  • Postman collection updated

@netlify
Copy link

netlify bot commented Aug 17, 2023

Deploy Preview for brilliant-pasca-3e80ec canceled.

Name Link
🔨 Latest commit 91e5b68
🔍 Latest deploy log https://app.netlify.com/sites/brilliant-pasca-3e80ec/deploys/64e611e18da06a00082d62d9

@github-actions github-actions bot added pkg: documentation Changes in the documentation package. type: documentation (archived) Improvements or additions to documentation labels Aug 17, 2023
Copy link
Contributor

@mkurapov mkurapov left a comment

Choose a reason for hiding this comment

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

Looks great, a few things I'd like to have before we merge in

"build": "astro build",
"preview": "astro preview",
"astro": "astro",
"graphqlBackend": "./node_modules/.bin/graphql-markdown ../backend/src/graphql/schema.graphql > src/schema-dumps/backend_raw_schema.md",
Copy link
Contributor

Choose a reason for hiding this comment

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

let's keep the commands as such:
docs:graphql:generate
docs:graphql:generate:backend
docs:graphql:generate:auth

Just for consistency with the other times we generate things

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I noticed that some of the generated graphql pages' links don't end up working for me

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we also have the pnpm build command fail if there are missing links anywhere in the docs?

packages/documentation/package.json Outdated Show resolved Hide resolved
packages/documentation/README.md Outdated Show resolved Hide resolved
packages/documentation/astro.config.mjs Outdated Show resolved Hide resolved
@mkurapov
Copy link
Contributor

There are a number of things that I would like to discuss with the team before this PR can be finalised
What to do about the APIs section?

I don't mind having it just as part of the sidebar, or a separate page. Maybe someone else has a stronger opinion.

Better table design, will probably introduce a Table component or something

What would you like to see different?

Discussed before but found Mermaid code in the docs, so asking again, I thought we agreed to generate the diagrams and import?

I think we only have one mermaid diagram, so good for now. But it looks like from a search is that there is an astro x mermaid configuration : withastro/astro#4433

@huijing
Copy link
Contributor Author

huijing commented Aug 18, 2023

There are a number of things that I would like to discuss with the team before this PR can be finalised
What to do about the APIs section?

Max: I don't mind having it just as part of the sidebar, or a separate page. Maybe someone else has a stronger opinion.

Ok, let's try it as part of the sidebar for now. And see how you feel about the entire schema being on a single page instead of being split up.

Better table design, will probably introduce a Table component or something

Max: What would you like to see different?

Without further styling, right now because the generated markdown from schema contains some unbreakable lines (URLs and variable names), I need to add additional styles to tame the overflow or weirdness that comes from that.

Discussed before but found Mermaid code in the docs, so asking again, I thought we agreed to generate the diagrams and import?

Max: I think we only have one mermaid diagram, so good for now. But it looks like from a search is that there is an astro x mermaid configuration : withastro/astro#4433

I have looked at that and we won't be able to use that implementation ourselves because we are using the Starlight integration. If we do want this, I will most likely be pursuing this implementation instead (quoted from Astro discourse, which I've been pretty much living in this past month plus)

Haven’t tried it yet, but looks like rehype-mermaidjs may be able to do this? https://github.com/remcohaszing/rehype-mermaidjs

Astro supports rehype plugins via its regular config (https://docs.astro.build/en/guides/markdown-content/#markdown-plugins), so in theory that should be compatible. I’d be hesitant to add it as a built-in given it depends on Puppeteer, but we could definitey document usage if it works!

@huijing huijing force-pushed the chj/1739/migrate-to-starlight branch from 2460175 to 97dfb08 Compare August 18, 2023 12:07
@mkurapov
Copy link
Contributor

mkurapov commented Aug 18, 2023

And see how you feel about the entire schema being on a single page instead of being split up.

Isn't it split up like rafiki.dev already? Or am I missing something?

Screenshot 2023-08-18 at 15 19 15 Screenshot 2023-08-18 at 15 19 09

re: other items, all makes sense!

@huijing huijing changed the title Migrate documentation to Starlight feat(documentation): Migrate documentation to Starlight Aug 18, 2023
@huijing huijing changed the title feat(documentation): Migrate documentation to Starlight feat(documentation): migrate documentation to Starlight Aug 18, 2023
@huijing
Copy link
Contributor Author

huijing commented Aug 18, 2023

And see how you feel about the entire schema being on a single page instead of being split up.

Isn't it split up like rafiki.dev already? Or am I missing something?

Screenshot 2023-08-18 at 15 19 15 Screenshot 2023-08-18 at 15 19 09
re: other items, all makes sense!

Ah, I should have been more clear. So, the current version of the APIs is a direct copy of the existing generated markdown files. The "new" version gives us what you would see in the "Schema types" page instead. I put them both in there for now so you all could compare the difference.

@huijing huijing force-pushed the chj/1739/migrate-to-starlight branch 3 times, most recently from 94ee016 to da7ced9 Compare August 22, 2023 10:54
Copy link
Member

@sabineschaller sabineschaller left a comment

Choose a reason for hiding this comment

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

Do we or do we not support Mermaid now? I think I saw just one diagram that was an svg in the docs.

Also, please note that I sent some design comments in the slack channel.

Copy link
Member

Choose a reason for hiding this comment

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

This is a duplicate and can be removed.

@huijing
Copy link
Contributor Author

huijing commented Aug 23, 2023

Do we or do we not support Mermaid now? I think I saw just one diagram that was an svg in the docs.

Also, please note that I sent some design comments in the slack channel.

Right now, for the Rafiki docs, I have not yet implemented it yet. I was hoping for some feedback on the whole Playwright thing here (copied from Slack):

OK FOLKS...erm...i'm going to try to put this succinctly...good news is...mermaid support seems to be working: https://deploy-preview-383--webmonetization-preview.netlify.app/docs/intro/web-monetization-flow/
it took me the better part of the day to figure out how to get it to deploy on netlify because it has a dependency on playwright.
soooooo this is the build log: https://app.netlify.com/sites/webmonetization-preview/deploys/64e5dac2011efd0008cbeac3
so under build u can see that a download of chromium is done, erm..i don't know if that's a good idea or not...cos deployment isn't really my thing. and i'm not sure how nicely this will play in rafiki cos rafiki does actually use netlify.

@sabineschaller
Copy link
Member

I think once merge conflicts are resolved, this looks good. Thank you!

Update package.json and README

Fix failing build

Add mathjax support and update config

Rebase with main and add asset page

Resolve code scanning issue

Attempt to style API tables

Refresh graphql schemas

Fix prettier issues

Fix site logo issue on dark mode

Sync theme across docs

Update readme

Update accounting tables and splash text

Remove redundant asset page

Resolve merge conflict
@huijing huijing force-pushed the chj/1739/migrate-to-starlight branch from 702d51d to 91e5b68 Compare August 23, 2023 14:04
@huijing huijing merged commit f180415 into main Aug 23, 2023
23 of 24 checks passed
@huijing huijing deleted the chj/1739/migrate-to-starlight branch August 23, 2023 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: documentation Changes in the documentation package. type: documentation (archived) Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate documentation from Docusaurus to Starlight
3 participants