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

🪟 🎉 Support docusaurus admonitions in markdown docs #15519

Merged
merged 6 commits into from
Aug 12, 2022

Conversation

edmundito
Copy link
Contributor

@edmundito edmundito commented Aug 10, 2022

What

Fixes #15168

Adds support for Docusaurus admonitions used in the doc markdown files so that they render in the connector docs side panel.

image

Additionally, fixes some markdown issues such as heading text sizes and improvements to code blocks:
image

Adds Markdown story to storybook to preview changes.

Lazy loads documentation panel to avoid Markdown modules from being bundled into the main app js until they're needed.

How

I researched @mdx-js/react as suggested in the #15168 comments, but it turned out that its usage is more about pre-compiling the docs over rendering them in real-time.

Looking at our existing library (react-markdown), I figured out that I could create a custom plugin with the help of remark-directive to parse out the admonitions and style them.

There was a similar plugin that did this (remark-admonitions,) but it was not up to date and did not match docusaurus (see issue 49 in that repo).

Recommended reading order

  1. Markdown.tsx
  2. remarkAdmonitionsPlugin.ts
  3. Markdown.style.css
  4. Rest of the code

Tests

  • Tested markdown pages with code and admonition tags
  • Added storybook for Markdown
  • Built app and checked bundled sizes

@edmundito edmundito added area/frontend area/frontend Related to the Airbyte webapp labels Aug 10, 2022
@github-actions github-actions bot added the area/platform issues related to the platform label Aug 10, 2022
* Narrow down docs folders in vscod workspace
* Add mdast and remark-directive dependencies
* Add remark-directive to Markdown component plugins
* Add admonitions plugin to support docusaurus admonitions
* Add styles for admonitions in markdown files
@edmundito edmundito force-pushed the edmundito/markdown-admonitions branch from 900733f to de61c65 Compare August 11, 2022 14:01
@edmundito edmundito marked this pull request as ready for review August 11, 2022 14:05
@edmundito edmundito requested a review from a team as a code owner August 11, 2022 14:05
Copy link
Contributor

@krishnaglick krishnaglick left a comment

Choose a reason for hiding this comment

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

Nicely done! Looks good in storybook, and for the postgres docs!

.vscode/frontend.code-workspace Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Related to the Airbyte webapp area/platform issues related to the platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Align markdown parser with docusaurus
2 participants