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

Align markdown parser with docusaurus #15168

Closed
timroes opened this issue Aug 1, 2022 · 2 comments · Fixed by #15519
Closed

Align markdown parser with docusaurus #15168

timroes opened this issue Aug 1, 2022 · 2 comments · Fixed by #15519
Assignees
Labels
area/frontend Related to the Airbyte webapp

Comments

@timroes
Copy link
Collaborator

timroes commented Aug 1, 2022

We currently use a standard markdown parser for the docs sidepanel in the UI, while the doc system renders using Docusaurus. This leads to Docusaurus supporting some syntax that will then not render in the UI properly. We should try to build support for this syntax in the UI, by manually parsing (regex) this syntax.

List of unsupported syntax:

  • :: caution blocks
@timroes timroes added area/frontend Related to the Airbyte webapp ui/connectors labels Aug 1, 2022
@octavia-squidington-iii
Copy link
Collaborator

cc @airbytehq/frontend

@zaclittleberry
Copy link

zaclittleberry commented Aug 6, 2022

One option is to use the same renderer as docusaurus:

Looks like docusaurus uses MDX v1 as its rendering engine, which is specifically where the :::caution,note,tip,info syntax comes from: https://github.com/facebook/docusaurus/blob/main/website/docs/guides/markdown-features/markdown-features-react.mdx

I have confirmed that your current docusaurus version is using @mdx-js/react@1.6.22. (Published Dec 2020, but even the docusaurus 2.0rc is using MDX 1, 🤷 )

Regex will probably be a smaller, safer change. If not as complete in parity with the rest of docusaurus' rendering support.

The regex solution may be something like this: regexr.com/6rbu7 . Note, Regexr's "Replace" pane doesn't render until the text area is updated, so you can just throw a space in the text to see an example replace with a pseudo <info> component.

  • this regex solution would have to be done for each caution,note,tip, and info, or modified.
  • this regex solution would not work with nested ::: syntax. I don't know if that is valid or not.

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants