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

Add a `data-lang` attribute to code blocks #1066

Merged
merged 1 commit into from May 12, 2013

Conversation

Projects
None yet
4 participants
@Rowno
Contributor

Rowno commented May 9, 2013

Allows a language label to be added to code blocks using a CSS pseudo-element. It would also make it easier to retrieve the language using Javascript, rather than having to parse the classes.

Example:

code:before {
    content: attr(data-lang);
}
@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr May 9, 2013

Member

Can you please fix the tests to include the new data attribute?

Also, data-lang vs data-language? What do you think?

Member

parkr commented May 9, 2013

Can you please fix the tests to include the new data attribute?

Also, data-lang vs data-language? What do you think?

@mattr-

This comment has been minimized.

Show comment
Hide comment
@mattr-

mattr- May 9, 2013

Member

lang is used in other places, such as <html lang='en'>, so I think I prefer data-lang for consistency with that.

Member

mattr- commented May 9, 2013

lang is used in other places, such as <html lang='en'>, so I think I prefer data-lang for consistency with that.

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr May 9, 2013

Member

👍 to consistency with lang.

Member

parkr commented May 9, 2013

👍 to consistency with lang.

@Rowno

This comment has been minimized.

Show comment
Hide comment
@Rowno

Rowno May 10, 2013

Contributor

Fixed. 😀

Contributor

Rowno commented May 10, 2013

Fixed. 😀

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr May 11, 2013

Member

@benbalter Will bring this in tomorrow as well, which might break your tests again. Just a head's up :)

Member

parkr commented May 11, 2013

@benbalter Will bring this in tomorrow as well, which might break your tests again. Just a head's up :)

parkr added a commit that referenced this pull request May 12, 2013

Merge pull request #1066 from Rowno/data-language
Add a `data-lang` attribute to code blocks

@parkr parkr merged commit 179a746 into jekyll:master May 12, 2013

1 check passed

default The Travis CI build passed
Details

parkr added a commit that referenced this pull request May 12, 2013

@Rowno Rowno deleted the Rowno:data-language branch May 12, 2013

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

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