Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Expose default_features as class-level attributes #11

Closed

Conversation

takluyver
Copy link
Contributor

This makes it possible to add feature types to subclasses of BlockLexer and InlineLexer, without having to copy-paste the methods where their default feature orders are defined.

Background: We're investigating using mistune for rendering markdown in IPython notebooks (ipython/ipython#6028). One of our requirements is to pass through code in $-delimited mathematical expressions ($inline$ and $$block$$), without trying to render it as markdown (they are rendered by mathjax in the browser). At present, we do this by replacing all such expressions with numbered tokens like @@1@@, sending it to a renderer, and then filling them back in in the HTML. I hope that by using mistune, we can have a more elegant solution where the parser itself knows about these expressions. I think I can see how to do this, but I need a way to add a feature to the lexers.

This makes it possible to add feature types to BlockLexer and
InlineLexer without having to copy-paste the methods where their default
feature orders are defined.
@lepture
Copy link
Owner

lepture commented Jun 22, 2014

@takluyver
Copy link
Contributor Author

Thanks for the heads up - I'll have a go at it, and send you more PRs if I find I need them.

@takluyver
Copy link
Contributor Author

Closing this, because the commit was already merged.

@takluyver takluyver closed this Jun 24, 2014
@takluyver takluyver mentioned this pull request Jun 24, 2014
lepture added a commit that referenced this pull request Jun 27, 2014
can custom the parsing process of list and footnote.

Related issues:
- #8
- #11
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants