PDF improvements, including syntax highlighting

This commit is contained in:
mDuo13
2016-03-18 19:13:10 -07:00
parent dddaad56b1
commit 1296f0739d
5 changed files with 33 additions and 6 deletions

14
assets/css/pdf.css Normal file → Executable file
View File

@@ -1,4 +1,16 @@
a:after {
a[href^="#"]:after {
display: none !important;
}
.main code {
color: black;
}
.main .hljs {
background: transparent;
}
.main pre {
background: transparent;
box-decoration-break: slice;
}

2
assets/css/ripple.css Normal file → Executable file
View File

@@ -183,12 +183,14 @@ th {
padding: 0;
}
@media print {
/*
* {
text-shadow: none !important;
color: #000 !important;
background: transparent !important;
box-shadow: none !important;
}
*/
a,
a:visited {
text-decoration: underline;

View File

@@ -35,6 +35,10 @@ targets:
- standardize_header_ids
- buttonize
- name: printable
filters:
- standardize_header_ids
pages:
# Intro pages is not directly replicated on ripple.com at this time
- name: Overview

View File

@@ -437,7 +437,7 @@ def make_pdf(outfile, target=None, bypass_errors=False):
os.makedirs(config["out_path"])
# Start preparing the prince command
args = [config["prince_executable"], '-o', outfile]
args = [config["prince_executable"], '--javascript', '-o', outfile]
# Each HTML output file in the target is another arg to prince
pages = get_pages(target)
args += [os.path.join(temp_files_path, p["html"]) for p in pages]

View File

@@ -8,21 +8,31 @@
<title>{{ currentpage.name }} - Ripple Developer Portal</title>
<!-- favicon -->
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<!-- jQuery -->
<script src="assets/vendor/jquery-1.11.1.min.js"></script>
<!-- Custom Stylesheets. ripple.css includes bootstrap, font stuff -->
<link href="assets/css/ripple.css" rel="stylesheet" />
<link href="assets/css/devportal.css" rel="stylesheet" />
<link href="assets/css/pdf.css" rel="stylesheet" />
<!-- Bootstrap JS -->
<script src="assets/vendor/bootstrap.min.js"></script>
<!-- syntax highlighting -->
<link rel="stylesheet" href="assets/vendor/docco.min.css">
<script src="assets/vendor/highlight.min.js"></script>
<script>
$(document).ready(function() {
hljs.initHighlighting();
});
</script>
{% block head %}
{% endblock %}
</head>
@@ -37,4 +47,3 @@
</body>
</html>