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

Syntax for Goldmark #63

Open
henrysheehy opened this issue Jan 15, 2024 · 2 comments
Open

Syntax for Goldmark #63

henrysheehy opened this issue Jan 15, 2024 · 2 comments

Comments

@henrysheehy
Copy link

Dear developers,
Thank you for this brilliant work!
I would like to kindly ask how I might go about changing the current syntax:

```{.python .cb-nb}
# Some code
``` 

To a Goldmark syntax, for my own needs:

```python {.cb-nb}
# Some code
```

Kind regards,
Henry

@gpoore
Copy link
Owner

gpoore commented Jan 15, 2024

The code block attribute syntax is from Pandoc. Codebraid uses Pandoc internally to do all the Markdown parsing, so changing syntax isn't possible within Codebraid itself. You could probably create a custom Pandoc Lua reader for Goldmark syntax, and then use that as the input format. You would have to identify all code blocks (and inline code, if you're using that), then rewrite the attributes into Pandoc syntax, and finally pass the result to Pandoc's Markdown parser. Or if you can figure out another way to convert a document from Goldmark syntax into Pandoc syntax, you could pipe your documents through the converter and into Codebraid.

@henrysheehy
Copy link
Author

Thank you, I appreciate your detailed reply!

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

No branches or pull requests

2 participants