Browse Source

fiddling with typography & web/ text

Brennen Bearnes 4 years ago
parent
commit
655d9413f5
5 changed files with 141 additions and 99 deletions
  1. 7
    7
      general_purpose/index.md
  2. 81
    56
      index.html
  3. 3
    3
      literary_environment/index.md
  4. 2
    2
      programmerthink/index.md
  5. 48
    31
      web/index.md

+ 7
- 7
general_purpose/index.md View File

@@ -10,15 +10,15 @@ enough be skipped.  It's more in the way of philosophical rambling than
10 10
 concrete instruction, and will be of most use to those with an existing
11 11
 background in writing code.
12 12
 
13
--> * <-
13
+->  <-
14 14
 
15 15
 If you've used computers for more than a few years, you're probably viscerally
16 16
 aware that most software is fragile and most systems decay.  In the time since
17 17
 I took my first tentative steps into the little world of a computer (a friend's
18 18
 dad's unidentifiable gaming machine, my own father's blue monochrome Zenith
19 19
 laptop, the Apple II) the churn has been overwhelming.  By now I've learned my
20
-way around vastly more software -- operating systems, programming languages and
21
-development environments, games, editors, chat clients, mail systems -- than I
20
+way around vastly more software --- operating systems, programming languages and
21
+development environments, games, editors, chat clients, mail systems --- than I
22 22
 presently could use if I wanted to.  Most of it has gone the way of some
23 23
 ancient civilization, surviving (if at all) only in faint, half-understood
24 24
 cultural echoes and occasional museum-piece displays.  Every user of technology
@@ -34,7 +34,7 @@ technological dominance ca. 2014 of companies like Apple, Google, and Facebook.
34 34
 
35 35
 Why is this, exactly?
36 36
 
37
--> * <-
37
+->  <-
38 38
 
39 39
 As I've said (and hopefully shown), the commands you write in your shell
40 40
 are essentially little programs.  Like other programs, they can be stored
@@ -71,7 +71,7 @@ about, in fact, is putting a file (or three) in a particular place.  And this
71 71
 is in keeping with a basic insight of Unix:  Pieces of software that do one
72 72
 very simple thing generalize well.  Good command line tools are like a hex
73 73
 wrench, a hammer, a utility knife:  They embody knowledge of turning, of
74
-striking, of cutting -- and with this kind of knowledge at hand, the user can
74
+striking, of cutting --- and with this kind of knowledge at hand, the user can
75 75
 change the world even though no individual tool is made with complete knowledge
76 76
 of the world as a whole.  There's a lot of power in the accumulation of small
77 77
 competencies.
@@ -86,7 +86,7 @@ you think about most of these things, they have some very rough edges, but they
86 86
 give otherwise simple tools ways to communicate without becoming
87 87
 super-complicated along the way.
88 88
 
89
--> * <-
89
+->  <-
90 90
 
91 91
 What is the command line?
92 92
 
@@ -94,7 +94,7 @@ The command line is an environment of tool use.
94 94
 
95 95
 So are kitchens, workshops, libraries, and programming languages.
96 96
 
97
--> * <-
97
+->  <-
98 98
 
99 99
 Here's a confession:  I don't like writing shell scripts very much, and I
100 100
 can't blame anyone else for feeling the same way.

+ 81
- 56
index.html View File

@@ -101,11 +101,12 @@ mirror</a>, and welcome feedback there.</p>
101 101
 <li><a href="#wdiff">wdiff</a></li>
102 102
 </ul>
103 103
 </li>
104
-<li><a href="#the-internet-for-humans-and-how-the-command-line-can-help">7. the internet for humans, and how the command line can help</a>
104
+<li><a href="#the-command-line-and-the-web">7. the command line and the web</a>
105 105
 
106 106
 <ul>
107 107
 <li><a href="#reading-the-web">reading the web</a></li>
108 108
 <li><a href="#writing-the-web">writing the web</a></li>
109
+<li><a href="#writing-the-web-easier">writing the web, easier</a></li>
109 110
 </ul>
110 111
 </li>
111 112
 <li><a href="#further-reading">8. further reading</a></li>
@@ -449,7 +450,7 @@ Jo Walton
449 450
 <!-- end -->
450 451
 
451 452
 
452
-<p>But there&rsquo;s another approach to this &ndash; <code>sort</code> is good at only displaying a line
453
+<p>But there&rsquo;s another approach to this &mdash; <code>sort</code> is good at only displaying a line
453 454
 once, but suppose we wanted to see a count of how many different lists an
454 455
 author shows up on?  <code>sort</code> doesn&rsquo;t do that, but a command called <code>uniq</code> does,
455 456
 if you give it the option <code>-c</code> for <strong>c</strong>ount.</p>
@@ -535,7 +536,7 @@ Vanessa Veselka
535 536
 
536 537
 
537 538
 <p>I like to think of the <code>&gt;</code> as looking like a little funnel.  It can be
538
-dangerous &ndash; you should always make sure that you&rsquo;re not going to clobber
539
+dangerous &mdash; you should always make sure that you&rsquo;re not going to clobber
539 540
 an existing file you actually want to keep.</p>
540 541
 
541 542
 <p>If you want to tack more stuff on to the end of an existing file, you can use
@@ -674,7 +675,10 @@ bunzip2 (1)          - a block-sorting file compressor, v1.0.6
674 675
 bzip2 (1)            - a block-sorting file compressor, v1.0.6
675 676
 comm (1)             - compare two sorted files line by line
676 677
 sort (1)             - sort lines of text files
678
+sq (1)               - squeeze or unsqueeze a sorted word list
679
+texindex (1)         - sort Texinfo index files
677 680
 tsort (1)            - perform topological sort
681
+unsq (1)             - squeeze or unsqueeze a sorted word list
678 682
 </code></pre>
679 683
 
680 684
 <!-- end -->
@@ -870,7 +874,7 @@ delimited by spaces?  It turns out that if you don&rsquo;t use <code>-d</code>,
870 874
 to using tab characters for a delimiter.</p>
871 875
 
872 876
 <p>Tab characters are sort of weird little animals.  You can&rsquo;t usually <em>see</em> them
873
-directly &ndash; they&rsquo;re like a space character that takes up more than one space
877
+directly &mdash; they&rsquo;re like a space character that takes up more than one space
874 878
 when displayed.  By convention, one tab is usually rendered as 8 spaces, but
875 879
 it&rsquo;s up to the software that&rsquo;s displaying the character what it wants to do.</p>
876 880
 
@@ -1455,8 +1459,8 @@ the same tools for other problems and other data.</p>
1455 1459
 
1456 1460
 <p style="text-align:center;"> ★</p>
1457 1461
 
1458
-<p>When I first started writing stuff on the web, I edited a page &ndash; a single HTML
1459
-file &ndash; by hand.  When the entries on my nascent blog got old, I manually
1462
+<p>When I first started writing stuff on the web, I edited a page &mdash; a single HTML
1463
+file &mdash; by hand.  When the entries on my nascent blog got old, I manually
1460 1464
 cut-and-pasted them to archive files with names like <code>old_main97.html</code>, which
1461 1465
 held all of the stuff I&rsquo;d written in 1997.</p>
1462 1466
 
@@ -1563,18 +1567,18 @@ filenames, but I wind up using it quite a bit.</p>
1563 1567
 
1564 1568
 
1565 1569
 <pre><code>$ find ~/p1k3/archives/2012/ -type f | xargs perl -ne 'print "$1\n" if m{&lt;h2&gt;(.*?)&lt;/h2&gt;}'
1566
-pursuit
1570
+A miracle, in fact, means work
1571
+&lt;em&gt;technical notes for late october&lt;/em&gt;, or &lt;em&gt;it gets dork out earlier these days&lt;/em&gt;
1572
+more observations on gear nerdery &amp;amp; utility fetishism
1573
+timebinding animals
1567 1574
 fragment
1568 1575
 this poem again
1569
-i'll do better next time
1570
-timebinding animals
1571
-more observations on gear nerdery &amp;amp; utility fetishism
1576
+pursuit
1572 1577
 thrift
1573
-A miracle, in fact, means work
1574
-&lt;em&gt;technical notes for late october&lt;/em&gt;, or &lt;em&gt;it gets dork out earlier these days&lt;/em&gt;
1575
-radio
1578
+i'll do better next time
1576 1579
 light enough to travel
1577 1580
 12:06am
1581
+radio
1578 1582
 "figures like Heinlein and Gingrich"
1579 1583
 </code></pre>
1580 1584
 
@@ -1845,7 +1849,7 @@ important:</p>
1845 1849
 
1846 1850
 
1847 1851
 <pre><code>$ ls -l okpoems
1848
--rwxrwxr-x 1 brennen brennen 163 Apr 19 00:08 okpoems
1852
+-rwxr-xr-x 1 brennen brennen 163 Apr 17 15:16 okpoems
1849 1853
 </code></pre>
1850 1854
 
1851 1855
 <!-- end -->
@@ -1865,9 +1869,8 @@ accomplish this by saying something like:</p>
1865 1869
 
1866 1870
 
1867 1871
 <pre><code>$ ./okpoems
1868
-/home/brennen/p1k3/archives/2013/2/9
1869 1872
 /home/brennen/p1k3/archives/2012/3/17
1870
-/home/brennen/p1k3/archives/2012/3/26
1873
+/home/brennen/p1k3/archives/2012/2/9
1871 1874
 </code></pre>
1872 1875
 
1873 1876
 <!-- end -->
@@ -2068,15 +2071,15 @@ enough be skipped.  It&rsquo;s more in the way of philosophical rambling than
2068 2071
 concrete instruction, and will be of most use to those with an existing
2069 2072
 background in writing code.</p>
2070 2073
 
2071
-<p style="text-align:center;"> *</p>
2074
+<p style="text-align:center;"> </p>
2072 2075
 
2073 2076
 <p>If you&rsquo;ve used computers for more than a few years, you&rsquo;re probably viscerally
2074 2077
 aware that most software is fragile and most systems decay.  In the time since
2075 2078
 I took my first tentative steps into the little world of a computer (a friend&rsquo;s
2076 2079
 dad&rsquo;s unidentifiable gaming machine, my own father&rsquo;s blue monochrome Zenith
2077 2080
 laptop, the Apple II) the churn has been overwhelming.  By now I&rsquo;ve learned my
2078
-way around vastly more software &ndash; operating systems, programming languages and
2079
-development environments, games, editors, chat clients, mail systems &ndash; than I
2081
+way around vastly more software &mdash; operating systems, programming languages and
2082
+development environments, games, editors, chat clients, mail systems &mdash; than I
2080 2083
 presently could use if I wanted to.  Most of it has gone the way of some
2081 2084
 ancient civilization, surviving (if at all) only in faint, half-understood
2082 2085
 cultural echoes and occasional museum-piece displays.  Every user of technology
@@ -2092,7 +2095,7 @@ technological dominance ca. 2014 of companies like Apple, Google, and Facebook.<
2092 2095
 
2093 2096
 <p>Why is this, exactly?</p>
2094 2097
 
2095
-<p style="text-align:center;"> *</p>
2098
+<p style="text-align:center;"> </p>
2096 2099
 
2097 2100
 <p>As I&rsquo;ve said (and hopefully shown), the commands you write in your shell
2098 2101
 are essentially little programs.  Like other programs, they can be stored
@@ -2132,7 +2135,7 @@ about, in fact, is putting a file (or three) in a particular place.  And this
2132 2135
 is in keeping with a basic insight of Unix:  Pieces of software that do one
2133 2136
 very simple thing generalize well.  Good command line tools are like a hex
2134 2137
 wrench, a hammer, a utility knife:  They embody knowledge of turning, of
2135
-striking, of cutting &ndash; and with this kind of knowledge at hand, the user can
2138
+striking, of cutting &mdash; and with this kind of knowledge at hand, the user can
2136 2139
 change the world even though no individual tool is made with complete knowledge
2137 2140
 of the world as a whole.  There&rsquo;s a lot of power in the accumulation of small
2138 2141
 competencies.</p>
@@ -2147,7 +2150,7 @@ you think about most of these things, they have some very rough edges, but they
2147 2150
 give otherwise simple tools ways to communicate without becoming
2148 2151
 super-complicated along the way.</p>
