--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="188px" height="207px" viewBox="0 0 188 207" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: Sketch 54 (76480) - https://sketchapp.com -->
+ <title>Group 2</title>
+ <desc>Created with Sketch.</desc>
+ <defs>
+ <filter x="-21.7%" y="-19.1%" width="143.5%" height="138.2%" filterUnits="objectBoundingBox" id="filter-1">
+ <feGaussianBlur stdDeviation="10" in="SourceGraphic"></feGaussianBlur>
+ </filter>
+ </defs>
+ <g id="5.-Website" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="Artboard-Copy-2" transform="translate(-612.000000, -161.000000)">
+ <g id="Group-2" transform="translate(622.000000, 172.000000)">
+ <rect id="Rectangle-2-Copy-3" fill="#000000" opacity="0.235770089" filter="url(#filter-1)" x="15" y="14" width="138" height="157" rx="23"></rect>
+ <path d="M37,0 L132,0 C152.434536,-3.75376332e-15 169,16.5654643 169,37 L169,132 C169,152.434536 152.434536,169 132,169 L37,169 C16.5654643,169 2.50250888e-15,152.434536 0,132 L0,37 C-2.50250888e-15,16.5654643 16.5654643,3.75376332e-15 37,0 Z" id="Rectangle-2-Copy-4" fill="#FFFFFF"></path>
+ <g id="Group-2-Copy-2" transform="translate(6.000000, 28.000000)" fill="#49528D">
+ <g id="Group" transform="translate(67.000000, 0.000000)">
+ <path d="M60.4099657,21.9996233 C59.778359,22.2120418 59.5456863,22.2503695 59.354811,22.3607348 C51.2669947,27.023322 43.1633882,31.6591259 35.1354816,36.4205338 C34.4309616,36.8379825 33.8536916,38.0815545 33.8434745,38.9487763 C33.7473402,47.2548034 33.7858868,55.5626775 33.7858868,63.8700899 L33.7858868,67.1279439 C34.1281619,67.238771 34.2261538,67.3052672 34.2707378,67.2798693 C42.6385974,62.4870604 51.0185318,57.7145697 59.3348411,52.8344845 C59.9316165,52.4844557 60.3375167,51.3567902 60.3616663,50.5759212 C60.4717331,47.1181166 60.4099657,43.6547707 60.4099657,40.193272 L60.4099657,21.9996233 Z M30.2187024,67.6331306 C30.2187024,57.48368 30.2442453,47.7987796 30.1569349,38.1143409 C30.1518264,37.5020213 29.3878609,36.6911366 28.7664714,36.321713 C23.9258565,33.4439035 19.0360133,30.6478289 14.1563874,27.8346685 C10.7703254,25.8827267 7.37683284,23.9437148 3.59880322,21.7770456 L3.59880322,24.4133445 C3.59880322,32.1052048 3.81707906,39.805839 3.50313339,47.4852313 C3.35452005,51.1111236 4.49001881,53.0672213 7.72746742,54.7758053 C15.2143286,58.7290992 22.4504047,63.1524846 30.2187024,67.6331306 L30.2187024,67.6331306 Z M58.6149952,18.7459253 C49.8612054,13.6995994 41.4696606,8.81997593 33.0065956,4.06595646 C32.3708092,3.70900094 31.0839106,3.98883929 30.3440949,4.40351724 C24.4947669,7.67984246 18.7020978,11.0577592 12.8968894,14.4116633 C10.4814583,15.8071608 8.07670876,17.2215913 5.41978099,18.7717849 C14.1489567,23.8079516 22.5474678,28.6709511 30.9794169,33.4753045 C31.4791292,33.7597606 32.399603,33.8382631 32.8695927,33.5708928 C41.3688822,28.7309824 49.8286963,23.8231904 58.6149952,18.7459253 L58.6149952,18.7459253 Z M0.0357985277,35.5607005 C0.0357985277,30.1735814 0.0655211946,24.7869241 0.0121132775,19.4002668 C0.000502860722,18.2273469 0.210419196,17.4991207 1.36867437,16.8461646 C10.781007,11.5366244 20.1506134,6.15089069 29.5044295,0.7388355 C31.2320595,-0.261378795 32.7479155,-0.239213381 34.4801897,0.76377159 C43.6979318,6.10101851 52.9416812,11.393011 62.2170109,16.6309754 C63.5536021,17.3859848 64.000371,18.3053877 63.9952624,19.7701521 C63.9534649,30.4663496 63.944641,41.1634706 63.9999065,51.8601298 C64.0091949,53.6273598 63.3265024,54.6598987 61.801358,55.5220409 C52.5961552,60.7258336 43.4197462,65.9822691 34.2763108,71.2927328 C32.6805751,72.2190624 31.3746354,72.2453838 29.7682182,71.3130511 C20.5565135,65.965645 11.3109065,60.6754996 2.03836321,55.4324557 C0.584739032,54.6104883 -0.0278265562,53.6412132 0.000967277392,51.9511004 C0.0947794448,46.489173 0.0357985277,41.024475 0.0357985277,35.5607005 L0.0357985277,35.5607005 Z" id="Fill-1"></path>
+ <path d="M33.9591837,15.2814529 C32.9039627,16.1501798 32.2795217,17.0612162 31.7183687,17.0166071 C31.1276812,16.9701585 30.5973283,16.0103741 30.0408163,15.4497716 C30.5542925,14.8463997 31.0129191,13.8489045 31.5968558,13.7523282 C32.1529459,13.6603508 32.839831,14.5083827 33.9591837,15.2814529" id="Fill-4"></path>
+ <path d="M33.9591837,29.056527 C32.8142394,29.9173659 32.1912997,30.7378747 31.5415016,30.7633707 C31.0233959,30.7828404 29.9720226,29.7268409 30.0443668,29.3365198 C30.177792,28.6128959 30.8873715,27.6282854 31.4942829,27.5012688 C32.0461781,27.3853777 32.7800167,28.2633685 33.9591837,29.056527" id="Fill-6"></path>
+ <path d="M31.6396776,19.6363636 C32.4882514,20.7898055 33.3823584,21.4777386 33.3009505,22.0368766 C33.2126437,22.6478842 32.2440277,23.5305486 31.6180609,23.563077 C31.0868399,23.5903306 30.1163842,22.6153558 30.0446349,22.0078647 C29.976565,21.4372978 30.830658,20.7665081 31.6396776,19.6363636" id="Fill-8"></path>
+ <path d="M33.9591837,8.92784148 C32.7677528,9.70673442 32.018516,10.5795758 31.45298,10.4620246 C30.8550776,10.3375313 30.1513286,9.31751935 30.043295,8.59601365 C29.9824988,8.19106337 31.055399,7.17012586 31.5767593,7.20067068 C32.2328336,7.23908311 32.8473565,8.06888408 33.9591837,8.92784148" id="Fill-10"></path>
+ <path d="M8.18140861,53.0181818 C7.33811673,51.7112401 6.45106485,50.9352284 6.5363057,50.308207 C6.63020739,49.6127567 7.61207263,49.0541641 8.20739111,48.4363636 C8.77216875,49.0779444 9.70753898,49.6695381 9.79141233,50.3756651 C9.86616902,51.0036572 8.99735047,51.7583153 8.18140861,53.0181818" id="Fill-12"></path>
+ <path d="M20.1225064,45.1636364 C19.1856777,44.0970832 18.2456671,43.491923 18.2870312,42.9498699 C18.3329409,42.348471 19.2747696,41.8047462 19.826594,41.2363636 C20.4338736,41.741639 21.4066118,42.1787921 21.5393406,42.773922 C21.6579783,43.3063628 20.8506965,44.0134975 20.1225064,45.1636364" id="Fill-14"></path>
+ <path d="M13.2466367,44.5090909 C14.1563788,45.6356989 15.0583726,46.267007 15.0191753,46.8367349 C14.9776991,47.4396895 14.0547393,48.4183278 13.4904804,48.4360487 C12.8947725,48.4550987 11.8879487,47.6058232 11.7653432,47.0010965 C11.6532207,46.4482035 12.4822892,45.7150001 13.2466367,44.5090909" id="Fill-16"></path>
+ <path d="M29.3877551,39.4881423 C28.0941835,40.3868872 27.3660945,41.2861082 26.7180952,41.2342209 C26.0438847,41.1799535 25.4468517,40.2059957 24.8163265,39.6342835 C25.4216112,39.042102 25.970105,38.0676683 26.648684,37.9705581 C27.291344,37.8791603 28.0703993,38.7093569 29.3877551,39.4881423" id="Fill-18"></path>
+ <path d="M58.122449,50.1699015 C56.9720625,50.9442982 56.2808891,51.7778787 55.688577,51.7045819 C55.1026844,51.6321956 54.1547283,50.5919272 54.2060848,50.0701996 C54.2689966,49.4360228 55.1780074,48.4940905 55.7823026,48.4385488 C56.3596357,48.3857387 57.0157155,49.2994449 58.122449,50.1699015" id="Fill-20"></path>
+ <path d="M44.2611628,40.5818182 C44.9905159,41.759341 45.8112643,42.4957836 45.704938,43.0747287 C45.5954446,43.6719976 44.562496,44.5380157 43.9761179,44.5083486 C43.401051,44.4791177 42.4608552,43.4791613 42.4490914,42.890618 C42.4373276,42.2872412 43.3558058,41.6668494 44.2611628,40.5818182" id="Fill-22"></path>
+ <path d="M41.1428571,39.6019866 C39.8272149,40.4453553 39.0870471,41.2957953 38.4354138,41.2330966 C37.7680728,41.1689836 37.1887904,40.2105886 36.5714286,39.6434715 C37.1749866,39.0471264 37.7276135,38.0547893 38.3973344,37.968991 C39.0370679,37.8874355 39.7996073,38.7515467 41.1428571,39.6019866" id="Fill-24"></path>
+ <path d="M52.8979592,46.7368979 C51.6070796,47.613954 50.8916179,48.482527 50.2457018,48.4344562 C49.5712053,48.384029 48.9633963,47.451833 48.3265306,46.9046744 C48.912428,46.2891799 49.4340196,45.2768659 50.1018473,45.1717699 C50.737284,45.0713869 51.5251492,45.9178096 52.8979592,46.7368979" id="Fill-26"></path>
+ </g>
+ <g id="Group-9" transform="translate(46.000000, 90.500000) rotate(-45.000000) translate(-46.000000, -90.500000) translate(14.000000, 58.000000)">
+ <g id="Group-8" transform="translate(32.029091, 32.516283) rotate(45.000000) translate(-32.029091, -32.516283) translate(9.529091, 10.016283)">
+ <g id="Group-4" fill-rule="nonzero">
+ <path d="M34.8187898,4.45237236 L19.3998407,20.0154519 L18.223861,19.6143752 C14.4775301,18.3366608 10.3160388,19.3041305 7.47123872,22.221987 C3.35475286,26.4441871 3.35475286,33.2979191 7.47123872,37.5201191 C11.5768463,41.7311616 18.2250205,41.7311616 22.3306281,37.5201191 C25.187989,34.5893793 26.1336215,30.2886821 24.8711409,26.4226421 L24.4795548,25.2235049 L40.0128969,9.54482275 L40.3913192,4.45237236 L34.8187898,4.45237236 Z M29.0334812,26.3807277 C30.2018113,31.3508827 28.814725,36.6696904 25.1859649,40.3916396 C19.5079693,46.21545 10.2938975,46.21545 4.61590197,40.3916396 C-1.05121531,34.5789868 -1.05121531,25.1631193 4.61590197,19.3504666 C8.24206127,15.631185 13.4295855,14.2014186 18.2830256,15.3889734 L33.1616434,0.371275952 L44.7243254,0.371275952 L43.907163,11.3678781 L29.0334812,26.3807277 Z" id="Combined-Shape"></path>
+ </g>
+ <path d="M15.5561792,29.835368 C16.733014,31.0305908 16.733014,32.96877 15.5561792,34.1641783 C14.3793444,35.3594012 12.4709833,35.3594012 11.2939659,34.1641783 C10.1171311,32.96877 10.1171311,31.0305908 11.2939659,29.835368 C12.4709833,28.6401451 14.3793444,28.6401451 15.5561792,29.835368" id="Fill-5"></path>
+ </g>
+ <polygon id="Rectangle-3-Copy-2" points="35.5141475 32.4265935 39.5324578 32.4265935 39.5324578 36.5076899 35.5141475 36.5076899"></polygon>
+ <polygon id="Rectangle-3-Copy-3" points="41.541613 32.4265935 45.5599233 32.4265935 45.5599233 36.5076899 41.541613 36.5076899"></polygon>
+ <polygon id="Rectangle-3-Copy-4" points="47.5690785 32.4265935 51.5873888 32.4265935 51.5873888 36.5076899 47.5690785 36.5076899"></polygon>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+</svg>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="29px" height="29px" viewBox="0 0 29 29" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: Sketch 54 (76480) - https://sketchapp.com -->
+ <title>Group 10</title>
+ <desc>Created with Sketch.</desc>
+ <g id="5.-Website" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="Artboard-Copy-2" transform="translate(-48.000000, -36.000000)" fill="#1500FF">
+ <g id="Group-10" transform="translate(32.000000, 21.000000)">
+ <g id="Group-9" transform="translate(30.000000, 30.000000) rotate(-45.000000) translate(-30.000000, -30.000000) translate(9.000000, 9.000000)">
+ <g id="Group-8" transform="translate(21.468612, 20.951190) rotate(45.000000) translate(-21.468612, -20.951190) translate(6.968612, 6.451190)">
+ <g id="Group-4" fill-rule="nonzero">
+ <path d="M22.2514057,2.84534714 L12.3977234,12.7911379 L11.6461982,12.5348245 C9.25205608,11.7182843 6.59260036,12.3365586 4.77459341,14.2012532 C2.14389896,16.8995057 2.14389896,21.2794733 4.77459341,23.9777258 C7.39833598,26.6688479 11.6469391,26.6688479 14.2706817,23.9777258 C16.0967158,22.1047979 16.7010347,19.3563808 15.8942298,16.8857371 L15.6439816,16.1194127 L25.5707682,6.09974456 L25.812604,2.84534714 L22.2514057,2.84534714 Z M18.5542282,16.8589512 C19.3008649,20.0351941 18.4144292,23.4342481 16.0954222,25.8128088 C12.4668245,29.5345914 6.57845063,29.5345914 2.94985289,25.8128088 C-0.671792972,22.0981565 -0.671792972,16.0808225 2.94985289,12.3661703 C5.2671977,9.98931443 8.58235332,9.0756034 11.6840081,9.83452593 L21.1923846,0.237268782 L28.5816686,0.237268782 L28.0594502,7.2647921 L18.5542282,16.8589512 Z" id="Combined-Shape"></path>
+ </g>
+ <path d="M9.94138097,19.0666845 C10.6934527,19.8305073 10.6934527,21.0691262 9.94138097,21.8330677 C9.18930921,22.5968906 7.969746,22.5968906 7.21755751,21.8330677 C6.46548574,21.0691262 6.46548574,19.8305073 7.21755751,19.0666845 C7.969746,18.3028616 9.18930921,18.3028616 9.94138097,19.0666845" id="Fill-5"></path>
+ </g>
+ <polygon id="Rectangle-3-Copy-2" points="23.6957833 20.7226412 26.2637373 20.7226412 26.2637373 23.3307196 23.6957833 23.3307196"></polygon>
+ <polygon id="Rectangle-3-Copy-3" points="27.5477144 20.7226412 30.1156685 20.7226412 30.1156685 23.3307196 27.5477144 23.3307196"></polygon>
+ <polygon id="Rectangle-3-Copy-4" points="31.3996455 20.7226412 33.9675996 20.7226412 33.9675996 23.3307196 31.3996455 23.3307196"></polygon>
+ </g>
+ </g>
+ </g>
+ </g>
+</svg>
\ No newline at end of file
-{% extends "base.html" %}
-
-{% block title %}Print key | {{ printer.name }} | Little Printer{% endblock %}
-
-{% block page_content %}
-<div class="hidden-xs" style="height: 3em"></div>
-<div class="row">
- <div class="col-md-8">
- <h1>🔑 You got a Print Key!</h1>
-
- <p>
- You can use this Print Key to print to {{ printer.owner.username }}'s Little Printer.
- </p>
-
- <table class="table">
- <tbody>
- <tr>
- <td>Printer</td>
- <td>{{ printer.name }}</td>
- </tr>
- <tr>
- <td>Owned by</td>
- <td>{{ printer.owner.username }}</td>
- </tr>
- <tr>
- <td>Status</td>
- <td>
- {% if printer.is_online %}
- <span class="label label-success">Online</span>
- {% else %}
- <span class="label label-default">Offline</span>
- {% endif %}
- </td>
- </tr>
- <tr>
- <td>Print key</td>
- <td><a href="{{request.url}}"><tt>{{print_key.secret}}</tt></a></td>
- </tr>
- </tbody>
- </table>
- </div>
-</div>
-
-<div class="hidden-xs" style="height: 2em"></div>
-
-<h2>How do I actually use this?!</h2>
-
-<h3>The easy way</h3>
-
-<p>
- <a href="https://itunes.apple.com/us/app/little-printers/id1393105914?ls=1&mt=8">Download our iOS app</a> and paste the code (<tt>{{print_key.secret}}</tt>) in there.
-</p>
-
-<h3>The nerdy way</h3>
-
-<p>
- This URL also works as an API. You can POST data to it and it'll send it to the printer.
-</p>
-<p>
- You could do this from IFTTT, a Glitch app, your web app, or the command line. For example:
-</p>
-<pre><code>curl '{{request.url}}?from=example' \
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link rel="shortcut icon" href="{{url_for('static', filename='device-key-favicon.png')}}">
+
+ <title>Device Key – {{printer.owner.username}}'s Little Printer</title>
+
+ <style>
+ @import url(https://nordprojects.co/fonts/apercu-mono-regular-web/stylesheet.css);
+
+ /* GLOBAL */
+ @font-face {
+ font-family: 'Apercu';
+ src: url('https://nordprojects.co/fonts/Apercu-Medium.eot');
+ src: url('https://nordprojects.co/fonts/Apercu-Medium.eot?#iefix') format('embedded-opentype'),
+ url('https://nordprojects.co/fonts/Apercu-Medium.woff') format('woff'),
+ url('https://nordprojects.co/fonts/Apercu-Medium.ttf') format('truetype');
+ font-weight: 500;
+ font-style: normal;
+ }
+
+ * {
+ box-sizing: border-box;
+ }
+
+ html, body {
+ padding: 0;
+ margin: 0;
+ overflow-x: hidden;
+ }
+
+ body {
+ /* font is Apercu, as loaded by font-face, or fallback to system font */
+ font-family: 'Apercu', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
+ font-weight: 500;
+ font-size: 16px;
+ color: #373737;
+ background: #fbfbfb;
+ letter-spacing: -0.1px;
+ line-height: 28px;
+ -webkit-font-smoothing: antialiased;
+ }
+ a, a:link {
+ color: #1500FF;
+ text-decoration: underline;
+ }
+
+ header {
+ background: white;
+ color: #1500FF;
+ height: 100px;
+ display: flex;
+ align-items: center;
+ padding: 20px 30px;
+ margin-bottom: 30px;
+ font-size: 1.2em;
+ }
+ @media (min-width: 768px) {
+ header {
+ padding: 20px 50px;
+ font-size: 1.5em;
+ }
+ }
+ header .icon {
+ margin-right: 10px;
+ }
+ header .title {
+ letter-spacing: 1px;
+ line-height: 38px;
+ }
+ header .byline {
+ font-family: 'Apercu Mono', monospace;
+ letter-spacing: 0.33px;
+ justify-self: flex-end;
+ font-size: 0.70em;
+ }
+
+ .margins {
+ padding: 0 30px;
+ }
+ @media (min-width: 768px) {
+ .margins {
+ padding: 0 50px;
+ max-width: 1200px;
+ margin: 0 auto;
+ }
+ }
+
+ .device-key-symbol {
+ margin-bottom: 16px
+ }
+ .central-column {
+ max-width: 450px;
+ text-align: center;
+ margin: 0 auto;
+ padding-top: 20px;
+ }
+ .what-is-this {
+ font-family: "Apercu Mono", monospace;
+ font-size: 15px;
+ color: #49528D;
+ letter-spacing: 0.63px;
+ line-height: 28px;
+ margin-top: 40px;
+
+ text-align: left;
+ }
+ @media (min-width: 1000px) {
+ /* there's enough gap to fit this alongside */
+ .what-is-this {
+ position: absolute;
+ left: 50px;
+ top: 100px;
+ max-width: 333px;
+ }
+ .central-column {
+ padding-top: 40px;
+ }
+ }
+ .device-key-label {
+ font-family: Apercu-Medium;
+ font-size: 22px;
+ color: #49528D;
+ letter-spacing: 0.91px;
+ line-height: 38px;
+ }
+ .device-key {
+
+ font-family: "Apercu Mono", monospace;
+ font-size: 20px;
+ display: inline-block;
+ max-width: 100%;
+ text-align: left;
+ white-space: normal;
+ word-wrap: break-word;
+ }
+
+ .attr-list {
+ display: grid;
+ grid-template-columns: 105px auto;
+ text-align: left;
+ line-height: 38px;
+ color: #49528D;
+ padding: 0;
+ margin-top: 30px;
+ }
+ .attr-list dt {
+ font-size: 17px;
+ color: #49528D;
+ letter-spacing: 0.67px;
+ }
+ .attr-list dd {
+ font-family: "Apercu Mono", monospace;
+ font-size: 16px;
+ letter-spacing: 0.63px;
+ margin: 0;
+ }
+ .status.online {
+ color: #37b06e
+ }
+ .status.offline {
+ color: #a24a66;
+ }
+ </style>
+
+ </head>
+ <body>
+ <header>
+ <img class="icon" src="{{url_for('static', filename='device-key-mini.svg')}}">
+ <div class="title">Device Keys</div>
+ <div class="spacer" style="flex: 1"></div>
+ <div class="byline">by <a href="https://nordprojects.co/">Nord Projects</a></div>
+ </header>
+
+ <div class="margins">
+
+ <div class="central-column">
+ <img class="device-key-symbol" src="{{url_for('static', filename='device-key-large.svg')}}">
+
+ <div class="device-key-label">Device Key:</div>
+ <a class="device-key" href="{{request.url}}">{{request.url}}</a>
+
+ <p class="what-is-this">
+ A Device Key is a secret URL for a device, containing both
+ address and authentication. It can be
+ shared like any other URL, and used by apps,
+ services, or your own programs as an API endpoint.
+ </p>
+
+ <dl class="attr-list">
+ <dt>Type:</dt> <dd>Berg Little Printer</dd>
+ <dt>Class:</dt> <dd>Thermal Printer</dd>
+ <dt>Name:</dt> <dd>{{ printer.name }}</dd>
+ <dt>Owner:</dt> <dd>{{ printer.owner.username }}</dd>
+ <dt>Status:</dt>
+ <dd>
+ {% if printer.is_online %}
+ <span class="status online">Online</span>
+ {% else %}
+ <span class="status offline">Offline</span>
+ {% endif %}
+ </dd>
+ <dt>Apps:</dt> <dd><a href="https://itunes.apple.com/us/app/little-printers/id1393105914?ls=1&mt=8">Little Printers</a></dd>
+ <dt>API:</dt> <dd><a href="#api">Documentation</a></dd>
+ </dl>
+ </div>
+
+ <style>
+ .api-docs {
+ display: none;
+ font-family: Arial, Helvetica, sans-serif;
+ }
+ .api-docs:target {
+ display: block;
+ }
+ @media (min-width: 768px) {
+ .api-docs {
+ background: white;
+ max-width: 800px;
+ margin: 60px auto;
+ padding: 20px;
+ box-shadow: 0 1px 20px rgba(0, 0, 0, 0.05);
+ }
+ }
+ .api-docs h1, .api-docs h2, .api-docs h3, .api-docs h4 {
+ font-weight: 500;
+ font-family: 'Apercu', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
+ margin-top: 0;
+ margin-bottom: 0.5em;
+ }
+ .api-docs p {
+ margin: 0 0 10px;
+ }
+ .api-docs code {
+ padding: 2px 4px;
+ font-size: 90%;
+ color: #c7254e;
+ background-color: #f9f2f4;
+ border-radius: 4px;
+ }
+ .api-docs pre {
+ display: block;
+ padding: 9.5px;
+ margin: 0 0 10px;
+ font-size: 13px;
+ line-height: 1.42857143;
+ color: #333;
+ word-break: break-all;
+ word-wrap: break-word;
+ background-color: #f5f5f5;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+ }
+ .api-docs pre code {
+ padding: 0;
+ font-size: inherit;
+ color: inherit;
+ white-space: pre-wrap;
+ background-color: transparent;
+ border-radius: 0;
+ }
+ </style>
+ <div id="api" class="api-docs">
+ <a href="#" style="display: block; text-align: right">Close</a>
+ <h2>API Documentation</h2>
+ <h3>Class: Thermal Printer</h3>
+ <p>
+ This URL also works as an API. You can POST data to it and it'll send it to the printer.
+ </p>
+ <p>
+ You could do this from IFTTT, a Glitch app, your web app, or the command line. For example:
+ </p>
+ <pre><code>curl '{{request.url}}?from=example' \
-H 'content-type: text/plain' \
-d 'boop beep boop'</code></pre>
-<div class="hidden-xs" style="height: 1em"></div>
-<p>
- Take care to set the Content-Type of the request. Supported types below:
-</p>
+ <div class="hidden-xs" style="height: 1em"></div>
+ <p>
+ Take care to set the Content-Type of the request. Supported types below:
+ </p>
-<h4>HTML</h4>
-<p>
- <code>Content-Type: text/html</code>
-</p>
-<p>Renders and prints HTML. Surprisingly powerful! Supports HTML elements, CSS styling, and embedded images.</p>
-<pre><code>curl '{{request.url}}?from=htmlexample' \
+ <h4>HTML</h4>
+ <p>
+ <code>Content-Type: text/html</code>
+ </p>
+ <p>Renders and prints HTML. Surprisingly powerful! Supports HTML elements, CSS styling, and embedded images.</p>
+ <pre><code>curl '{{request.url}}?from=htmlexample' \
-H 'content-type: text/html' \
-d "<h1>Yep, you can do this</h1><small>or this</small>"</code></pre>
-<h4>Images</h4>
-<p>
- <code>Content-Type: image/png</code>,
- <code>Content-Type: image/gif</code>,
- <code>Content-Type: image/jpeg</code>
-</p>
-<p>Prints out the image data from the request body, in a lovely dithered style.</p>
-<pre><code>cat mindblown.gif | curl '{{request.url}}?from=image-example' \
+ <h4>Images</h4>
+ <p>
+ <code>Content-Type: image/png</code>,
+ <code>Content-Type: image/gif</code>,
+ <code>Content-Type: image/jpeg</code>
+ </p>
+ <p>Prints out the image data from the request body, in a lovely dithered style.</p>
+ <pre><code>cat mindblown.gif | curl '{{request.url}}?from=image-example' \
-X POST \
-H 'content-type: image/gif' \
--data-binary @-</code></pre>
-<h4>JSON</h4>
-<p>
- <code>Content-Type: application/json</code>
-</p>
-<p>
- Print Keys accept JSON encoded text or HTML. This is great for working with <a href="http://ifttt.com">IFTTT</a>!
-</p>
-<p>
- Send HTML using the <tt>html</tt> key or plain text using the <tt>text</tt> key.
-</p>
-<pre><code>curl '{{request.url}}?from=jsonexample' \
+ <h4>JSON</h4>
+ <p>
+ <code>Content-Type: application/json</code>
+ </p>
+ <p>
+ Print Keys accept JSON encoded text or HTML. This is great for working with <a href="http://ifttt.com">IFTTT</a>!
+ </p>
+ <p>
+ Send HTML using the <tt>html</tt> key or plain text using the <tt>text</tt> key.
+ </p>
+ <pre><code>curl '{{request.url}}?from=jsonexample' \
-H 'content-type: application/json' \
-d '{"html":"<h1>header!</h1>"}'</code></pre>
-<h4>Text</h4>
-<p>
- <code>Content-Type: text/plain</code>
-</p>
-<p>Prints out plain text.</p>
-<pre><code>curl '{{request.url}}?from=text-example' \
+ <h4>Text</h4>
+ <p>
+ <code>Content-Type: text/plain</code>
+ </p>
+ <p>Prints out plain text.</p>
+ <pre><code>curl '{{request.url}}?from=text-example' \
-H 'content-type: text/plain' \
-d "I'm a little teapot"</code></pre>
-<div class="hidden-xs" style="height: 1em"></div>
-
-<h4>Status API</h4>
-
-<p>This URL is also a status API e.g.</p>
+ <div class="hidden-xs" style="height: 1em"></div>
-<pre><code>curl '{{request.url}}'</code></pre>
+ <h4>Status API</h4>
-<p>This returns the status of the printer in JSON format.</p>
+ <p>This URL is also a status API e.g.</p>
-<p>e.g.</p>
+ <pre><code>curl '{{request.url}}'</code></pre>
-<pre><code>{{printer_info_json}}</code></pre>
+ <p>This returns the status of the printer in JSON format.</p>
-{% endblock %}
+ <p>e.g.</p>
-{% block scripts %}
-{{ super() }}
+ <pre><code>{{printer_info_json}}</code></pre>
-<script>
-</script>
-{% endblock scripts %}
+ </div>
+ </div>
+ </body>
+</html>