Open ajatprabha opened 1 year ago
I verified locally that correcting the syntax does result in a successful build. Is there a way to change this behaviour behind a cli flag maybe?
Hey @ajatprabha, thanks for looking into this. The [](<>)
syntax was pulled from the GitHub Flavored Markdown spec and does work correctly when used within GitHub. I'm not familiar with Docusaurus - does it differ from GFM at all or is it designed to support identical syntax? If it's the former then I'd be open to including an additional formatter that is specific to the format that Docusaurus expects.
Lacking the ability to do that, a CLI flag seems like a possible option. Removing the <>
would likely cause little impact to people using the tool today, but there are some edge cases for links that aren't possible without the <>
Docusaurus uses MDX which according to docs is a superset of standard Markdown syntax supporting JSX as well.
Not sure how much effort it will be to add a new flavour for this.
Adding new format types isn't too bad (most code has a shared core and tests are generated from snapshots anyway). It looks like the specific problem with MDX here is not actually the base markdown syntax (CommonMark is the base spec they reference and it supports <>
around link destinations), but rather their note about needing to escape <
and >
to avoid conflicts with the JSX syntax.
Are there any other features of the github
format that don't make sense for your use case? Things like the repository code links and accordion are pretty specific to how GFM wants to render things and don't carry over to the plain
format for instance.
I've considered adding a CommonMark format in the past and have only held off because nobody has asked for it. I'd be alright with throwing an MDX format in with a couple tweaks while I'm at it if that can make the integration more seamless.
I'm working on something where I need to use the Markdown generated from
gomarkoc
, and then use the result in a Docusaurus documentation project.However, creating a build fails, because the
Link
is probably wrong, AFAIK, I have seen the syntax to be[text](link)
and not[text](<link>)
.https://github.com/princjef/gomarkdoc/blob/e62c5abf78916697dbc4b25f590deb28f26f5184/format/formatcore/base.go#L101
GitHub Docs Ref: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#links
Is there any particular reason for doing this? If not, can we fix this?
Failing use-case: Link
Error:
{`ExponentialStartStrategy will keep attempting to call Client.Start in the background and retry on error, it will never exit unless the context used to invoke is cancelled. This will NOT stop the client, that is the responsibility of caller.`}
15[7](https://github.com/gojek/courier-go/actions/runs/5461645779/jobs/9939911784#step:5:8) | SyntaxError: /home/runner/work/courier-go/courier-go/docs/docs/sdk/otelcourier.md: Unexpected token (52:0) 50 | 51 | ## func [DisableCallbackTracing]({`DisableCallbackTracing disables implicit tracing on subscription callbacks.`}
55 | SyntaxError: /home/runner/work/courier-go/courier-go/docs/docs/sdk/xds/backoff.md: Unexpected token (29:0) 27 | 2[8](https://github.com/gojek/courier-go/actions/runs/5461645779/jobs/9939911784#step:5:9) | ## type [Exponential]({`Exponential implements exponential backoff algorithm as defined in `}{`https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md`}{`.`}
| ^ 30 |