2149 2152
 
2150
-<p style="text-align:center;"> *</p>
2153
+<p style="text-align:center;"> </p>
2151 2154
 
2152 2155
 <p>What is the command line?</p>
2153 2156
 
@@ -2155,7 +2158,7 @@ super-complicated along the way.</p>
2155 2158
 
2156 2159
 <p>So are kitchens, workshops, libraries, and programming languages.</p>
2157 2160
 
2158
-<p style="text-align:center;"> *</p>
2161
+<p style="text-align:center;"> </p>
2159 2162
 
2160 2163
 <p>Here&rsquo;s a confession:  I don&rsquo;t like writing shell scripts very much, and I
2161 2164
 can&rsquo;t blame anyone else for feeling the same way.</p>
@@ -2356,8 +2359,8 @@ one of these with <code>diff -u</code>:</p>
2356 2359
 
2357 2360
 
2358 2361
 <pre><code>$ diff -u ../script/okpoems ../script/findprop
2359
---- ../script/okpoems   2014-04-19 00:08:03.321230818 -0600
2360
-+++ ../script/findprop  2014-04-21 21:51:29.360846449 -0600
2362
+--- ../script/okpoems   2014-04-17 15:16:59.852962836 -0600
2363
++++ ../script/findprop  2014-05-12 15:50:27.358501804 -0600
2361 2364
 @@ -1,7 +1,13 @@
2362 2365
  #!/bin/bash
2363 2366
 
@@ -2492,8 +2495,8 @@ called Night.  And there was evening and there was morning, the first day.
2492 2495
 
2493 2496
 
2494 2497
 <pre><code>$ diff -u genesis_nkj genesis_nrsv
2495
---- genesis_nkj 2014-05-11 16:28:29.692508461 -0600
2496
-+++ genesis_nrsv    2014-05-11 16:28:29.744508459 -0600
2498
+--- genesis_nkj 2014-05-12 15:50:27.346501744 -0600
2499
++++ genesis_nrsv    2014-05-12 15:50:27.346501744 -0600
2497 2500
 @@ -1,6 +1,6 @@
2498 2501
 -In the beginning God created the heavens and the earth.  The earth was without
2499 2502
 -form, and void; and darkness was on the face of the deep.  And the Spirit of
@@ -2529,8 +2532,8 @@ one-line-per-verse, and try again:</p>
2529 2532
 
2530 2533
 
2531 2534
 <pre><code>$ diff -u genesis_nkj_by_verse genesis_nrsv_by_verse
2532
---- genesis_nkj_by_verse    2014-05-11 16:51:14.312457198 -0600
2533
-+++ genesis_nrsv_by_verse   2014-05-11 16:53:02.484453134 -0600
2535
+--- genesis_nkj_by_verse    2014-05-12 15:50:27.346501744 -0600
2536
++++ genesis_nrsv_by_verse   2014-05-12 15:50:27.346501744 -0600
2534 2537
 @@ -1,5 +1,5 @@
2535 2538
 -In the beginning God created the heavens and the earth.
2536 2539
 -The earth was without form, and void; and darkness was on the face of the deep.  And the Spirit of God was hovering over the face of the waters.
@@ -2597,13 +2600,11 @@ called Night.  <del>So the</del>  <ins>And there was</ins> evening and <del>the
2597 2600
 
2598 2601
 <hr />
2599 2602
 
2600
-<p>lynx: Invalid Option: -linksonly</p>
2601
-
2602
-<h1><a name=the-internet-for-humans-and-how-the-command-line-can-help href=#the-internet-for-humans-and-how-the-command-line-can-help>#</a> 7. the internet for humans, and how the command line can help</h1>
2603
+<h1><a name=the-command-line-and-the-web href=#the-command-line-and-the-web>#</a> 7. the command line and the web</h1>
2603 2604
 
2604 2605
 <p>Web browsers are really complicated these days.  They&rsquo;re full of rendering
2605 2606
 engines, audio and video players, programming languages, development tools,
2606
-databases &ndash; you name it, and there&rsquo;s a fair chance it&rsquo;s in there somewhere.
2607
+databases &mdash; you name it, and there&rsquo;s a fair chance it&rsquo;s in there somewhere.
2607 2608
 The modern web browser is kitchen sink software, and to make matters worse, it
