~stick/print-xkcd

1f1bfe369ab1659935edb2a1a451de83c24f1aa7 — Stick 1 year, 26 days ago
first try
8 files changed, 1019 insertions(+), 0 deletions(-)

A .gitignore
A CONDUCT.md
A LICENSE
A README.md
A html/favicon.ico
A html/index.html
A html/logo.svg
A logo.png
A  => .gitignore +450 -0
@@ 1,450 @@

# Created by https://www.gitignore.io/api/vim,venv,emacs,python,eclipse,archives,executable,sublimetext,jetbrains+all,visualstudiocode
# Edit at https://www.gitignore.io/?templates=vim,venv,emacs,python,eclipse,archives,executable,sublimetext,jetbrains+all,visualstudiocode

### Archives ###
# It's better to unpack these files and commit the raw source because
# git has its own built in compression methods.
*.7z
*.jar
*.rar
*.zip
*.gz
*.tgz
*.bzip
*.bz2
*.xz
*.lzma
*.cab

# Packing-only formats
*.iso
*.tar

# Package management formats
*.dmg
*.xpi
*.gem
*.egg
*.deb
*.rpm
*.msi
*.msm
*.msp

### Eclipse ###
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# PyDev specific (Python IDE for Eclipse)
*.pydevproject

# CDT-specific (C/C++ Development Tooling)
.cproject

# CDT- autotools
.autotools

# Java annotation processor (APT)
.factorypath

# PDT-specific (PHP Development Tools)
.buildpath

# sbteclipse plugin
.target

# Tern plugin
.tern-project

# TeXlipse plugin
.texlipse

# STS (Spring Tool Suite)
.springBeans

# Code Recommenders
.recommenders/

# Annotation Processing
.apt_generated/

# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet

### Eclipse Patch ###
# Eclipse Core
.project

# JDT-specific (Eclipse Java Development Tools)
.classpath

# Annotation Processing
.apt_generated

.sts4-cache/

### Emacs ###
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*

# Org-mode
.org-id-locations
*_archive

# flymake-mode
*_flymake.*

# eshell files
/eshell/history
/eshell/lastdir

# elpa packages
/elpa/

# reftex files
*.rel

# AUCTeX auto folder
/auto/

# cask packages
.cask/
dist/

# Flycheck
flycheck_*.el

# server auth directory
/server/

# projectiles files
.projectile

# directory configuration
.dir-locals.el

# network security
/network-security.data


### Executable ###
*.app
*.bat
*.cgi
*.com
*.exe
*.gadget
*.pif
*.vb
*.wsf

### JetBrains+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn.  Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### JetBrains+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360

.idea/

# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023

*.iml
modules.xml
.idea/misc.xml
*.ipr

# Sonarlint plugin
.idea/sonarlint

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
#   However, in case of collaboration, if having platform-specific dependencies or dependencies
#   having no cross-platform support, pipenv may install dependencies that don't work, or not
#   install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

### SublimeText ###
# Cache files for Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache

# Workspace files are user-specific
*.sublime-workspace

# Project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using Sublime Text
# *.sublime-project

# SFTP configuration file
sftp-config.json

# Package control specific files
Package Control.last-run
Package Control.ca-list
Package Control.ca-bundle
Package Control.system-ca-bundle
Package Control.cache/
Package Control.ca-certs/
Package Control.merged-ca-bundle
Package Control.user-ca-bundle
oscrypto-ca-bundle.crt
bh_unicode_properties.cache

# Sublime-github package stores a github token in this file
# https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings

### venv ###
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
pip-selfcheck.json

### Vim ###
# Swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]

# Session
Session.vim
Sessionx.vim

# Temporary
.netrwhist
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

### VisualStudioCode Patch ###
# Ignore all local history of files
.history

# End of https://www.gitignore.io/api/vim,venv,emacs,python,eclipse,archives,executable,sublimetext,jetbrains+all,visualstudiocode

A  => CONDUCT.md +10 -0
@@ 1,10 @@
This document provides community guidelines for a safe, respectful, productive,
and collaborative place for any person who is willing to contribute to this project or its
community. It applies to all "collaborative space", which is defined as
community communications channels (such as mailing lists, submitted patches,
commit comments, etc.).

 * Participants will be tolerant of opposing views.
 * Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
 * When interpreting the words and actions of others, participants should always assume good intentions.
 * Behaviour which can be reasonably considered harassment will not be tolerated.

A  => LICENSE +373 -0
@@ 1,373 @@
Mozilla Public License Version 2.0
==================================

1. Definitions
--------------

1.1. "Contributor"
    means each individual or legal entity that creates, contributes to
    the creation of, or owns Covered Software.

1.2. "Contributor Version"
    means the combination of the Contributions of others (if any) used
    by a Contributor and that particular Contributor's Contribution.

1.3. "Contribution"
    means Covered Software of a particular Contributor.

1.4. "Covered Software"
    means Source Code Form to which the initial Contributor has attached
    the notice in Exhibit A, the Executable Form of such Source Code
    Form, and Modifications of such Source Code Form, in each case
    including portions thereof.

1.5. "Incompatible With Secondary Licenses"
    means

    (a) that the initial Contributor has attached the notice described
        in Exhibit B to the Covered Software; or

    (b) that the Covered Software was made available under the terms of
        version 1.1 or earlier of the License, but not also under the
        terms of a Secondary License.

1.6. "Executable Form"
    means any form of the work other than Source Code Form.

1.7. "Larger Work"
    means a work that combines Covered Software with other material, in 
    a separate file or files, that is not Covered Software.

1.8. "License"
    means this document.

1.9. "Licensable"
    means having the right to grant, to the maximum extent possible,
    whether at the time of the initial grant or subsequently, any and
    all of the rights conveyed by this License.

1.10. "Modifications"
    means any of the following:

    (a) any file in Source Code Form that results from an addition to,
        deletion from, or modification of the contents of Covered
        Software; or

    (b) any new file in Source Code Form that contains any Covered
        Software.

1.11. "Patent Claims" of a Contributor
    means any patent claim(s), including without limitation, method,
    process, and apparatus claims, in any patent Licensable by such
    Contributor that would be infringed, but for the grant of the
    License, by the making, using, selling, offering for sale, having
    made, import, or transfer of either its Contributions or its
    Contributor Version.

1.12. "Secondary License"
    means either the GNU General Public License, Version 2.0, the GNU
    Lesser General Public License, Version 2.1, the GNU Affero General
    Public License, Version 3.0, or any later versions of those
    licenses.

1.13. "Source Code Form"
    means the form of the work preferred for making modifications.

1.14. "You" (or "Your")
    means an individual or a legal entity exercising rights under this
    License. For legal entities, "You" includes any entity that
    controls, is controlled by, or is under common control with You. For
    purposes of this definition, "control" means (a) the power, direct
    or indirect, to cause the direction or management of such entity,
    whether by contract or otherwise, or (b) ownership of more than
    fifty percent (50%) of the outstanding shares or beneficial
    ownership of such entity.

2. License Grants and Conditions
--------------------------------

2.1. Grants

Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:

(a) under intellectual property rights (other than patent or trademark)
    Licensable by such Contributor to use, reproduce, make available,
    modify, display, perform, distribute, and otherwise exploit its
    Contributions, either on an unmodified basis, with Modifications, or
    as part of a Larger Work; and

(b) under Patent Claims of such Contributor to make, use, sell, offer
    for sale, have made, import, and otherwise transfer either its
    Contributions or its Contributor Version.

2.2. Effective Date

The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.

2.3. Limitations on Grant Scope

The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:

(a) for any code that a Contributor has removed from Covered Software;
    or

(b) for infringements caused by: (i) Your and any other third party's
    modifications of Covered Software, or (ii) the combination of its
    Contributions with other software (except as part of its Contributor
    Version); or

(c) under Patent Claims infringed by Covered Software in the absence of
    its Contributions.

This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).

2.4. Subsequent Licenses

No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).

2.5. Representation

Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.

2.6. Fair Use

This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.

2.7. Conditions

Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.

3. Responsibilities
-------------------

3.1. Distribution of Source Form

All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.

3.2. Distribution of Executable Form

If You distribute Covered Software in Executable Form then:

(a) such Covered Software must also be made available in Source Code
    Form, as described in Section 3.1, and You must inform recipients of
    the Executable Form how they can obtain a copy of such Source Code
    Form by reasonable means in a timely manner, at a charge no more
    than the cost of distribution to the recipient; and

(b) You may distribute such Executable Form under the terms of this
    License, or sublicense it under different terms, provided that the
    license for the Executable Form does not attempt to limit or alter
    the recipients' rights in the Source Code Form under this License.

3.3. Distribution of a Larger Work

You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).

3.4. Notices

You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.

3.5. Application of Additional Terms

You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.

4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------

If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.

5. Termination
--------------

5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.

5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.

5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.

************************************************************************
*                                                                      *
*  6. Disclaimer of Warranty                                           *
*  -------------------------                                           *
*                                                                      *
*  Covered Software is provided under this License on an "as is"       *
*  basis, without warranty of any kind, either expressed, implied, or  *
*  statutory, including, without limitation, warranties that the       *
*  Covered Software is free of defects, merchantable, fit for a        *
*  particular purpose or non-infringing. The entire risk as to the     *
*  quality and performance of the Covered Software is with You.        *
*  Should any Covered Software prove defective in any respect, You     *
*  (not any Contributor) assume the cost of any necessary servicing,   *
*  repair, or correction. This disclaimer of warranty constitutes an   *
*  essential part of this License. No use of any Covered Software is   *
*  authorized under this License except under this disclaimer.         *
*                                                                      *
************************************************************************

************************************************************************
*                                                                      *
*  7. Limitation of Liability                                          *
*  --------------------------                                          *
*                                                                      *
*  Under no circumstances and under no legal theory, whether tort      *
*  (including negligence), contract, or otherwise, shall any           *
*  Contributor, or anyone who distributes Covered Software as          *
*  permitted above, be liable to You for any direct, indirect,         *
*  special, incidental, or consequential damages of any character      *
*  including, without limitation, damages for lost profits, loss of    *
*  goodwill, work stoppage, computer failure or malfunction, or any    *
*  and all other commercial damages or losses, even if such party      *
*  shall have been informed of the possibility of such damages. This   *
*  limitation of liability shall not apply to liability for death or   *
*  personal injury resulting from such party's negligence to the       *
*  extent applicable law prohibits such limitation. Some               *
*  jurisdictions do not allow the exclusion or limitation of           *
*  incidental or consequential damages, so this exclusion and          *
*  limitation may not apply to You.                                    *
*                                                                      *
************************************************************************

8. Litigation
-------------

Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.

9. Miscellaneous
----------------

This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.

10. Versions of the License
---------------------------

10.1. New Versions

Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.

10.2. Effect of New Versions

You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.

10.3. Modified Versions

If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).

10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses

If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.

Exhibit A - Source Code Form License Notice
-------------------------------------------

  This Source Code Form is subject to the terms of the Mozilla Public
  License, v. 2.0. If a copy of the MPL was not distributed with this
  file, You can obtain one at http://mozilla.org/MPL/2.0/.

If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.

You may add additional accurate notices of copyright ownership.

Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------

  This Source Code Form is "Incompatible With Secondary Licenses", as
  defined by the Mozilla Public License, v. 2.0.

A  => README.md +40 -0
@@ 1,40 @@
# print-xkcd

[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)

> Print an [XKCD](https://xkcd.com) comic, nicely formatted

## Table of Contents

- [Background](#background)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)

## Background

I wanted to print [XKCD](https://xkcd.com) comics with the title text showing and a nice logo and link for the uninitiated in my work area.
[This thread](http://forums.xkcd.com/viewtopic.php?t=19803) was basically no help, since it points to [this post](http://forums.xkcd.com/viewtopic.php?p=207633#p207633), which links to a [GreaseMonkey script](https://www.mit.edu/~je18337/greasemonkey/xkcdprintable.user.js) that is no longer available, another [GreaseMonkey script](https://userscripts-mirror.org/scripts/show/87061) (possibly the same one?) that was last updated in 2012, and [Dennis Williamsons'](http://px.denniswilliamson.us/denniswilliamson/px/) printifier, which is down.
There's also a [Chrome Extension](https://chrome.google.com/webstore/detail/xkcd-alt-printer/hcgaaclbgbaglppajpcjhjpmpgmpglml), but Google knows too much already.

So I decided Something Must Be Done™ and I'm writing a website to do it.

## Usage

Eventually I'll put the website up somewhere.

## Contributing

> Contributors to this project adhere to the [Code of Conduct](CONDUCT.md).

I welcome [issues](https://gitlab.com/stick/print-xkcd/issues "Issues"), but I prefer [pull requests](https://gitlab.com/stick/print-xkcd/merge_requests "Pull requests")!
We follow the [trunk-based development](https://trunkbaseddevelopment.com/) model (where your fork is a "feature branch").
Contributions should [use git with discipline](https://drewdevault.com/2019/02/25/Using-git-with-discipline.html).

## LICENSE

Copyright © 2019 @stick.
Where not otherwise specified, this repository is licensed under the [Mozilla Public License 2.0](LICENSE).

Note that I am not in any way associated with [XKCD](https://xkcd.com) and I do not own or claim any rights in their content.
[XKCD](https://xkcd.com) comics are licensed under [Creative Commons Attribution-NonCommercial 2.5 License](http://creativecommons.org/licenses/by-nc/2.5/).

A  => html/favicon.ico +0 -0

A  => html/index.html +93 -0
@@ 1,93 @@
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="logo.svg"/>
    <script>
      function updateComic() {
        const comicNum = document.getElementById('comicNum').value;
        fetch('https://hackwhacktackbang.fyi/xkcd-proxy/' + comicNum).then(response => {
          return response.text()
        }).then(text => {
          const xkcd = new DOMParser().parseFromString(text, 'text/html');

          // Get the page title
          const ctitle = xkcd.getElementById('ctitle').innerHTML;
          document.title = 'print xkcd: ' + ctitle;
          document.getElementById('ctitle').innerHTML = ctitle;

          // Get the comic image
          const img = xkcd.getElementById('comic').innerHTML;
          document.getElementById('comic').innerHTML = img;

          // Get the mouseover
          const mouseover = document.getElementsByTagName('img')[0].getAttribute('title');
          document.getElementById('mouseover').innerHTML = mouseover;
        })

        // Set the link
        document.getElementById('link').innerHTML = 'https://xkcd.com/' + comicNum
        return false;
      }
    </script>
    <style>
      html {
        background-color: #96a8c8;
      }
      body {
        align-items: center;
        background-color: #ffff;
        display: flex;
        flex-direction: column;
        margin: 0 auto;
        max-width: 60em;
        min-height: 100vh;
        width: 100vw;
      }
      body > * {
        margin: 1rem 0;
      }
      h2 {
        margin: 0;
      }
      #link {
        padding: 0.3em;
      }
      main {
        align-items: center;
        display: flex;
        flex-direction: column;
        text-align: center;
      }
      #mouseover {
        background-color: #eee;
        border: 1px solid black;
        font-size: 0.9em;
        max-width: 60%;
        padding: 0.2em;
      }
      @media print {
        h1, form, button {
          display: none;
        }
      }
    </style>
    <title>print xkcd</title>
  </head>
  <body>
    <h1>print xkcd</h1>
    <main>
      <h2 id='ctitle'></h2>
      <div id="link"></div>
      <div id="comic"></div>
      <div id="mouseover"></div>
    </main>
    <form onsubmit="return updateComic();">
      <label for="comicNum">Comic Number:</label>
      <input id="comicNum" type="text" value="1234">
      <input type="submit" value="Update">
    </form>
    <button type="button" onclick="window.print(); return false;">Print</button>
  </body>
</html>

A  => html/logo.svg +53 -0
@@ 1,53 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:cc="http://creativecommons.org/ns#"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:svg="http://www.w3.org/2000/svg"
	xmlns="http://www.w3.org/2000/svg"
	id="svg8"
	version="1.1"
	viewBox="0 0 17.991666 17.991667"
	height="68"
	width="68">
	<defs>
		<radialGradient id="bg" cx="40%" cy="40%" r="125%" fx="35%" fy="35%" fr="50%" gradientUnits="userSpaceOnUse">
			<stop offset="0%" stop-color="#eee" />
			<stop offset="100%" stop-color="#555" stop-opacity="0.95" />
		</radialGradient>
	</defs>
	<path fill="url(#bg)"
		d="M 0,8.995833
		C 0,0 0,0 8.995833,0
		17.99166,0 17.99166,0 17.99166,8.995833
		17.99166,17.99166 17.99166,17.99166 8.995833,17.99166
		0,17.99166 0,17.99166 0,8.995833" />
	<g
		transform="translate(89.53739,-212.18797)"
		id="layer1">
		<path
			id="path3780"
			d="m -77.63114,224.22651 v 2.51354 h -2.910417 -2.910416 v -2.51354 -2.51354 h 2.910416 2.910417 z m -0.728475,-1.92444 c -0.09559,0.23763 -0.298187,0.63214 -0.450252,0.87675 -0.42633,0.68581 -0.337933,1.06029 0.10824,0.45857 0.352655,-0.47559 0.706676,-0.67017 0.706676,-0.38842 0,0.172 -0.548456,0.86342 -0.857721,1.08132 -0.217649,0.15345 -0.199033,0.19874 0.117139,0.2854 0.430804,0.11794 0.650345,0.68787 0.484678,1.25792 -0.212544,0.73136 -1.822274,0.73136 -2.034812,0 -0.165664,-0.57005 0.0539,-1.13983 0.484681,-1.25792 0.316166,-0.0866 0.334788,-0.1321 0.117126,-0.2854 -0.142334,-0.10031 -0.380827,-0.34144 -0.529978,-0.5359 -0.2706,-0.35277 -0.271894,-0.35286 -0.600507,-0.0393 -0.271535,0.25912 -0.281183,0.31427 -0.05497,0.31427 0.380204,0 0.226213,1.56817 -0.181265,1.84589 -0.759917,0.51792 -1.4253,0.0756 -1.536665,-1.02114 -0.06768,-0.66654 -0.03043,-0.82475 0.194133,-0.82475 0.209494,0 0.172906,-0.0965 -0.148694,-0.39214 -0.566129,-0.52043 -0.314032,-0.70939 0.298548,-0.22378 l 0.479688,0.38028 -0.128952,-0.46259 c -0.27126,-0.97308 -0.624599,-1.50113 -1.004476,-1.50113 -0.359598,0 -0.373084,0.0851 -0.373084,2.35645 v 2.35644 h 2.728514 2.728516 v -2.35644 c 0,-2.33181 -0.158404,-2.8895 -0.546572,-1.92442 z m -1.454339,-0.29835 c 0,0.28539 0.407025,1.12312 0.545704,1.12312 0.138682,0 0.545704,-0.83773 0.545704,-1.12312 0,-0.0735 -0.245566,-0.1336 -0.545704,-0.1336 -0.300136,0 -0.545704,0.0602 -0.545704,0.1336 z m -1.179287,0.38561 c -0.138166,0.28557 -0.309248,0.72741 -0.380173,0.98186 l -0.128951,0.46259 0.446652,-0.35347 c 0.594326,-0.47035 0.772584,-0.44741 1.220833,0.15716 0.446183,0.6017 0.534579,0.22724 0.108253,-0.45856 -0.152066,-0.24461 -0.354678,-0.63915 -0.450252,-0.87675 -0.231302,-0.57508 -0.510366,-0.54524 -0.816356,0.0873 z m -0.905536,-0.0133 c 0.10744,0.52672 0.209042,0.69529 0.347131,0.57602 0.04474,-0.0386 0.127747,-0.29782 0.184485,-0.57602 0.08829,-0.43272 0.04987,-0.50582 -0.265812,-0.50582 -0.315678,0 -0.354085,0.0731 -0.265814,0.50582 z m -0.253879,2.30475 c -0.310707,0.16996 -0.106492,0.8027 0.259098,0.8027 0.143323,0 0.433966,-0.14975 0.645867,-0.33274 0.31103,-0.26864 0.33732,-0.35899 0.136426,-0.4689 -0.316753,-0.17329 -0.725889,-0.17366 -1.041391,-9.9e-4 z m 2.268474,0.41449 c -0.520435,0.44948 0.160982,1.00538 0.96293,0.78556 0.477427,-0.13077 0.602836,-0.49719 0.268934,-0.78556 -0.355387,-0.30694 -0.876476,-0.30694 -1.231864,0 z"
			style="fill:#000000;stroke-width:0.16904454" />
		<g
			transform="matrix(0.26458333,0,0,0.26458333,-89.53739,212.18797)"
			id="g3856">
			<path
				d="m 63.353516,43.773041 3.617798,-21.149102 c 0.106803,-0.4237 -0.1391,-0.8729 -0.335579,-1.027101 l -9.003918,-9.963399 c -0.758801,-0.8379 -1.837902,-1.3184 -2.961903,-1.3184 H 13.330017 c -1.123,0 -2.2021,0.4805 -2.9619,1.319399 L 1.2578171,21.714439 c -0.00408,0.0045 -0.0059,0.0103 -0.0099,0.0148 -0.0371,0.100001 -0.3015,0.349902 -0.2341821,0.802601 0.00108,0.0072 -0.00232,0.0143 -0.001,0.0215 l 3.625,21.1929 c 0.2792821,1.954601 1.9813824,3.428699 3.9598823,3.428699 h 7.9003987 2.722102 l -1.214301,9.381302 c -0.07608,0.600899 0.390999,1.128498 0.992199,1.128498 h 30 c 0.0078,0 0.0156,5e-4 0.0195,0 0.683899,0 1.166699,-0.671699 0.9473,-1.323799 l -1.185402,-9.186001 c 2.534001,0 8.065899,0 10.618,0 1.9785,0 3.681702,-1.474098 3.956101,-3.401897 z m 0.3945,-22.388102 H 40.450214 V 21.02504 c 0,-1.455601 1.184521,-2.640101 2.640602,-2.640101 h 17.945302 z m -51.896499,-8.4087 c 0.3858,-0.4263 0.911218,-0.6612 1.4785,-0.6612 h 41.339897 c 0.568302,0 1.093701,0.2349 1.478501,0.6602 l 3.081199,3.4097 H 43.090817 c -2.558602,0 -4.640603,2.081499 -4.640603,4.640101 v 0.359899 H 4.2519169 Z m 5.646499,32.198699 V 36.28484 c 0,-0.5513 0.448302,-1 1,-1 h 2.261101 l -1.280599,9.890098 z m 2.637719,10.5098 c 0.013,-0.100597 2.628,-20.2994 2.641,-20.399898 h 22.450781 c 2.536221,19.6515 2.245602,17.399799 2.632801,20.399898 z m 30.362281,-10.5098 h -1.976699 l -1.2762,-9.890098 h 2.252899 c 0.560601,0 1,0.439399 1,1 z m -1,-11.890098 c 0.100899,-2.03e-4 -2.495201,-0.0101 -31,0 -1.654281,0 -3,1.345699 -3,3 v 8.890098 H 8.5976171 c -0.9892001,0 -1.8408003,-0.735798 -1.9844003,-1.7388 L 3.183617,23.384939 c 21.314119,0 38.882599,0 61.628899,0 l -3.434601,20.0781 c -0.138699,0.976101 -0.990181,1.711899 -1.9805,1.711899 H 52.498017 V 36.28484 c -10e-7,-1.654301 -1.3457,-3 -3.000001,-3 z"
				id="path3836" />
			<circle
				cx="9.2659998"
				cy="27.763"
				r="2.0320001"
				id="circle3838" />
			<circle
				cx="16.292999"
				cy="27.763"
				r="2.0320001"
				id="circle3840" />
			<path
				d="m 56.283215,27.980139 h 3 c 0.5527,0 1,-0.4478 1,-1 0,-0.5523 -0.4473,-1 -1,-1 h -3 c -0.5528,0 -1,0.4477 -1,1 0,0.5522 0.4472,1 1,1 z m -2.25,-1 c 0,-0.5523 -0.4473,-1 -1,-1 h -4.5 c -0.5528,0 -1,0.4477 -1,1 0,0.5522 0.4472,1 1,1 h 4.5 c 0.5527,0 1,-0.4478 1,-1 z"
				id="path3842" />
		</g>
	</g>
</svg>

A  => logo.png +0 -0