-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Markdown reader: add extension for GitHub wiki's internal link syntax [[page name]] #2923
Comments
The syntax is documented here. It would be worth adding an extension for this. |
Thanks @jgm! Pandoc is pretty amazing! I'll admit I haven't read the source, but this is the regex I'm using to do this conversion now: |
Changes overview: * Add a `Ext_markdown_github_wikilink` extension * Added in the `githubMarkdownExtensions` list * Added in the `getAllExtensions` list * Add the parser `githubWikiLink` in `Text.Pandoc.Readers.Markdown` * Added it high in the `inline` parsers list * Add two tests, one for each form
Changes overview: * Add a `Ext_markdown_github_wikilink` extension * Added in the `githubMarkdownExtensions` list * Added in the `getAllExtensions` list * Add the parser `githubWikiLink` in `Text.Pandoc.Readers.Markdown` * Added it high in the `inline` parsers list * Add two tests, one for each form
Changes overview: * Add a `Ext_markdown_github_wikilink` extension * Added in the `githubMarkdownExtensions` list * Added in the `getAllExtensions` list * Add the parser `githubWikiLink` in `Text.Pandoc.Readers.Markdown` * Added it high in the `inline` parsers list * Add two tests, one for each form
Changes overview: * Add a `Ext_markdown_github_wikilink` extension * Added in the `githubMarkdownExtensions` list * Added in the `getAllExtensions` list * Add the parser `githubWikiLink` in `Text.Pandoc.Readers.Markdown` * Added it high in the `inline` parsers list * Add two tests, one for each form
Re-opening, on the realization that we really need the parser in a commonmark extension (so it can be used with |
The tests and extension module work in #6458 will be useful when the commonmark-hs extension is available. |
The wikilinks extension is available now for commonmork-hs: |
Note that in commonmark-hs we support two forms of the extension, |
I think it would be good to support multiple markdown wikilink syntaxes, not just the one used in GitHub wikis, but those used in popular note taking applications like obsidian and roam. |
Emanote (a publishing tool compatible with Obsidian and Foam) has its own implementation of the |
Adds commonmark extensions `wikilinks_title_after_pipe` and `wikilinks_title_before_pipe`. The former enables links of style `[[Name of page|Title]]` and the latter `[[Title|Name of page]]`. Titles are optional in both variants, so this works for both: `[[https://example.org]]`, `[[Name of page]]`. The writer is modified to render links with title `wikilink` as a wikilink if a respective extension is enabled. Pandoc will use `wikilinks_title_after_pipe` if both extensions are enabled. Closes: jgm#2923
Adds commonmark extensions `wikilinks_title_after_pipe` and `wikilinks_title_before_pipe`. The former enables links of style `[[Name of page|Title]]` and the latter `[[Title|Name of page]]`. Titles are optional in both variants, so this works for both: `[[https://example.org]]`, `[[Name of page]]`. The writer is modified to render links with title `wikilink` as a wikilink if a respective extension is enabled. Pandoc will use `wikilinks_title_after_pipe` if both extensions are enabled. Closes: jgm#2923
Adds the Markdown/CommonMark extensions `wikilinks_title_after_pipe` and `wikilinks_title_before_pipe`. The former enables links of style `[[Name of page|Title]]` and the latter `[[Title|Name of page]]`. Titles are optional in both variants, so this works for both: `[[https://example.org]]`, `[[Name of page]]`. The writer is modified to render links with title `wikilink` as a wikilink if a respective extension is enabled. Pandoc will use `wikilinks_title_after_pipe` if both extensions are enabled. Closes: jgm#2923
Adds the Markdown/CommonMark extensions `wikilinks_title_after_pipe` and `wikilinks_title_before_pipe`. The former enables links of style `[[Name of page|Title]]` and the latter `[[Title|Name of page]]`. Titles are optional in both variants, so this works for both: `[[https://example.org]]`, `[[Name of page]]`. The writer is modified to render links with title `wikilink` as a wikilink if a respective extension is enabled. Pandoc will use `wikilinks_title_after_pipe` if both extensions are enabled. Closes: #2923
Thanks so much! This is awesome! |
Adds the Markdown/CommonMark extensions `wikilinks_title_after_pipe` and `wikilinks_title_before_pipe`. The former enables links of style `[[Name of page|Title]]` and the latter `[[Title|Name of page]]`. Titles are optional in both variants, so this works for both: `[[https://example.org]]`, `[[Name of page]]`. The writer is modified to render links with title `wikilink` as a wikilink if a respective extension is enabled. Pandoc will use `wikilinks_title_after_pipe` if both extensions are enabled. Closes: jgm#2923
Please add mediawiki images conversion: |
Forgive me if this has already been noted as an issue but I did a bit of searching through issues and online and didn't turn up with anything.
I'm on the latest version of Pandoc (1.17.0.2) and I'm attempting to use markdown_github to convert to HTML. I'm noticing that Pandoc does not convert links that look like the following:
[[example link|MarkdownPage]]
[[MarkdownPage]]
It's possible we are using outdated constructs, but GitHub has supported this for years. I noticed that Sublime supports the second but not the first with it's regular markdown preview tool.
The command I'm running:
pandoc --from markdown_github+simple_tables+native_spans+native_divs+multiline_tables --to html5 [..snip..]
Is this something that could be added for conversion? Or is there an extension that already does this that I may have missed?
The text was updated successfully, but these errors were encountered: