actiontext-syntax-highlighter 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/app/frontend/action_text_syntax_highlighter/css/highlighted_code_block.css +1 -0
- data/app/views/action_text_syntax_highlighter/highlighted_code_blocks/_highlighted_code_block.html.erb +2 -1
- data/lib/action_text_syntax_highlighter/engine.rb +1 -0
- data/lib/action_text_syntax_highlighter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26c88ebae2b86c9406ef5eedf6f5a033dc5f04730c0551b71d7b96efd7302871
|
4
|
+
data.tar.gz: bad6988fa90441571b0695da9ccce1e4d82a814e354cdbb833a4a56ac62abc57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de45feb3f4f9474255e1cb180d0ab032a071d9a15efc343f5ac21061b7423644de2767cd92b2e90cb53b2693a734d25741b62ee19365811125e18d98d717f2ca
|
7
|
+
data.tar.gz: 62375406c87222ce9fa398d6d53cb1adf9ed52b1e32da0e2a019e499377e7d76f6d43a602d6b521f1b053d059de1c5195fcb5a3d640c3ac5c2d2ba06fe77d766
|
data/README.md
CHANGED
@@ -1,10 +1,13 @@
|
|
1
|
+
<img width="861" alt="screenshot" src="https://user-images.githubusercontent.com/4924039/120343433-9f91bc80-c2f0-11eb-876b-bcb0a977a020.png">
|
2
|
+
|
3
|
+
|
1
4
|
# Description
|
2
5
|
|
3
6
|
`actiontext-syntax-highlighter` is an extension for `rails/actiontext` to allow the user to add language specified code blocks that are then highlighted on the server using [Rouge](http://github.com/rouge-ruby/rouge).
|
4
7
|
|
5
8
|
[**Check out the demo app to see how it works!**](https://actiontext-syntax-highlighter.herokuapp.com).
|
6
9
|
|
7
|
-
> Note: The experience is a bit flaky, especially on Safari. If you have any suggestions for how to improve it, please file an issue; or even better, open a Pull Request!
|
10
|
+
> Note: The experience is a bit flaky, especially on Safari. If you have any suggestions for how to improve it, please file an issue; or even better, open a Pull Request! I recommend using Firefox to test this out as that's where it works best!
|
8
11
|
|
9
12
|
## How it works
|
10
13
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
<% @highlighted_code_block_theme ||= ActionTextSyntaxHighlighter.default_theme %>
|
2
2
|
<%= tag.pre highlighted_code_block.highlighted_content, data: {
|
3
|
-
theme: @highlighted_code_block_theme
|
3
|
+
theme: @highlighted_code_block_theme,
|
4
|
+
language: highlighted_code_block.language.downcase.presence
|
4
5
|
} %>
|
@@ -11,6 +11,7 @@ module ActionTextSyntaxHighlighter
|
|
11
11
|
initializer "action_text_syntax_highlighter.allow_theme_attribute" do
|
12
12
|
Rails.application.config.to_prepare do
|
13
13
|
ActionText::ContentHelper.allowed_attributes << "data-theme"
|
14
|
+
ActionText::ContentHelper.allowed_attributes << "data-language"
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actiontext-syntax-highlighter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ayush Newatia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|