2608 2609
 is <em>totally surrounded</em> by technobabble.  It can take <em>years</em> to come to terms
2609 2610
 with the ocean of words about web stuff and sort out the meaningful ones from
@@ -2640,8 +2641,8 @@ your browser sends some text to the server and waits to see what it says back.</
2640 2641
 &lt;/html&gt;
2641 2642
 </code></pre>
2642 2643
 
2643
-<p><code>curl</code> is a program with lots and lots of features &ndash; it too is a little bit of
2644
-a kitchen sink &ndash; but it has one core purpose, which is to grab things from
2644
+<p><code>curl</code> is a program with lots and lots of features &mdash; it too is a little bit of
2645
+a kitchen sink &mdash; but it has one core purpose, which is to grab things from
2645 2646
 URLs and spit them back out.  It&rsquo;s a little bit like <code>cat</code> for things on the
2646 2647
 web.  Try the above command with just about any URL you can think of, and
2647 2648
 you&rsquo;ll probably get <em>something</em> back.  Let&rsquo;s try this book:</p>
@@ -2659,11 +2660,10 @@ you&rsquo;ll probably get <em>something</em> back.  Let&rsquo;s try this book:</
2659 2660
 &lt;body&gt;
2660 2661
 </code></pre>
2661 2662
 
2662
-<p><code>hello_world.html</code> and <code>p1k3.com/userland-book</code> are both <strong>H</strong>yper<strong>T</strong>ext
2663
-<strong>M</strong>arkup <strong>L</strong>anguage.  HTML has been around for quite a while now, and it&rsquo;s
2664
-undergone a huge amount of politicking and overengineering, but at heart it
2665
-still looks a lot <a href="http://info.cern.ch/hypertext/WWW/TheProject.html">like it did in
2666
-1991</a>.</p>
2663
+<p><code>hello_world.html</code> and <code>userland-book</code> are both HyperText Markup Language.
2664
+HTML has been around for quite a while now, and it&rsquo;s undergone a huge amount of
2665
+politicking in the last 20 years, but at heart it still looks a lot <a href="http://info.cern.ch/hypertext/WWW/TheProject.html">like it
2666
+did in 1991</a>.</p>
2667 2667
 
2668 2668
 <p>The basic idea is that the contents of a web page are marked up with tags.
2669 2669
 A tag looks like this:</p>
@@ -2675,15 +2675,23 @@ A tag looks like this:</p>
2675 2675
  `-opening tag
2676 2676
 </code></pre>
2677 2677
 
2678
-<p>Most HTML these days is generated by software that pulls stuff out of databases
2679
-and stitches it together into something your browser will recognize, but it&rsquo;s
2680
-still entirely possible to write simple HTML documents in your text editor of
2681
-choice, and tools that work with text can operate on HTML documents.</p>
2678
+<p>Sometimes you&rsquo;ll see tags with what are known as &ldquo;attributes&rdquo;:</p>
2679
+
2680
+<pre><code>&lt;a href="http://p1k3.com/userland-book"&gt;userland&lt;/a&gt;
2681
+</code></pre>
2682
+
2683
+<p>This is how links are written in HTML.  <code>href="..."</code> tells the browser where to
2684
+go when the user clicks on &ldquo;userland&rdquo;.</p>
2685
+
2686
+<p>Tags are a way to describe not so much what something should <em>look like</em> as
2687
+what something <em>means</em>.  Browsers are, in large part, big collections of
2688
+knowledge about the meanings of tags and ways to represent those meanings.</p>
2682 2689
 
2683
-<p>While the browser you use day-to-day is (probably) a graphical interface which
2690
+<p>While the browser you use day-to-day is (probably) a graphical interface and
2684 2691
 does all sorts of things impossible to render in a terminal, some of the
2685
-earliest web browsers were entirely text-based, and options still exist.  Lynx,
2686
-which originated at the University of Kansas in the early 1990s, still works:</p>
2692
+earliest web browsers were entirely text-based, and text-mode browsers still
2693
+exist.  Lynx, which originated at the University of Kansas in the early 1990s,
2694
+is still actively maintained:</p>
2687 2695
 
2688 2696
 <pre><code>$ lynx -dump 'http://p1k3.com/userland-book/' | head
2689 2697
                                     userland
@@ -2697,12 +2705,12 @@ which originated at the University of Kansas in the early 1990s, still works:</p
2697 2705
    with an audience of mixed technical background.
2698 2706
 </code></pre>
2699 2707
 
2700
-<p>If you invoke Lynx <em>without</em> the <code>-dump</code> option, it&rsquo;ll start up in interactive
2701
-mode, and you can navigate between links with the arrow keys.  <code>-dump</code> spits a
2702
-rendered version of the page to standard output, with links annotated as
2703
-<code>[1]</code>-style footnotes and printed at the bottom of the output.  Another useful
2704
-option here is <code>-listonly</code>, which will output just the list of links contained
2705
-within a page:</p>
2708
+<p>If you invoke Lynx without any options, it&rsquo;ll start up in interactive mode, and
2709
+you can navigate between links with the arrow keys.  <code>-dump</code> spits a rendered
2710
+version of a page to standard output, with links annotated as <code>[1]</code>-style
2711
+footnotes and printed at the bottom of the output.  Another useful option here
2712
+is <code>-listonly</code>, which will print just the list of links contained within a
2713
+page:</p>
2706 2714
 
2707 2715
 <pre><code>$ lynx -dump -listonly 'http://p1k3.com/userland-book/' | head
2708 2716
 
@@ -2717,8 +2725,8 @@ References
2717 2725
   10. http://p1k3.com/userland-book/#copying
2718 2726
 </code></pre>
2719 2727
 
2720
-<p>Another option is w3m, which copes a little more gracefully with some of
2721
-the complexities of modern web layout.</p>
2728
+<p>An alternative to Lynx is w3m, which copes a little more gracefully with of the
2729
+complexities of modern web layout.</p>
2722 2730
 
2723 2731
 <pre><code>$ w3m -dump 'http://p1k3.com/userland-book/' | head
2724 2732
 userland
@@ -2733,9 +2741,26 @@ hook for talking about the tools I use every day with an audience of mixed
2733 2741
 technical background.
2734 2742
 </code></pre>
2735 2743
 
2744
+<p>Neither of these options are going to replace enormously capable applications
2745
+like Chrome or Firefox for most users, but they have their place in the toolbox,
2746
+and help to demonstrate how the web is built (in part) on principles we&rsquo;ve already
2747
+seen at work.</p>
2748
+
2736 2749
 <h2><a name=writing-the-web href=#writing-the-web>#</a> writing the web</h2>
2737 2750
 
2738
-<p>{to come}</p>
2751
+<p>Most of the web that you interact with is generated by software that pulls data
2752
+out of databases and stitches it together into something your browser will
2753
+recognize, but it&rsquo;s still entirely possible to write complete HTML documents in
2754
+your text editor of choice.</p>
2755
+
2756
+<p>{more to come}</p>
2757
+
2758
+<h2><a name=writing-the-web-easier href=#writing-the-web-easier>#</a> writing the web, easier</h2>
2759
+
2760
+<p>I&rsquo;m pretty comfortable writing HTML by hand.  It&rsquo;s part of my day job, and I&rsquo;ve
2761
+been doing it for quite a while now.</p>
2762
+
2763
+<p>{more to come}</p>
2739 2764
 
2740 2765
 <hr />
2741 2766
 

+ 3
- 3
literary_environment/index.md View File

@@ -312,7 +312,7 @@ authors.  We can make sure our list doesn't contain repeating lines by using
312 312
 
313 313
 <!-- end -->
314 314
 
315
-But there's another approach to this -- `sort` is good at only displaying a line
315
+But there's another approach to this --- `sort` is good at only displaying a line
316 316
 once, but suppose we wanted to see a count of how many different lists an
317 317
 author shows up on?  `sort` doesn't do that, but a command called `uniq` does,
318 318
 if you give it the option `-c` for **c**ount.
@@ -388,7 +388,7 @@ Check it out:
388 388
 <!-- end -->
389 389
 
390 390
 I like to think of the `>` as looking like a little funnel.  It can be
391
-dangerous -- you should always make sure that you're not going to clobber
391
+dangerous --- you should always make sure that you're not going to clobber
392 392
 an existing file you actually want to keep.
393 393
 
394 394
 If you want to tack more stuff on to the end of an existing file, you can use
@@ -678,7 +678,7 @@ delimited by spaces?  It turns out that if you don't use `-d`, `cut` defaults
678 678
 to using tab characters for a delimiter.
679 679
 
680 680
 Tab characters are sort of weird little animals.  You can't usually _see_ them
681
-directly -- they're like a space character that takes up more than one space
681
+directly --- they're like a space character that takes up more than one space
682 682
 when displayed.  By convention, one tab is usually rendered as 8 spaces, but
683 683
 it's up to the software that's displaying the character what it wants to do.
684 684
 

+ 2
- 2
programmerthink/index.md View File

@@ -47,8 +47,8 @@ the same tools for other problems and other data.
47 47
 
48 48
 -> ★ <-
49 49
 
50
-When I first started writing stuff on the web, I edited a page -- a single HTML
51
-file -- by hand.  When the entries on my nascent blog got old, I manually
50
+When I first started writing stuff on the web, I edited a page --- a single HTML
51
+file --- by hand.  When the entries on my nascent blog got old, I manually
52 52
 cut-and-pasted them to archive files with names like `old_main97.html`, which
53 53
 held all of the stuff I'd written in 1997.
54 54
 

+ 48
- 31
web/index.md View File

@@ -1,10 +1,9 @@
1
-lynx: Invalid Option: -linksonly
2
-7. the internet for humans, and how the command line can help
3
-=============================================================
1
+7. the command line and the web
2
+===============================
4 3
 
5 4
 Web browsers are really complicated these days.  They're full of rendering
6 5
 engines, audio and video players, programming languages, development tools,
7
-databases -- you name it, and there's a fair chance it's in there somewhere.
6
+databases --- you name it, and there's a fair chance it's in there somewhere.
8 7
 The modern web browser is kitchen sink software, and to make matters worse, it
9 8
 is _totally surrounded_ by technobabble.  It can take _years_ to come to terms
10 9
 with the ocean of words about web stuff and sort out the meaningful ones from
@@ -41,8 +40,8 @@ Let's illustrate this.  I've written a really simple web page that lives at
41 40
       </body>
42 41
     </html>
43 42
 
44
-`curl` is a program with lots and lots of features -- it too is a little bit of
45
-a kitchen sink -- but it has one core purpose, which is to grab things from
43
+`curl` is a program with lots and lots of features --- it too is a little bit of
44
+a kitchen sink --- but it has one core purpose, which is to grab things from
46 45
 URLs and spit them back out.  It's a little bit like `cat` for things on the
47 46
 web.  Try the above command with just about any URL you can think of, and
48 47
 you'll probably get _something_ back.  Let's try this book:
@@ -59,11 +58,10 @@ you'll probably get _something_ back.  Let's try this book:
59 58
     
60 59
     <body>
61 60
 
62
-`hello_world.html` and `p1k3.com/userland-book` are both **H**yper**T**ext
63
-**M**arkup **L**anguage.  HTML has been around for quite a while now, and it's
64
-undergone a huge amount of politicking and overengineering, but at heart it
65
-still looks a lot [like it did in
66
-1991](http://info.cern.ch/hypertext/WWW/TheProject.html).
61
+`hello_world.html` and `userland-book` are both HyperText Markup Language.
62
+HTML has been around for quite a while now, and it's undergone a huge amount of
63
+politicking in the last 20 years, but at heart it still looks a lot [like it
64
+did in 1991](http://info.cern.ch/hypertext/WWW/TheProject.html).
67 65
 
68 66
 The basic idea is that the contents of a web page are marked up with tags.
69 67
 A tag looks like this:
@@ -74,15 +72,22 @@ A tag looks like this:
74 72
      |                  `- closing tag
