Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Open WIN Community
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-science
community
Open WIN Community
Commits
1b0a313c
Unverified
Commit
1b0a313c
authored
4 years ago
by
Patrick Marsceill
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make examples more clear
parent
c587c0b2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/ui-components/line-nos.md
+10
-18
10 additions, 18 deletions
docs/ui-components/line-nos.md
with
10 additions
and
18 deletions
docs/ui-components/line-nos.md
+
10
−
18
View file @
1b0a313c
...
...
@@ -76,10 +76,10 @@ Dmitry Hrabrov at
## Examples
```
Some unknown code in fences
```
✅ Using code fences + workaround:
{% highlight default %}
{% raw %}{% capture code_fence %}
```
js
// Javascript code with syntax highlighting in fences
var
fun
=
function
lang
(
l
)
{
...
...
@@ -87,21 +87,13 @@ var fun = function lang(l) {
return
true
;
}
```
```
ruby
# Ruby code with syntax highlighting in fences
GitHubPages
::
Dependencies
.
gems
.
each
do
|
gem
,
version
|
s
.
add_dependency
(
gem
,
"=
#{
version
}
"
)
end
```
{% highlight ruby %}
# Ruby code with syntax highlighting using Liquid
GitHubPages::Dependencies.gems.each do |gem, version|
s.add_dependency(gem, "= #{version}")
end
{% endcapture %}
{% assign code_fence = code_fence | markdownify %}
{% include fix_linenos.html code=code_fence %}{% endraw %}
{% endhighlight %}
✅ Using liquid highlighting + workaround:
{% capture code %}
{% highlight ruby linenos %}
# Ruby code with syntax highlighting and fixed line numbers using Liquid
...
...
@@ -113,8 +105,8 @@ end
{% include fix_linenos.html code=code %}
{% assign code = nil %}
With the default configuration options, the following example illustrates
the incorrect formatting arising from the incompatibility of HTML compression
❌
With the default configuration options, the following example illustrates
the
**
incorrect
**
formatting arising from the incompatibility of HTML compression
and the non-conforming HTML produced by Jekyll for line numbers:
{% highlight ruby linenos %}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment