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

[liquid_tags:notebook] Add language highlighting option #283

Merged
merged 1 commit into from Aug 28, 2014

Conversation

Projects
None yet
3 participants
@isms
Contributor

isms commented Aug 28, 2014

Hey @jakevdp -- here's a random pull request for liquid tags!

This adds an option to specify the language which Pygments should use for highlighting code cells.

{% notebook filename.ipynb language[julia] %}

This may be helpful for those using IJulia or notebooks in any other language, especially as the IPython project broadens its scope of language compatibility. By default, the language for highlighting will be ipython.

This came up for me last night, hence the pull request. It's working:

selection_010

Also:

  • Updated Readme.md for this and the cells option
  • Fixed a couple other small typos elsewhere in Readme.md
  • Add tests for notebook tag regex
$ python -m liquid_tags.test_notebook
.......
----------------------------------------------------------------------
Ran 7 tests in 0.000s

OK

@isms isms changed the title from Add language highlighting option to notebook tag to [liquid_tags:notebook] Add language highlighting option Aug 28, 2014

Show outdated Hide outdated liquid_tags/Readme.md
compatibility](http://jupyter.org/). By default, the language for highlighting
will be ``ipython``.
These tags are both optional, and can be used separately, together, or not at all.

This comment has been minimized.

@jakevdp

jakevdp Aug 28, 2014

Contributor

Looking at the regexp, it will only work together if cells is specified before language. Making it agnostic to order is hard with regexps; the easiest fix would be to just update the docs here.

@jakevdp

jakevdp Aug 28, 2014

Contributor

Looking at the regexp, it will only work together if cells is specified before language. Making it agnostic to order is hard with regexps; the easiest fix would be to just update the docs here.

@jakevdp

This comment has been minimized.

Show comment
Hide comment
@jakevdp

jakevdp Aug 28, 2014

Contributor

I've not tried this, but it looks pretty straightforward.

Contributor

jakevdp commented Aug 28, 2014

I've not tried this, but it looks pretty straightforward.

isms added a commit to isms/pelican-plugins that referenced this pull request Aug 28, 2014

@isms

This comment has been minimized.

Show comment
Hide comment
@isms

isms Aug 28, 2014

Contributor

@jakevdp - Great point in #283 (comment), fixed by 2fa1551

Contributor

isms commented Aug 28, 2014

@jakevdp - Great point in #283 (comment), fixed by 2fa1551

@justinmayer

This comment has been minimized.

Show comment
Hide comment
@justinmayer

justinmayer Aug 28, 2014

Member

@jakevdp: Thanks for chiming in so quickly. (^_^)

@isms: Thanks for the contribution. Would you please squash the latter two commits into the first? (i.e., resulting in a single commit)

Member

justinmayer commented Aug 28, 2014

@jakevdp: Thanks for chiming in so quickly. (^_^)

@isms: Thanks for the contribution. Would you please squash the latter two commits into the first? (i.e., resulting in a single commit)

Add language highlighting option to notebook tag
Update documentation and fix small errors
Add tests for notebook tag regex

Update SYNTAX string to match new regex

Explicitly outline necessary order for tag options

Addresses concern in
#283 (comment)
@isms

This comment has been minimized.

Show comment
Hide comment
@isms

isms Aug 28, 2014

Contributor

@justinmayer: All set, I think. Let me know if I missed anything.

Contributor

isms commented Aug 28, 2014

@justinmayer: All set, I think. Let me know if I missed anything.

@justinmayer

This comment has been minimized.

Show comment
Hide comment
@justinmayer

justinmayer Aug 28, 2014

Member

Many thanks, Isaac.

Member

justinmayer commented Aug 28, 2014

Many thanks, Isaac.

justinmayer added a commit that referenced this pull request Aug 28, 2014

Merge pull request #283 from isms/liquid-notebook-language
[liquid_tags:notebook] Add language highlighting option

@justinmayer justinmayer merged commit 50f426b into getpelican:master Aug 28, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment