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

Add rendering support for Atlassian Document Format #230

Open
danarth opened this issue Nov 1, 2024 · 2 comments
Open

Add rendering support for Atlassian Document Format #230

danarth opened this issue Nov 1, 2024 · 2 comments
Labels

Comments

@danarth
Copy link

danarth commented Nov 1, 2024

It would be really great to be able to parse Markdown and output a JSON document as Atlassian Document Format.

Mistletoe already supports rendering Jira syntax, but ADF is supported in both Jira and Confluence so would be incredibly useful for writing Confluence pages as Markdown.

I guess it could work similarly to the ASTRenderer works, since the BaseRenderer methods all expect string outputs, whereas this output is a JSON format so could make more sense to keep the responses as dictionaries and convert to a string at the very end.. but keen to hear thoughts.

I'd like to take a crack at this - my time is limited so may take a while :)

@pbodnar
Copy link
Collaborator

pbodnar commented Nov 10, 2024

Hi @danarth, interesting, I haven't heard of this ADF, JSON-based format yet - probably because it is used just for the cloud, not for the "legacy" on-premise Jira/Confluence instances I'm used to work it.

Anyway, I agree a new renderer for ADF should probably basically work similarly to the existing AstRenderer. It has got this universal get_ast(token) method returning a dictionary. For ADF, this will get more complex, because we need to output specific attributes for each token type, e.g. for table.

Another possible "challenge" could be if for some token types the resulting hierarchy/tree wouldn't exactly match the mistletoe's AST...

I'd like to take a crack at this - my time is limited so may take a while :)

It would be great if you could take a closer look at this. Luckily, I hope, there is no rush. :)

@pbodnar
Copy link
Collaborator

pbodnar commented Nov 10, 2024

PS: I suggest to place the new renderer to the contrib folder.

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

No branches or pull requests

2 participants