Skip to content

Commit 75e2d00

Browse files
authored
Merge pull request #46 from docsforadobe/add/pdf-print
Adds 'print' workflow for offline use
2 parents d027735 + 57789aa commit 75e2d00

File tree

5 files changed

+98
-0
lines changed

5 files changed

+98
-0
lines changed

mkdocs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ repo_url: https://github.com/docsforadobe/after-effects-scripting-guide/
55
repo_name: "after-effects-scripting-guide"
66
extra:
77
homepage: https://docsforadobe.dev
8+
copyright: All content is copyright Adobe Systems Incorporated.
89

910
# Customize navigation
1011
nav:
@@ -127,3 +128,9 @@ plugins:
127128
- git-revision-date-localized
128129
- search:
129130
separator: '[\s\-,\.:!=\[\]()"/]+'
131+
- print-site:
132+
add_cover_page: true
133+
add_print_site_banner: true
134+
cover_page_template: "overrides/templates/print_site_cover_page.tpl"
135+
print_page_title: "Offline Docs"
136+
print_site_banner_template: "overrides/templates/print_site_banner.tpl"

overrides/partials/copyright.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<div class="md-copyright">
2+
{% if config.copyright %}
3+
<div class="md-copyright__highlight">
4+
{{ config.copyright }}
5+
</div>
6+
{% endif %}
7+
{% if not config.extra.generator == false %}
8+
Made with
9+
<a
10+
href="https://squidfunk.github.io/mkdocs-material/"
11+
target="_blank" rel="noopener"
12+
>
13+
Material for MkDocs
14+
</a>
15+
{% endif %}
16+
</div>
17+
18+
<!-- Print button -->
19+
<div class="md-copyright">
20+
{% if page.url_to_print_page %}
21+
<a href="{{ page.url_to_print_page }}" title="Print Site" class="md-content__button md-icon">
22+
{% include ".icons/material/printer.svg" %}
23+
</a>
24+
{% endif %}
25+
</div>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<style>
2+
#print-site-banner {
3+
border: 0px;
4+
}
5+
</style>
6+
7+
<div class="admonition info">
8+
9+
<p class="admonition-title">Note – This box will disappear during export!</p>
10+
11+
<p>This page has combined all site pages into one, and can be exported using native browser features.</p>
12+
13+
<p>You can export to PDF using <b>File > Print > Save as PDF</b>, or save as a single-page HTML file via <b>File > Save As</b>.</p>
14+
15+
<div class="admonition warning">
16+
<p class="admonition-title">Warning</p>
17+
18+
<p>Note that users may have issues <a href="https://github.com/timvink/mkdocs-print-site-plugin/issues/56">printing to PDF on Firefox</a>.</p>
19+
</div>
20+
21+
</div>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<div>
2+
3+
{% if config.site_name %}
4+
<h1>{{ config.site_name }}</h1>
5+
{% endif %}
6+
7+
{% if config.extra.homepage %}
8+
by <h3><a href="{{ config.extra.homepage }}">{{ config.extra.homepage }}</a></h3>
9+
{% endif %}
10+
11+
</div>
12+
13+
14+
<table>
15+
16+
{% if config.site_description %}
17+
<tr>
18+
<td>Description</td>
19+
<td>{{ config.site_description }}</td>
20+
</tr>
21+
{% endif %}
22+
23+
{% if config.site_url %}
24+
<tr>
25+
<td>Hosted at</td>
26+
<td>{{ config.site_url }}</td>
27+
</tr>
28+
{% endif %}
29+
30+
{% if config.repo_url %}
31+
<tr>
32+
<td>Repository</td>
33+
<td><a href="{{ config.repo_url }}">{{ config.repo_url }}</a></td>
34+
</tr>
35+
{% endif %}
36+
37+
{% if config.copyright %}
38+
<tr>
39+
<td>Copyright</td>
40+
<td>{{ config.copyright }}</td>
41+
</tr>
42+
{% endif %}
43+
44+
</table>

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
mkdocs
22
mkdocs-material
33
mkdocs-git-revision-date-localized-plugin
4+
mkdocs-print-site-plugin

0 commit comments

Comments
 (0)