mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
fix-pdf-gen: Replace html2PDF with browser-based pdf generation
turn off transitions
This commit is contained in:
@@ -11,40 +11,27 @@
|
|||||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||||
<%= (distro_key == "openshift-webscale") ? '<meta name="robots" content="noindex,nofollow">' : '' %>
|
<%= (distro_key == "openshift-webscale") ? '<meta name="robots" content="noindex,nofollow">' : '' %>
|
||||||
<title><%= [topic_title, subgroup_title].compact.join(' - ') %> | <%= group_title %> | <%= distro %> <%= version %></title>
|
<title><%= [topic_title, subgroup_title].compact.join(' - ') %> | <%= group_title %> | <%= distro %> <%= version %></title>
|
||||||
<link href="https://assets.openshift.net/content/subdomain.css" rel="stylesheet" type="text/css">
|
<link href="https://assets.openshift.net/content/subdomain.css" rel="stylesheet" type="text/css"/>
|
||||||
<link href="https://docs.openshift.com/container-platform/4.1/_stylesheets/search.css" rel="stylesheet" />
|
<link href="https://docs.openshift.com/container-platform/4.1/_stylesheets/search.css" rel="stylesheet" media="screen"/>
|
||||||
<link href="https://docs.openshift.com/container-platform/4.1/_stylesheets/autumn.css" rel="stylesheet" />
|
<link href="https://docs.openshift.com/container-platform/4.1/_stylesheets/autumn.css" rel="stylesheet" media="screen"/>
|
||||||
<link href="https://assets.openshift.net/content/subdomain/touch-icon-precomposed.png" rel="apple-touch-icon-precomposed" type="image/png">
|
<link href="https://assets.openshift.net/content/subdomain/touch-icon-precomposed.png" rel="apple-touch-icon-precomposed" type="image/png"/>
|
||||||
<link href="https://assets.openshift.net/content/subdomain/favicon32x32.png" rel="shortcut icon" type="text/css">
|
<link href="https://assets.openshift.net/content/subdomain/favicon32x32.png" rel="shortcut icon" type="text/css"/>
|
||||||
<link href="https://assets.openshift.net/content/osh-nav-footer.css" rel="stylesheet" type="text/css" media="screen, print" />
|
<link href="https://assets.openshift.net/content/osh-nav-footer.css" rel="stylesheet" type="text/css" media="screen"/>
|
||||||
<link href="https://docs.openshift.com/container-platform/4.1/_stylesheets/docs.css" rel="stylesheet" />
|
<link href="https://docs.openshift.com/container-platform/4.1/_stylesheets/docs.css" rel="stylesheet" media="screen"/>
|
||||||
|
<link href="https://docs.openshift.com/container-platform/4.1/_stylesheets/print.css" rel="stylesheet" type="text/css" media="print"/>
|
||||||
<!--[if IE]><link rel="shortcut icon" href="https://assets.openshift.net/content/subdomain/favicon.ico"><![endif]-->
|
<!--[if IE]><link rel="shortcut icon" href="https://assets.openshift.net/content/subdomain/favicon.ico"><![endif]-->
|
||||||
<!-- or, set /favicon.ico for IE10 win -->
|
<!-- or, set /favicon.ico for IE10 win -->
|
||||||
<meta content="OpenShift" name="application-name">
|
<meta content="OpenShift" name="application-name">
|
||||||
<meta content="#000000" name="msapplication-TileColor">
|
<meta content="#000000" name="msapplication-TileColor">
|
||||||
<meta content="https://assets.openshift.net/content/subdomain/touch-icon-precomposed.png" name="msapplication-TileImage">
|
<meta content="https://assets.openshift.net/content/subdomain/touch-icon-precomposed.png" name="msapplication-TileImage">
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.9.3/html2pdf.bundle.min.js"></script>
|
<!-- Adobe DTM -->
|
||||||
|
<script src="//www.redhat.com/dtm.js" type="text/javascript"></script>
|
||||||
|
<!-- End Adobe DTM -->
|
||||||
|
|
||||||
<script id="trustarc" src="https://static.redhat.com/libs/redhat/marketing/latest/trustarc/trustarc.js"></script>
|
<script id="trustarc" src="https://static.redhat.com/libs/redhat/marketing/latest/trustarc/trustarc.js"></script>
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons+Outlined"
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons+Outlined"
|
||||||
rel="stylesheet">
|
rel="stylesheet">
|
||||||
<script>
|
|
||||||
|
|
||||||
function getPDF() {
|
|
||||||
var element = document.getElementsByClassName('main');
|
|
||||||
<%
|
|
||||||
filepath = repo_path[0...-5]
|
|
||||||
%>
|
|
||||||
var opt = {
|
|
||||||
margin: 10,
|
|
||||||
filename: '<%= "#{filepath}.pdf" %>',
|
|
||||||
html2canvas: { windowWidth: 650 },
|
|
||||||
image: { type: 'jpeg', quality: 0.98 }
|
|
||||||
};
|
|
||||||
html2pdf().set(opt).from(element[0]).save();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -131,7 +118,7 @@
|
|||||||
<a href="https://github.com/openshift/openshift-docs/issues/new?title=<%= (distro_key == "openshift-enterprise") ? "[enterprise-#{version}] Issue in file #{repo_path}" : ((distro_key=="openshift-dedicated" ) ? "[dedicated] Issue in file #{repo_path}" : "[online] Issue in file #{repo_path}" ) %>">
|
<a href="https://github.com/openshift/openshift-docs/issues/new?title=<%= (distro_key == "openshift-enterprise") ? "[enterprise-#{version}] Issue in file #{repo_path}" : ((distro_key=="openshift-dedicated" ) ? "[dedicated] Issue in file #{repo_path}" : "[online] Issue in file #{repo_path}" ) %>">
|
||||||
<span class="material-icons-outlined" title="Open an issue">bug_report</span>
|
<span class="material-icons-outlined" title="Open an issue">bug_report</span>
|
||||||
</a>
|
</a>
|
||||||
<a href="javascript: void(0);" onclick="getPDF();"><span class="material-icons-outlined" title="Download PDF (may take a while for large pages)">picture_as_pdf</span></a>
|
<a href="javascript: void(0);" onclick="window.print()"><span class="material-icons-outlined" title="Print page (Save as PDF)">picture_as_pdf</span></a>
|
||||||
<% if (version == "4.5") %>
|
<% if (version == "4.5") %>
|
||||||
/
|
/
|
||||||
<select onchange="selectLang(this);">
|
<select onchange="selectLang(this);">
|
||||||
@@ -169,6 +156,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="print-logo" style="display:none;">
|
||||||
|
<img src="https://www.redhat.com/cms/managed-files/Logo-Red_Hat-OpenShift-A-Standard-RGB_0_0.svg" alt="print logo"/>
|
||||||
|
</div>
|
||||||
<div class="col-xs-12 col-sm-9 col-md-9 main">
|
<div class="col-xs-12 col-sm-9 col-md-9 main">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1>
|
<h1>
|
||||||
@@ -494,5 +484,4 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user