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

Allow adding Marked Extensions in NueJS #182

Open
nobkd opened this issue Jan 28, 2024 · 5 comments · May be fixed by #230
Open

Allow adding Marked Extensions in NueJS #182

nobkd opened this issue Jan 28, 2024 · 5 comments · May be fixed by #230
Assignees
Labels
new feature New feature or request

Comments

@nobkd
Copy link
Collaborator

nobkd commented Jan 28, 2024

Hey I noticed nuemark uses marked as the underlying library. Is there an easy way to add marked extensions for things like footnotes?

Originally posted by @indifferentghost in #159 (comment)

I think this deserves its own issue for tracking.

@Darth-Ness
Copy link

According to the docs there does seem to be some add-ons. Also shouldn't this be in #170?

@nobkd nobkd changed the title Allow extending Marked in NueJS Allow adding Marked Extensions in NueJS Jan 29, 2024
@nobkd
Copy link
Collaborator Author

nobkd commented Jan 29, 2024

Yes. It is a valid notice, that this is connected to that issue, but I wouldn't say that it's completely the same. We'll see.

As for the add-ons list: Yes, Marked supports these extensions, but there currently is no proper system in place to pass the extensions through Nue to the marked instance. :)


I've already looked into dynamically importing a (js-)file with the user added extensions (provided as relative file path in the site.yaml), but you need to have the base project directory path, as well as the extension file path available from inside of Nuemark (not nuekit). (As of the current project structure)
This can be achieved okay-ish. But I'll look around some more for a better way. But maybe someone else has a better implementation in mind.

@Darth-Ness
Copy link

Ah okay. What I was thinking for this was a use library-x directly in the markup, and then on building it fetches all of the necessary add-ons.

@nobkd
Copy link
Collaborator Author

nobkd commented Jan 29, 2024

Quite the interesting idea 👀, but not sure how good that would work, as you sometimes want to change configuration options for the (Marked) extensions. Sometimes even with JS, which is the reason, that I wouldn't include the config directly in the site.yaml

@Darth-Ness
Copy link

Ah, didn't realize that you could configure the addons as well. Hmm, then yeah it probably makes since to have it in a config file.

@nobkd nobkd added the new feature New feature or request label Feb 9, 2024
@nobkd nobkd linked a pull request Mar 14, 2024 that will close this issue
2 tasks
@nobkd nobkd self-assigned this Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants