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

Any Clues on How to render [[]] in MDX / Remark #309

Closed
phil-lgr opened this issue Mar 22, 2021 · 8 comments
Closed

Any Clues on How to render [[]] in MDX / Remark #309

phil-lgr opened this issue Mar 22, 2021 · 8 comments
Labels
question Further information is requested

Comments

@phil-lgr
Copy link

Hi there,

I'm so glad to have found your project, thanks for creating it.

Would you have any clues on how to tell mdx to resolve the links created with Memo [[]] so that we can render actual pages into a docs website ?

@phil-lgr
Copy link
Author

@phil-lgr
Copy link
Author

is there any reason why you went with [[Real Page|Page Alias]] instead of [[Real Page:Page Alias]] ? the latter seems to be more in use? I'm thinking out loud

@phil-lgr
Copy link
Author

image

prettier does not work well with the | character in table whereas : works fine

image

@phil-lgr
Copy link
Author

Wikipedia docs: https://en.wikipedia.org/wiki/Help:Link

@svsool
Copy link
Owner

svsool commented Mar 22, 2021

Would you have any clues on how to tell mdx to resolve the links created with Memo [[]] so that we can render actual pages into a docs website ?

Not familiar with remark. Memo uses markdown-it, see this file to learn how it's implemented.

is there any reason why you went with [[Real Page|Page Alias]] instead of [[Real Page:Page Alias]] ? the latter seems to be more in use? I'm thinking out loud

For compatibility with Obsidian.md and that users could transition more easily.

To use links within table you need to escape pipe symbol, see this issue for reference #164.

@svsool svsool added the question Further information is requested label Mar 22, 2021
@phil-lgr
Copy link
Author

Worked with https://github.com/landakram/remark-wiki-link

/**
 * remark plugin to parse [[Wiki Link]].
 * @see https://github.com/landakram/remark-wiki-link
 */
export const remarkWikiLinkPlugin = [
  wikiLinkPlugin,
  {
    aliasDivider: '|',
  },
];

I just had to change the alias divider, some adjustment to generated path and it's all good!

@phil-lgr
Copy link
Author

phil-lgr commented Mar 22, 2021

Just for reference

image

Memo makes everything so nice since it takes care of updating the links in my md files, backlinks are a great addition too.

Hey maybe we should have a gatsby + remark + memo demo somewhere for reference :)

@phil-lgr
Copy link
Author

another trick that might be useful

to convert the a tag into Gatsby Link one must use

https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-catch-links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants