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

Render selection feature #26

Closed
mojavelinux opened this issue Feb 4, 2014 · 8 comments
Closed

Render selection feature #26

mojavelinux opened this issue Feb 4, 2014 · 8 comments

Comments

@mojavelinux
Copy link
Member

When viewing a web page, I'd like to be able to select a region of text and have Asciidoctor.js render it in a new tab or window. With this capability, I could pick out a reply on a mailinglist thread that was written in the AsciiDoc syntax and view the content in all its glory without having to go through the exercise of saving it to a file, etc.

@ggrossetie
Copy link
Member

I love the idea!
Some dirty hack had to be done to get the thing working... but overall I'm quite happy with this feature 😄

Let me know if this is good for you.

@mojavelinux
Copy link
Member Author

Wow! That's more than I could have dreamed it would be. So cool! I can see myself wearing holes into that context menu item!

I only noticed one thing missing. It seems like highlight.js doesn't get loaded in this scenario. Would you be able to enable that?

@ggrossetie
Copy link
Member

Should be better with this commit

@mojavelinux
Copy link
Member Author

Awesome! I'll try it out!

@mojavelinux
Copy link
Member Author

Works great!

I sent a pull request to update highlight.js to include support for additional languages (such as AsciiDoc) and to switch to the default highlight.js theme, which I think looks a bit better w/ the Asciidoctor theme.

Down the road, we probably want to make the highlight.js theme configurable.

@mojavelinux
Copy link
Member Author

Also, highlight.js has this annoying feature that it will try to detect the closest next language if the language specified doesn't match one it knows about. This almost always leads to incorrect syntax highlighting. Better just to not highlight in this case.

@ggrossetie
Copy link
Member

@mojavelinux Can we close this issue ?

@mojavelinux
Copy link
Member Author

Indeed! It works great!

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

No branches or pull requests

2 participants