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/revamp] proof-of-concept for synchronizing API docs with Docusaurus #23604

Closed
wants to merge 39 commits into from

Conversation

cmpadden
Copy link
Contributor

Summary & Motivation

Sphinx supports builders to create outputs in various formats: html, latex, etc. However, a third party extension sphinx_markdown_builder is required to generate markdown files for your Python project.

This proof-of-concept generates markdown files, and then copies them to the docs/sphinx directory of our Docusaurus project. Here is an example of how it is rendered:

image

Note that Docusaurus uses an MDX parser by default, which causes problems with the markdown files output by Sphinx. For example < and > would be interpreted as HTML tags. Docusaurus also supports the CommonMark format and can automatically detect if the file is mdx or md by setting config.markdown.format to detect (reference).

  markdown: {
    mermaid: true,
    format: 'detect',
  },

Whether this is an ideal way to synchronize our docs is tbd...

How I Tested These Changes

cd sphinx
make sync-docusaurus

cd ../docs-next
pnpm start

@graphite-app graphite-app bot added the area: docs Related to documentation in general label Aug 13, 2024
@graphite-app graphite-app bot requested a review from erinkcochran87 August 13, 2024 00:20
@cmpadden cmpadden requested review from PedramNavid and removed request for erinkcochran87 August 13, 2024 00:20
Copy link

netlify bot commented Aug 13, 2024

Deploy Preview for dagsterapidocs failed.

Name Link
🔨 Latest commit b3b066b
🔍 Latest deploy log https://app.netlify.com/sites/dagsterapidocs/deploys/66bb50e9ca254e0008236639

Copy link

github-actions bot commented Aug 13, 2024

Deploy preview for dagster-docs ready!

Preview available at https://dagster-docs-k1vh8q2sh-elementl.vercel.app
https://colton-docs-revamp-sphinx-poc.dagster.dagster-docs.io

Direct link to changed pages:

Copy link
Contributor

@PedramNavid PedramNavid left a comment

Choose a reason for hiding this comment

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

I don't think we should commit the converted docs, this should be part of the build process otherwise we'll end up with merge conflicts down the line.

The sphinx extension looks fairly straightforward, and I bet we can override it as well if we need to in order to enable other components. Could be interesting.


#### asset_checks

Alias for field number 7
Copy link
Contributor

Choose a reason for hiding this comment

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

What's this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Weird! I'm not sure.

@cmpadden cmpadden force-pushed the colton/docs-revamp-sphinx-poc branch from e5b6152 to b3b066b Compare August 13, 2024 12:26
@cmpadden
Copy link
Contributor Author

cmpadden commented Aug 13, 2024

I don't think we should commit the converted docs, this should be part of the build process otherwise we'll end up with merge conflicts down the line.

The sphinx extension looks fairly straightforward, and I bet we can override it as well if we need to in order to enable other components. Could be interesting.

Removed the generated files. Note that I had to remove the sidebar link for the time being, as when the files don't exist it throws errors.

If we decide to, we could still have it built locally so that vale can run, and then gitignore it. This way there is a tighter feedback loop than build -> ci -> vale fails on generated docs.

@cmpadden cmpadden marked this pull request as draft August 19, 2024 12:54
@cmpadden cmpadden closed this Sep 5, 2024
@cmpadden cmpadden deleted the colton/docs-revamp-sphinx-poc branch October 14, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: docs Related to documentation in general
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants