Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
content
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Monitor
Service Desk
Analyze
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
ok1kvk.cz
content
Commits
8bb66e8c
Verified
Commit
8bb66e8c
authored
9 years ago
by
Isabella Skořepová
Browse files
Options
Downloads
Patches
Plain Diff
Better headings inside articles
parent
00472f7d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sitegin/transformer-markdown.js
+14
-0
14 additions, 0 deletions
sitegin/transformer-markdown.js
sitegin/transformer-urlizetags.js
+10
-10
10 additions, 10 deletions
sitegin/transformer-urlizetags.js
with
24 additions
and
10 deletions
sitegin/transformer-markdown.js
+
14
−
0
View file @
8bb66e8c
var
marked
=
require
(
'
marked
'
);
var
renderer
=
new
marked
.
Renderer
();
var
toURL
=
require
(
'
./transformer-urlizetags.js
'
).
toURL
;
renderer
.
image
=
function
(
href
,
title
,
text
)
{
if
(
process
.
argv
[
3
]
!==
"
final
"
)
{
...
...
@@ -15,6 +16,19 @@ renderer.image = function(href, title, text) {
return
out
;
};
renderer
.
heading
=
function
(
text
,
level
,
raw
)
{
return
'
<h
'
+
(
level
+
2
)
+
'
id="
'
+
this
.
options
.
headerPrefix
+
toURL
(
raw
)
+
'
">
'
+
text
+
'
</h
'
+
(
level
+
2
)
+
'
>
\n
'
;
}
marked
.
setOptions
({
renderer
:
renderer
,
gfm
:
true
,
...
...
This diff is collapsed.
Click to expand it.
sitegin/transformer-urlizetags.js
+
10
−
10
View file @
8bb66e8c
...
...
@@ -4,19 +4,16 @@ String.prototype.latinise=function(){return this.replace(/[^A-Za-z0-9\[\] ]/g,fu
String
.
prototype
.
latinize
=
String
.
prototype
.
latinise
;
String
.
prototype
.
isLatin
=
function
(){
return
this
==
this
.
latinise
()}
module
.
exports
=
function
()
{
var
toURL
=
function
(
tag
)
{
if
(
tag
==
undefined
)
return
undefined
;
return
tag
.
toLowerCase
().
latinise
().
replace
(
/ /g
,
"
-
"
);
}
var
f
=
function
()
{
var
tr
=
this
;
tr
.
fancyname
=
"
transformer urlizetags
"
;
tr
.
toURL
=
function
(
tag
)
{
if
(
tag
==
undefined
)
return
undefined
;
return
tag
.
toLowerCase
().
latinise
().
replace
(
/ /g
,
"
-
"
);
}
tr
.
toURL
=
toURL
;
tr
.
forEachPage
=
function
(
article
,
cb
)
{
// FIXME remove this
if
(
article
.
metadata
.
tags
===
undefined
)
article
.
metadata
.
tags
=
article
.
metadata
.
categories
;
article
.
metadata
.
categories
=
undefined
;
// END
var
ntags
=
[];
if
(
article
.
metadata
.
tags
)
{
article
.
metadata
.
tags
.
forEach
(
function
(
tag
)
{
...
...
@@ -31,3 +28,6 @@ module.exports = function() {
}
}
f
.
toURL
=
toURL
;
module
.
exports
=
f
;
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