File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
javascript/controllers/syntax-highlight
views/settings/syntax_highlights Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 1
1
import { Controller } from '@hotwired/stimulus' ;
2
- import debug from '../../utils/debug' ;
3
-
4
- const console = debug ( 'app:javascript:controllers:syntax-highlight:preview' ) ;
5
2
6
3
export default class extends Controller {
7
4
static values = {
8
- name : String ,
5
+ name : String , // The name of the syntax highlight css file to enable
9
6
} ;
10
7
11
8
connect ( ) {
12
- console . log ( 'connect' , this . nameValue ) ;
13
9
const name = this . nameValue ;
14
10
document
15
11
. querySelectorAll ( 'link[rel="stylesheet"][data-syntax-highlight]' )
Original file line number Diff line number Diff line change @@ -66,6 +66,8 @@ def each(&)
66
66
CSS
67
67
end
68
68
end
69
+ h3 { %(JavaScript) }
70
+ render CodeBlock ::AppFile . new ( "app/javascript/controllers/syntax-highlight/preview.js" , language : "js" )
69
71
h3 { %(HTML with ERB) }
70
72
render CodeBlock ::AppFile . new ( "app/views/layouts/application.html.erb" , language : "erb" )
71
73
end
You can’t perform that action at this time.
0 commit comments