Skip to content

Commit

Permalink
Printer profiles: documentation and samples
Browse files Browse the repository at this point in the history
  • Loading branch information
racingmars committed Jan 2, 2022
1 parent 4cabd74 commit b9ec529
Show file tree
Hide file tree
Showing 26 changed files with 146 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The executable component is in the agent folder; see the README file in that dir
License
-------

Copyright 2021 Matthew R. Wilson <[email protected]>
Copyright 2021-2022 Matthew R. Wilson <[email protected]>

This file is part of virtual1403
<https://github.com/racingmars/virtual1403>.
Expand Down
6 changes: 5 additions & 1 deletion webserver/assets/html/base.layout.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
<style type="text/css">
div#website { display: none; }
img.profilesample {
border-top: 1px black solid;
border-left: 1px black solid;
}
</style>
</head>
<body>
Expand All @@ -21,7 +25,7 @@
</body>
<footer class="footer">
<div class="content has-text-centered">
<p><strong>Virtual 1403</strong> &copy; 2021 by Matthew R. Wilson and is <a href="https://github.com/racingmars/virtual1403">free software</a>. This service provided by moshix (<a href="https://www.youtube.com/channel/UCR1ajTWGiUtiAv8X-hpBY7w">YouTube</a> and <a href="https://github.com/moshix/">GitHub</a>). Font used in generated PDFs is <a href="https://1403.slantedhall.com/">1403 Vintage Mono</a> from Slanted Hall, used under license.<p>
<p><strong>Virtual 1403</strong> &copy; 2021–2022 by Matthew R. Wilson and is <a href="https://github.com/racingmars/virtual1403">free software</a>. This service provided by moshix (<a href="https://www.youtube.com/channel/UCR1ajTWGiUtiAv8X-hpBY7w">YouTube</a> and <a href="https://github.com/moshix/">GitHub</a>). Font used in some generated PDFs is <a href="https://1403.slantedhall.com/">1403 Vintage Mono</a> from Slanted Hall, used under license.<p>
</div>
</footer>
</html>
Expand Down
1 change: 1 addition & 0 deletions webserver/assets/html/home.page.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<h2 class="title block">Documentation</h2>
<p class="block"><a href="docs/setup">Setup instructions</a></p>
<p class="block"><a href="static/virtual1403-sample.pdf">Sample PDF</a></p>
<p class="block"><a href="docs/profiles">Available printer profiles</a></p>
</div>

<div class="column">
Expand Down
129 changes: 129 additions & 0 deletions webserver/assets/html/profiles.page.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{{template "base" .}}

{{define "title"}}Available Printer Profiles{{end}}

{{define "main"}}

<p class="block"><a href="/">← Return Home</a></p>

<div class="content">
<p>Virtual1403 provides several printer profiles to choose from. A profile is a combination of font, paper background, and form control. To use a profile, set the profile name in your agent config.yaml file, such as:</p>

<pre>
profile: "retro-blue"
</pre>

<p><strong>Note: you must use version 0.2.0 or later of the agent for the profile setting to work</strong>. <a href="https://github.com/racingmars/virtual1403/releases">Download the latest agent version here</a>.</p>

<p>There are three font options, three paper background options, and the option to skip the first 5 lines on each page (typical form control from examples of output from MVS that we have seen) or print on all 66 lines.</p>

<p><strong>Fonts</strong></p>
<ul>
<li>The "default" font is <a href="https://1403.slantedhall.com/">1403 Vintage Mono</a> from Slanted Hall.</li>
<li>The "retro" font was built from <a href="http://ibm-1401.info/Sched2008December.html#1403-Font">scans of real 1403 printer output</a> at the Computer History Museum. This has a very limited character set, consistent with the default "A" chain of a real 1403, but missing the "&amp;" character.</li>
<li>The "modern" font is <a href="https://www.ibm.com/plex/">IBM Plex Mono</a>, and the modern profiles allow both upper- and lowercase letters.</li>
</ul>

<p><strong>Background</strong></p>
<p>Each font is available on green- or blue-bar paper, or plain tractor-feed paper with no background printed.</p>

<p><strong>Form Control</strong></p>
<p>The "-noskip" version of each profile allows printing on each of the 66 printable lines on the page; profile without -noskip will skip the first 5 lines of each page so that the title line rests above the numbered page area.</p>
</div> <!-- content -->

<p><strong>Samples</strong></p>
<table class="table">
<tr>
<td>
<p>default-green:</p>
<img class="profilesample" src="/static/profiles/default-green-1.sample.small.png" alt="default-green profile sample" width="319" height="162">
</td>
<td>
<p>default-green-noskip:</p>
<img class="profilesample" src="/static/profiles/default-green-noskip-1.sample.small.png" alt="default-green-noskip profile sample" width="319" height="162">
</td>
</tr>
<tr>
<td>
<p>default-blue:</p>
<img class="profilesample" src="/static/profiles/default-blue-1.sample.small.png" alt="default-blue profile sample" width="319" height="162">
</td>
<td>
<p>default-blue-noskip:</p>
<img class="profilesample" src="/static/profiles/default-blue-noskip-1.sample.small.png" alt="default-blue-noskip profile sample" width="319" height="162">
</td>
</tr>
<tr>
<td>
<p>default-plain:</p>
<img class="profilesample" src="/static/profiles/default-plain-1.sample.small.png" alt="default-plain profile sample" width="319" height="162">
</td>
<td>
<p>default-plain-noskip:</p>
<img class="profilesample" src="/static/profiles/default-plain-noskip-1.sample.small.png" alt="default-plain-noskip profile sample" width="319" height="162">
</td>
</tr>

