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

Make rendering use optional dependencies #69

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pydanny
Copy link

@pydanny pydanny commented Dec 31, 2024

Background

If mistletoe isn't installed, then the error is captured while a text string is returned. There is no option to use other renders. This makes mistletoe a 'magic dependency'.

What this PR does

  1. Attempts to use mistletoe as the default
  2. Provides the ability to use other renderers
  3. On failure, provides a more clear message to the logs

@pydanny pydanny force-pushed the make-mistletoe-standard-dependency branch from 056ab66 to 5e9ae9d Compare December 31, 2024 15:08
@pydanny pydanny marked this pull request as ready for review December 31, 2024 15:09
@jph00
Copy link
Contributor

jph00 commented Dec 31, 2024

We definitely don't want to make it a dep, since it's a large requirement for folks that don't need that one function. How about instead if the import fails we raise an error if the function is called?

@pydanny pydanny changed the title Make mistletoe a standard dependency Make rendering use optional dependencies Jan 3, 2025
Copy link
Contributor

@jph00 jph00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing something, but I don't see how this would work -- e.g. markdown_func is used, but it's not actually set by the is None conditional AFAICT?

Add some examples/tests to the NB so we can be sure it's working correctly.

Since you've changed the render_outputs params to be docments-compatible, you should now properly document all the params (since a table will now be added to the docs with this output). Make the documentation of defaults more concise, and add explanations of every param.

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

Successfully merging this pull request may close these issues.

2 participants