75 73
      `-opening tag
76 74
 
77
-Most HTML these days is generated by software that pulls stuff out of databases
78
-and stitches it together into something your browser will recognize, but it's
79
-still entirely possible to write simple HTML documents in your text editor of
80
-choice, and tools that work with text can operate on HTML documents.
75
+Sometimes you'll see tags with what are known as "attributes":
81 76
 
82
-While the browser you use day-to-day is (probably) a graphical interface which
77
+    <a href="http://p1k3.com/userland-book">userland</a>
78
+
79
+This is how links are written in HTML.  `href="..."` tells the browser where to
80
+go when the user clicks on "userland".
81
+
82
+Tags are a way to describe not so much what something should _look like_ as
83
+what something _means_.  Browsers are, in large part, big collections of
84
+knowledge about the meanings of tags and ways to represent those meanings.
85
+
86
+While the browser you use day-to-day is (probably) a graphical interface and
83 87
 does all sorts of things impossible to render in a terminal, some of the
84
-earliest web browsers were entirely text-based, and options still exist.  Lynx,
85
-which originated at the University of Kansas in the early 1990s, still works:
88
+earliest web browsers were entirely text-based, and text-mode browsers still
89
+exist.  Lynx, which originated at the University of Kansas in the early 1990s,
90
+is still actively maintained:
86 91
 
87 92
     $ lynx -dump 'http://p1k3.com/userland-book/' | head
88 93
                                         userland
@@ -95,12 +100,12 @@ which originated at the University of Kansas in the early 1990s, still works:
95 100
        struck me as a good hook for talking about the tools I use every day
96 101
        with an audience of mixed technical background.
97 102
     
98
-If you invoke Lynx _without_ the `-dump` option, it'll start up in interactive
99
-mode, and you can navigate between links with the arrow keys.  `-dump` spits a
100
-rendered version of the page to standard output, with links annotated as
101
-`[1]`-style footnotes and printed at the bottom of the output.  Another useful
102
-option here is `-listonly`, which will output just the list of links contained
103
-within a page:
103
+If you invoke Lynx without any options, it'll start up in interactive mode, and
104
+you can navigate between links with the arrow keys.  `-dump` spits a rendered
105
+version of a page to standard output, with links annotated as `[1]`-style
106
+footnotes and printed at the bottom of the output.  Another useful option here
107
+is `-listonly`, which will print just the list of links contained within a
108
+page:
104 109
 
105 110
     $ lynx -dump -listonly 'http://p1k3.com/userland-book/' | head
106 111
     
@@ -114,8 +119,8 @@ within a page:
114 119
        9. http://p1k3.com/userland-book/#a-book-about-the-command-line-for-humans
115 120
       10. http://p1k3.com/userland-book/#copying
116 121
 
117
-Another option is w3m, which copes a little more gracefully with some of
118
-the complexities of modern web layout.
122
+An alternative to Lynx is w3m, which copes a little more gracefully with of the
123
+complexities of modern web layout.
119 124
 
120 125
     $ w3m -dump 'http://p1k3.com/userland-book/' | head
121 126
     userland
@@ -129,13 +134,25 @@ the complexities of modern web layout.
129 134
     hook for talking about the tools I use every day with an audience of mixed
130 135
     technical background.
131 136
 
137
+Neither of these options are going to replace enormously capable applications
138
+like Chrome or Firefox for most users, but they have their place in the toolbox,
139
+and help to demonstrate how the web is built (in part) on principles we've already
140
+seen at work.
141
+
132 142
 writing the web
133 143
 ---------------
134 144
 
135
-I'm pretty comfortable writing HTML by hand.  I've been doing it for a long
136
-time, and having a decent grasp of how it works and how to express myself in it
137
-is a pretty fundamental requirement of my day job.  That doesn't mean I like
145
+Most of the web that you interact with is generated by software that pulls data
146
+out of databases and stitches it together into something your browser will
147
+recognize, but it's still entirely possible to write complete HTML documents in
148
+your text editor of choice.
149
+
150
+{more to come}
151
+
152
+writing the web, easier
153
+-----------------------
138 154
 
139
-I also spend a lot of time writing prose in text files, and 
155
+I'm pretty comfortable writing HTML by hand.  It's part of my day job, and I've
156
+been doing it for quite a while now.  
140 157
 
141
-{to come}
158
+{more to come}