Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions lib/ex_doc/formatter/html/templates/css/elixir.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
/*

github.com style (c) Vasily Polovnyov <vast@whiteants.net>

Source: https://github.com/isagalaev/highlight.js/blob/master/src/styles/github.css

*/

.hljs {
display: block;
overflow-x: auto;
color: #333;
padding: 0.5em;
border: #ffe0bb dotted 1px;
background: #fffde8;
display: block;
color: #333;
background: #f8f8f8;
-webkit-text-size-adjust: none;
}

.hljs-comment,
.diff .hljs-header,
.hljs-javadoc {
.diff .hljs-header {
color: #998;
font-style: italic;
}
Expand All @@ -38,8 +40,7 @@ github.com style (c) Vasily Polovnyov <vast@whiteants.net>

.hljs-string,
.hljs-tag .hljs-value,
.hljs-phpdoc,
.hljs-dartdoc,
.hljs-doctag,
.tex .hljs-formula {
color: #d14;
}
Expand All @@ -60,21 +61,22 @@ github.com style (c) Vasily Polovnyov <vast@whiteants.net>
.hljs-type,
.vhdl .hljs-literal,
.tex .hljs-command {
color: #445588;
color: #458;
font-weight: bold;
}

.hljs-tag,
.hljs-tag .hljs-title,
.hljs-rules .hljs-property,
.hljs-rule .hljs-property,
.django .hljs-tag .hljs-keyword {
color: #000080;
font-weight: normal;
}

.hljs-attribute,
.hljs-variable,
.lisp .hljs-body {
.lisp .hljs-body,
.hljs-name {
color: #008080;
}

Expand Down
6 changes: 6 additions & 0 deletions lib/ex_doc/formatter/html/templates/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,9 @@ span.detail_type {
a.detail_link {
padding-left: 0.3em;
}

/* CUSTOMIZATION FOR elixir.css */
.hljs {
background: #fffde8;
border: #ffe0bb dotted 1px;
}
23 changes: 17 additions & 6 deletions lib/ex_doc/formatter/html/templates/js/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
function fixOutsideWorldLinks() {
$('a').each(function() {
if (window.location.host != this.host) this.target = '_parent';
});
}
;$(function () {
// Fix outside world links
function fixOutsideWorldLinks() {
$('a').each(function() {
if (window.location.host != this.host) this.target = '_parent';
});
}

$(fixOutsideWorldLinks);
fixOutsideWorldLinks();

// Setup Highlight.js
hljs.configure({
tabReplace: ' ', // 4 spaces
languages: [] // disable auto-detect
});

hljs.initHighlighting();
});
9 changes: 5 additions & 4 deletions lib/ex_doc/formatter/html/templates/js/highlight.pack.js

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions lib/ex_doc/formatter/html/templates/module_template.eex
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<head>
<title><%= module.id %></title>
<meta charset="utf-8" />
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/elixir.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<section id="content">
Expand Down Expand Up @@ -88,11 +88,9 @@

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery.js"><\/script>')</script>
<script src="js/app.js"></script>
<script src="js/highlight.pack.js"></script>
<script src="js/app.js"></script>
<script>
hljs.initHighlightingOnLoad();
hljs.configure({languages: []}); //disable autodetect
if (window.top.frames.main) { document.body.className = 'frames'; }
</script>
</body>
Expand Down