changeset 40:ebab99118e19

add learn.html
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 25 Dec 2023 20:22:17 -0700
parents 73bd183073cd
children fbf2a8deee98
files src/index.html.luan src/learn.html.luan
diffstat 2 files changed, 112 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/index.html.luan	Fri Dec 08 15:33:34 2023 -0700
+++ b/src/index.html.luan	Mon Dec 25 20:22:17 2023 -0700
@@ -34,6 +34,7 @@
 				<li><a href="/about.html">About Reactionary Software</a></li>
 				<li><a href="/existing.html">Existing Reactionary Software</a></li>
 				<li><a href="/needed.html">Needed Reactionary Software</a></li>
+				<li><a href="/learn.html">Learn Reactionary Programming</a></li>
 				<li><a href="/books.html">Reactionary Programming Books</a></li>
 				<li><a href="/discussion.html">Discussion</a></li>
 			</ul>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/learn.html.luan	Mon Dec 25 20:22:17 2023 -0700
@@ -0,0 +1,111 @@
+local Luan = require "luan:Luan.luan"
+local error = Luan.error
+local pairs = Luan.pairs or error()
+local Io = require "luan:Io.luan"
+local Http = require "luan:http/Http.luan"
+local Shared = require "site:/lib/Shared.luan"
+local head = Shared.head or error()
+local header = Shared.header or error()
+
+
+local content = {
+	intro = {
+		title = "Introduction"
+		content = function()
+%>
+<p>Learning reactionary programming will give you a deep understanding of programming and will enable to you to write your own programs and websites.  However this is not enough to get a job with modern scum (members of depraved modern culture).  Modern scum will expect you to use tools popular with them, so you would have to learn one of those.  Probably the least horrible programming tool used by modern scum is <a href="python.html">Python</a>, so I would recommend learning that if you want a job.</p>
+
+<p>I will develop this course incrementally based on demand.  Whenever anyone completes the content here, I will add another lesson/section.  This way I won't waste my time writing content that no one will use.</p>
+
+<p>This course will be designed for you to learn reactionary programming in a logical sequence.  I will focus on finding relevant resources, and I will only write explanations when nothing else is available on the subject.  I will focus on web development since that is what I know best.</p>
+
+<p>I will often say "Do X" without saying how to do X.  A big part of programming is figuring out how to do things.  Your two main resources are Google and ChatGPT.  If you get stuck, you can ask me <a href="https://discord.gg/Qdcgvm3aAq">on Discord</a>.</p>
+
+<p>ChatGPT has become an essential programming tool.  So the only task for this lesson is to play with ChatGPT.  Later you can ask it technical questions.</p>
+<%
+		end
+	}
+	editor = {
+		title = "Text Editor and JSON"
+		content = function()
+%>
+<p>later</p>
+<%
+		end
+	}
+}
+
+
+local function show_toc(content)
+%>
+			<ul>
+<%
+	for id, info in pairs(content) do
+%>
+				<li><a id="c_<%=id%>" href="#<%=id%>"><%=info.title%></a></li>
+<%
+	end
+%>
+			</ul>
+<%
+end
+
+local function show_content(content,h)
+	for id, info in pairs(content) do
+%>
+			<div heading>
+				<h<%=h%>><a id="<%=id%>" href="#<%=id%>"><%=info.title%></a></h<%=h%>>
+				<a href="#c_<%=id%>">contents</a>
+			</div>
+<%
+		info.content()
+	end
+end
+
+return function()
+	Io.stdout = Http.response.text_writer()
+%>
+<!doctype html>
+<html>
+	<head>
+<%		head() %>
+		<title>Learn Reactionary Programming</title>
+		<style>
+			div[toc] ul {
+				list-style-type: none;
+			}
+			div[toc] > ul {
+				padding-left: 0;
+			}
+			div[toc] > ul > li {
+				margin-bottom: 16px;
+			}
+			div[heading] {
+				display: flex;
+				justify-content: space-between;
+				margin-top: 36px;
+			}
+			div[heading] > * {
+				margin: 0;
+			}
+			div[heading] > a {
+				font-size: 14px;
+			}
+		</style>
+	</head>
+	<body>
+<%		header() %>
+		<div content>
+			<h1><a href="learn.html">Learn Reactionary Programming</a></h1>
+			<hr>
+			<h2>Contents</h2>
+			<div toc>
+<%			show_toc(content) %>
+			</div>
+			<hr>
+<%			show_content(content,2) %>
+		</div>
+	</body>
+</html>
+<%
+end