Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
1f310771
Commit
1f310771
authored
9 years ago
by
Corbzilla
Browse files
Options
Download
Email Patches
Plain Diff
removes holder.js references from example docs
parent
1a6aad45
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/_plugins/highlight_alt.rb
+5
-0
docs/_plugins/highlight_alt.rb
with
5 additions
and
0 deletions
+5
-0
docs/_plugins/highlight_alt.rb
+
5
-
0
View file @
1f310771
...
@@ -57,11 +57,16 @@ eos
...
@@ -57,11 +57,16 @@ eos
def
example
(
output
)
def
example
(
output
)
"<div class=
\"
bd-example
\"
data-example-id=
\"
#{
@options
[
:id
]
}
\"
>
\n
#{
output
}
\n
</div>"
"<div class=
\"
bd-example
\"
data-example-id=
\"
#{
@options
[
:id
]
}
\"
>
\n
#{
output
}
\n
</div>"
end
end
def
remove_holderjs
(
code
)
code
=
code
.
gsub
(
/"holder.js.+?"/
,
'"..."'
)
end
def
render_rouge
(
code
)
def
render_rouge
(
code
)
require
'rouge'
require
'rouge'
formatter
=
Rouge
::
Formatters
::
HTML
.
new
(
line_numbers:
@options
[
:linenos
],
wrap:
false
)
formatter
=
Rouge
::
Formatters
::
HTML
.
new
(
line_numbers:
@options
[
:linenos
],
wrap:
false
)
lexer
=
Rouge
::
Lexer
.
find_fancy
(
@lang
,
code
)
||
Rouge
::
Lexers
::
PlainText
lexer
=
Rouge
::
Lexer
.
find_fancy
(
@lang
,
code
)
||
Rouge
::
Lexers
::
PlainText
code
=
remove_holderjs
(
code
)
code
=
formatter
.
format
(
lexer
.
lex
(
code
))
code
=
formatter
.
format
(
lexer
.
lex
(
code
))
"<div class=
\"
highlight
\"
><pre>
#{
code
}
</pre></div>"
"<div class=
\"
highlight
\"
><pre>
#{
code
}
</pre></div>"
end
end
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets