annotate src/learn.html.luan @ 46:89fdc29b296f

learn_bash work
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 05 Jan 2024 20:58:57 -0700
parents 14518d772090
children 3057adc065f3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
40
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 local Luan = require "luan:Luan.luan"
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 local error = Luan.error
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 local pairs = Luan.pairs or error()
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4 local Io = require "luan:Io.luan"
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5 local Http = require "luan:http/Http.luan"
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 local Shared = require "site:/lib/Shared.luan"
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 local head = Shared.head or error()
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 local header = Shared.header or error()
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11 local content = {
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 intro = {
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 title = "Introduction"
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 content = function()
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 %>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16 <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>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17
41
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
18 <p>The next 3 lessons are basic computer literacy. Even if you are not interested in programming, these would be useful skills.</p>
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
19
40
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20 <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>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
21
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
22 <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>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
23
41
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
24 <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.</p>
40
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
25
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
26 <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>
41
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
27
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
28 <p>If you have any questions, you can <a href="https://discord.gg/Qdcgvm3aAq">ask me on Discord</a>.</p>
40
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
29 <%
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
30 end
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
31 }
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
32 editor = {
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
33 title = "Text Editor and JSON"
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
34 content = function()
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
35 %>
42
84b97e86f4db learn - editor
Franklin Schmidt <fschmidt@gmail.com>
parents: 41
diff changeset
36 <p>A text editor is a basic tool for reactionary programmers. We use simple flexible tools. Modern scum use an <a href="https://en.wikipedia.org/wiki/Integrated_development_environment">IDE</a> which is big, <a href="http://www.mikraite.org/Changed-my-mind-about-IDE-s-tp2769.html">complicated</a>, and inflexible. We don't use such tools.</p>
84b97e86f4db learn - editor
Franklin Schmidt <fschmidt@gmail.com>
parents: 41
diff changeset
37
84b97e86f4db learn - editor
Franklin Schmidt <fschmidt@gmail.com>
parents: 41
diff changeset
38 <p>I reviewed the available text editors and I think <a href="https://www.sublimetext.com/">Sublime Text</a> is the best one available. So please download it and learn how it works.</p>
84b97e86f4db learn - editor
Franklin Schmidt <fschmidt@gmail.com>
parents: 41
diff changeset
39
43
Franklin Schmidt <fschmidt@gmail.com>
parents: 42
diff changeset
40 <p><a href="https://en.wikipedia.org/wiki/JSON">JSON</a> is the most popular text data format. I think JSON was the last good programming idea from modern culture, developed around 2001, before modern culture became fully depraved. Do your own research on JSON to understand it. It is fairly simple.</p>
42
84b97e86f4db learn - editor
Franklin Schmidt <fschmidt@gmail.com>
parents: 41
diff changeset
41
44
5b4d5cf453a8 start bash
Franklin Schmidt <fschmidt@gmail.com>
parents: 43
diff changeset
42 <p>I paired Sublime Text with JSON because Sublime Text uses JSON files for its <a href="https://www.sublimetext.com/docs/settings.html">settings</a>. (Actually not quite pure JSON because it includes comments which are lines starting with <code>//</code>.) Experiment with Sublime Text settings to learn more about both Sublime Text and JSON.</p>
40
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
43 <%
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
44 end
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
45 }
41
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
46 bash = {
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
47 title = "Bash - Command Line Shell"
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
48 content = function()
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
49 %>
44
5b4d5cf453a8 start bash
Franklin Schmidt <fschmidt@gmail.com>
parents: 43
diff changeset
50 <p><a href="bash.html">Bash</a> is the other basic tool for reactionary programmers. Learning Bash requires both reading, to understand the concepts, and practice. Try to use Bash as much as possible instead of using the GUI so that you get practice using it.</p>
5b4d5cf453a8 start bash
Franklin Schmidt <fschmidt@gmail.com>
parents: 43
diff changeset
51
45
14518d772090 start learn_bash
Franklin Schmidt <fschmidt@gmail.com>
parents: 44
diff changeset
52 <p>I was hoping to just reference existing Bash tutorials in this lesson, but they are all horrible, so I am writing my own. So for this lesson, read <a href="learn_bash.html">my tutorial</a> which is currently a work in progress.</p>
41
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
53 <%
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
54 end
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
55 }
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
56 hg = {
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
57 title = "Mercurial - Source Control"
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
58 content = function()
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
59 %>
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
60 <p>later</p>
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
61 <%
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
62 end
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
63 }
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
64 html = {
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
65 title = "HTML and CSS"
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
66 content = function()
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
67 %>
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
68 <p>later</p>
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
69 <%
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
70 end
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
71 }
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
72 js = {
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
73 title = "JavaScript"
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
74 content = function()
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
75 %>
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
76 <p>later</p>
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
77 <%
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
78 end
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
79 }
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
80 luan = {
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
81 title = "Luan"
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
82 content = function()
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
83 %>
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
84 <p>later</p>
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
85 <%
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
86 end
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
87 }
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
88 http = {
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
89 title = "HTTP"
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
90 content = function()
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
91 %>
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
92 <p>later</p>
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
93 <%
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
94 end
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
95 }
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
96 java = {
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
97 title = "Java 8"
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
98 content = function()
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
99 %>
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
100 <p>later</p>
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
101 <%
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
102 end
fbf2a8deee98 learn minor
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
103 }
40
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
104 }
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
105
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
106
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
107 local function show_toc(content)
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
108 %>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
109 <ul>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
110 <%
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
111 for id, info in pairs(content) do
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
112 %>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
113 <li><a id="c_<%=id%>" href="#<%=id%>"><%=info.title%></a></li>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
114 <%
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
115 end
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
116 %>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
117 </ul>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
118 <%
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
119 end
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
120
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
121 local function show_content(content,h)
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
122 for id, info in pairs(content) do
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
123 %>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
124 <div heading>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
125 <h<%=h%>><a id="<%=id%>" href="#<%=id%>"><%=info.title%></a></h<%=h%>>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
126 <a href="#c_<%=id%>">contents</a>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
127 </div>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
128 <%
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
129 info.content()
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
130 end
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
131 end
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
132
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
133 return function()
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
134 Io.stdout = Http.response.text_writer()
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
135 %>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
136 <!doctype html>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
137 <html>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
138 <head>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
139 <% head() %>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
140 <title>Learn Reactionary Programming</title>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
141 </head>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
142 <body>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
143 <% header() %>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
144 <div content>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
145 <h1><a href="learn.html">Learn Reactionary Programming</a></h1>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
146 <hr>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
147 <h2>Contents</h2>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
148 <div toc>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
149 <% show_toc(content) %>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
150 </div>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
151 <hr>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
152 <% show_content(content,2) %>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
153 </div>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
154 </body>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
155 </html>
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
156 <%
ebab99118e19 add learn.html
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
157 end