<tr>
<td>
<p>retro-green:</p>
<img class="profilesample" src="/static/profiles/retro-green-1.sample.small.png" alt="retro-green profile sample" width="319" height="162">
</td>
<td>
<p>retro-green-noskip:</p>
<img class="profilesample" src="/static/profiles/retro-green-noskip-1.sample.small.png" alt="retro-green-noskip profile sample" width="319" height="162">
</td>
</tr>
<tr>
<td>
<p>retro-blue:</p>
<img class="profilesample" src="/static/profiles/retro-blue-1.sample.small.png" alt="retro-blue profile sample" width="319" height="162">
</td>
<td>
<p>retro-blue-noskip:</p>
<img class="profilesample" src="/static/profiles/retro-blue-noskip-1.sample.small.png" alt="retro-blue-noskip profile sample" width="319" height="162">
</td>
</tr>
<tr>
<td>
<p>retro-plain:</p>
<img class="profilesample" src="/static/profiles/retro-plain-1.sample.small.png" alt="retro-plain profile sample" width="319" height="162">
</td>
<td>
<p>retro-plain-noskip:</p>
<img class="profilesample" src="/static/profiles/retro-plain-noskip-1.sample.small.png" alt="retro-plain-noskip profile sample" width="319" height="162">
</td>
</tr>

<tr>
<td>
<p>modern-green:</p>
<img class="profilesample" src="/static/profiles/modern-green-1.sample.small.png" alt="modern-green profile sample" width="319" height="162">
</td>
<td>
<p>modern-green-noskip:</p>
<img class="profilesample" src="/static/profiles/modern-green-noskip-1.sample.small.png" alt="modern-green-noskip profile sample" width="319" height="162">
</td>
</tr>
<tr>
<td>
<p>modern-blue:</p>
<img class="profilesample" src="/static/profiles/modern-blue-1.sample.small.png" alt="modern-blue profile sample" width="319" height="162">
</td>
<td>
<p>modern-blue-noskip:</p>
<img class="profilesample" src="/static/profiles/modern-blue-noskip-1.sample.small.png" alt="modern-blue-noskip profile sample" width="319" height="162">
</td>
</tr>
<tr>
<td>
<p>modern-plain:</p>
<img class="profilesample" src="/static/profiles/modern-plain-1.sample.small.png" alt="modern-plain profile sample" width="319" height="162">
</td>
<td>
<p>modern-plain-noskip:</p>
<img class="profilesample" src="/static/profiles/modern-plain-noskip-1.sample.small.png" alt="modern-plain-noskip profile sample" width="319" height="162">
</td>
</tr>
</table>
{{end}}
2 changes: 2 additions & 0 deletions webserver/assets/html/user.page.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@
hercules_address: "127.0.0.1:1403"

mode: "online"
profile: "default-green"
service_address: "{{.apiEndpoint}}"
access_key: "{{.apiKey}}"</pre></p>
<p><strong>Need more help?</strong> For more information on setting up your mainframe and virtual printer, <a href="/docs/setup">see the setup documentation</a>.</p>
<p>Check out <a href="/docs/profiles">the options for printer profiles</a> if you'd like different fonts or backgrounds.</p>
</div>
{{ else }}
<div class="columns">
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions webserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ func main() {
mux.Handle("/favicon.ico", http.HandlerFunc(serveFavicon))
mux.Handle("/static/", http.FileServer(http.FS(assets.Content)))
mux.Handle("/docs/setup", http.HandlerFunc(app.docsSetup))
mux.Handle("/docs/profiles", http.HandlerFunc(app.docsProfiles))
mux.Handle("/", app.session.Enable(http.HandlerFunc(app.home)))
mux.Handle("/login", app.session.Enable(http.HandlerFunc(app.login)))
mux.Handle("/signup", app.session.Enable(http.HandlerFunc(app.signup)))
Expand Down
2 changes: 1 addition & 1 deletion webserver/printjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func (a *application) printjob(w http.ResponseWriter, r *http.Request) {
"The intern in the machine room has carefully collated your job and "+
"prepared it for delivery. Please find it attached to this "+
"message.\r\n\r\n"+
"The font used in the attached PDF is 1403 Vintage Mono from "+
"The font used in some PDFs is 1403 Vintage Mono from "+
"Slanted Hall, used under license.\r\n",
attachmentName, pdfBuffer.Bytes())
if err != nil {
Expand Down
6 changes: 6 additions & 0 deletions webserver/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ func (app *application) docsSetup(w http.ResponseWriter, r *http.Request) {
app.render(w, r, "docs.page.tmpl", responseVars)
}

// docsProfiles serves the setup documentation page. This is unauthenticated.
func (app *application) docsProfiles(w http.ResponseWriter, r *http.Request) {
responseVars := make(map[string]interface{})
app.render(w, r, "profiles.page.tmpl", responseVars)
}

// login handles user login requests and if successful sets the session cookie
// user value to the logged in user's email address.
func (app *application) login(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit b9ec529

Please sign in to comment.