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

[liquid_tags:notebook] Add language highlighting option #283

Merged
merged 1 commit into from Aug 28, 2014

Conversation

@isms
Copy link
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 Add language highlighting option to notebook tag [liquid_tags:notebook] Add language highlighting option Aug 28, 2014
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.

Copy link
@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
Copy link
Contributor

jakevdp commented Aug 28, 2014

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

@isms
Copy link
Contributor Author

isms commented Aug 28, 2014

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

@justinmayer
Copy link
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)

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
Copy link
Contributor Author

isms commented Aug 28, 2014

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

@justinmayer
Copy link
Member

justinmayer commented Aug 28, 2014

Many thanks, Isaac.

justinmayer added a commit that referenced this pull request Aug 28, 2014
[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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.