<?xml version='1.0' encoding='utf-8' ?>

<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>The Mandelbear&apos;s Musings</title>
  <link>https://mdlbear.dreamwidth.org/</link>
  <description>The Mandelbear&apos;s Musings - Dreamwidth Studios</description>
  <lastBuildDate>Tue, 04 Sep 2018 03:42:49 GMT</lastBuildDate>
  <generator>LiveJournal / Dreamwidth Studios</generator>
  <lj:journal>mdlbear</lj:journal>
  <lj:journaltype>personal</lj:journaltype>
  <image>
    <url>https://v2.dreamwidth.org/15740388/505737</url>
    <title>The Mandelbear&apos;s Musings</title>
    <link>https://mdlbear.dreamwidth.org/</link>
    <width>96</width>
    <height>96</height>
  </image>

<item>
  <guid isPermaLink='true'>https://mdlbear.dreamwidth.org/1635180.html</guid>
  <pubDate>Tue, 04 Sep 2018 03:42:49 GMT</pubDate>
  <title>Uploading and showing an image on DW</title>
  <link>https://mdlbear.dreamwidth.org/1635180.html</link>
  <description>&lt;p&gt; This started out in a comment, but I think enough people may be struggling
    with DW&apos;s relatively new image upload feature that it&apos;s worth making it
    into a post.  And it&apos;s a good excuse for posting.

&lt;blockquote&gt;
&lt;p&gt; (aside: The key to all of this is knowing enough about HTML to be able to
    identify the correct URL and create the img tag to refer to it -- it
    probably all looks like black magic to somebody who hasn&apos;t been doing this
    stuff for the last few years.  Don&apos;t expect to get it all on one reading.)

&lt;p&gt; You might also want to know some terminology.  Those things enclosed in
    angle brackets are commonly called &quot;tags&quot;.  The things with a name, an
    equals sign, and something in quotes are called &quot;attributes&quot;.  And single
    and double quotes are identical in effect, but have to match: you can&apos;t
    start with a single and end with a double.
&lt;/p&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt; So -- I uploaded an image; down at the bottom there&apos;s a box labeled Image
    Code.  Copy, paste:
&lt;pre&gt;
  &amp;lt;a href=&apos;https://mdlbear.dreamwidth.org/file/352.jpg&apos;&amp;gt;
     &amp;lt;img src=&apos;https://mdlbear.dreamwidth.org/file/100x100/352.jpg&apos;
         title=&apos;Cat and mouse&apos;
           alt=&apos;Grey tabby cat looking intently at a Logitech mouse.&apos;  /&amp;gt;&amp;lt;/a&amp;gt;
&lt;/pre&gt;

&lt;p&gt; (That&apos;s what it looked like, except that I wrapped the lines to make it
    clearer.)

&lt;p&gt; Looking at that line of HTML I can see that there&apos;s an img tag that, from the
    &lt;code&gt;/100x100/&lt;/code&gt; in its URL, looks like a thumbnail.  It&apos;s wrapped
    in a link -- an &amp;lt;a...&amp;gt tag.  The href attribute is
    &lt;code&gt;https://mdlbear.dreamwidth.org/file/352.jpg&lt;/code&gt;, which ought to be the
    full-sized image, so I&apos;ll get a preview just to make sure... 

&lt;p&gt; Then I clicked the &quot;Preview&quot; button, and it looked like this:
&lt;p&gt;   &lt;a href=&quot;https://mdlbear.dreamwidth.org/file/352.jpg&quot;&gt;
     &lt;img src=&quot;https://mdlbear.dreamwidth.org/file/100x100/352.jpg&quot; title=&quot;Cat and mouse&quot; alt=&quot;Grey tabby cat looking intently at a Logitech mouse.&quot; /&gt;&lt;/a&gt;

&lt;p&gt; Yup.  So &lt;code&gt;https://mdlbear.dreamwidth.org/file/352.jpg&lt;/code&gt; -- the
    &lt;code&gt;href&lt;/code&gt; attribute of the &lt;code&gt;img&lt;/code&gt; tag, is the URL of the
    actual image.  (At that point I could just as well have copied it out of
    the browser&apos;s location bar, since I was already looking at the full-sized
    image.  I didn&apos;t think of that, and just copied it out of the comment I
    was writing.)

&lt;p&gt; I can put that into an &lt;code&gt;img&lt;/code&gt; tag that looks like 
    &lt;pre&gt;&amp;lt:img src=&quot;https://mdlbear.dreamwidth.org/file/352.jpg&quot; width=&quot;512&quot;&amp;gt;&lt;/pre&gt;.

&lt;p&gt; Chrome says (in the page title) that the image is 1024x719, so I&apos;ll try
    cutting it down by adding a &lt;code&gt;width=&quot;512&quot;&lt;/code&gt; attribute.   
    Here we go:
&lt;p&gt; &lt;img src=&quot;https://mdlbear.dreamwidth.org/file/352.jpg&quot; width=&quot;512&quot;&gt; -- purrfect.

&lt;blockquote&gt;
&lt;p&gt; One final aside:  if you&apos;re following along and using a word processor
    that automagically turns quotation marks into matching &lt;q&gt;curly
    quotes&lt;/q&gt;, you need to turn that feature &lt;em&gt;off&lt;/em&gt; when you&apos;re editing
    HTML, because they won&apos;t be recognized as quotes.  If you&apos;re creating your
    post in your browser and you want to enter HTML directly, you need to
    click the &quot;HTML&quot; tab (over on the upper right).  The &quot;Rich Text&quot; setting
    will create HTML automatically and you&apos;ll need to click one of its little
    icons to create an actual image tag.
&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt; Happy hacking!

&lt;p&gt; &lt;em&gt;Another fine post from
    &lt;a href=&quot;https://mdlbear.dreamwidth.org/tag/curmudgeon&quot;&gt;The Computer Curmudgeon&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1635180&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://mdlbear.dreamwidth.org/1635180.html</comments>
  <category>curmudgeon</category>
  <category>blogging</category>
  <category>html</category>
  <category>dw</category>
  <lj:mood>didactic</lj:mood>
  <lj:security>public</lj:security>
  <lj:reply-count>8</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://mdlbear.dreamwidth.org/1624418.html</guid>
  <pubDate>Tue, 19 Jun 2018 23:26:58 GMT</pubDate>
  <title>HTML for Poets:  Some simple magic</title>
  <link>https://mdlbear.dreamwidth.org/1624418.html</link>
  <description>&lt;p&gt; Here are a couple of little tricks that may keep you from tearing your
    hair out in frustration, and in any case will make your posts look
    better.

&lt;p&gt; &lt;strong&gt;Tip the first:  Make beautiful poetry with no effort.&lt;/strong&gt;

&lt;p&gt; There are two obvious ways to post poetry:  enclose it in
    &lt;code&gt;&amp;lt;pre&amp;gt;...&amp;lt;/pre&amp;gt;&lt;/code&gt; tags (which tells the browser that
    it&apos;s preformatted, so it should leave your line breaks alone), or
    tediously add a line break tag -- &lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt; -- to the end of
    every line.  Unfortunately, preformatted text uses a monospaced font,
    which is great for code and &lt;a href=&quot;https://en.wikipedia.org/wiki/Concrete_poetry&quot;&gt;concrete poetry&lt;/a&gt;,
    but really doesn&apos;t look very good.  And adding line breaks is just
    tedious.

&lt;p&gt; There is a third way: use

&lt;blockquote style=&quot;white-space: pre-wrap;&quot;&gt;&amp;lt;blockquote  style=&quot;white-space: pre-wrap;&quot;
&amp;gt;to
   wrap
     your
       poem.
&amp;lt;/blockquote&amp;gt;
&lt;/blockquote&gt;

&lt;p&gt; This tells your browser to keep spaces and line breaks the way you want
    them, but continue using the same font as the rest of your page.

&lt;p&gt; There&apos;s one subtlety: that start tag is pretty long, but if you start your
    poem on the following line there will be an annoying extra blank line at
    the top.  So do what I did up there, and start a new line before the &amp;gt;.
    It turns out that you can replace spaces with newlines anywhere outside of
    quotes.

&lt;p&gt; That brings me to the next tip:

&lt;p&gt; &lt;strong&gt;Tip the Second:  Don&apos;t let your word processor try to
    help.&lt;/strong&gt;

&lt;p&gt; A lot of people compose their blog posts using a word processor, and paste
    them into the &quot;post&quot; form.  If you don&apos;t, and aren&apos;t using some kind of
    posting client that lets you save your work any time you want to, you
    should.  Especially if you have cats.  But there&apos;s a problem.  Word
    processors want to help you create great-looking documents.  And that&apos;s a
    problem if you&apos;re trying to write HTML.

&lt;p&gt; One thing word processors may try to do is to replace all your quotation
    marks with &amp;ldquo;curly&amp;rdquo; quotes (also called &amp;ldquo;smart&amp;rdquo;
    quotes), instead of using &quot;straight&quot; quotes.  That&apos;s great except for when
    you&apos;re trying to enter a link, or one of style attributes I just showed
    you up above.  A browser won&apos;t recognize them.  So instead of

&lt;pre&gt;&lt;a href=&quot;https://steve.savitzky.net&quot;&gt;&amp;lt;a href=&quot;https://steve.savitzky.net&quot;&amp;gt;this&amp;lt;/a&amp;gt;&lt;/a&gt;
&lt;/pre&gt;
&lt;p&gt; you get
&lt;pre&gt;&lt;a href=&quot;“https://steve.savitzky.net”&quot;&gt;&amp;lt;a href=&amp;ldquo;https://steve.savitzky.net&amp;rdquo;&amp;gt;this&amp;lt;/a&amp;gt;&lt;/a&gt;
&lt;/pre&gt;

&lt;p&gt; See the difference?  You may have to zoom in a little.  Hover over the
    links.  You&apos;ll see that your browser thinks that it&apos;s looking at a local
    link, because it doesn&apos;t start with &lt;code&gt;https://&lt;/code&gt;, it starts with
    &lt;code&gt;&amp;ldquo;https://&lt;/code&gt;!  Oops!

&lt;p&gt; Another thing I&apos;ve seen word processors and some other programs do is,
    behind your back, replace &quot;&lt;code&gt;&amp;lt;&lt;/code&gt;&quot; and &quot;&lt;code&gt;&amp;gt;&lt;/code&gt;&quot;
    characters with &quot;&lt;code&gt;&amp;amp;lt;&lt;/code&gt;&quot; and &quot;&lt;code&gt;&amp;amp;gt;&lt;/code&gt;&quot;.
    Those weird things are called &quot;character entities&quot;, and they&apos;re HTML&apos;s way
    of forcing the browser to show something that looks like
    &quot;&lt;code&gt;&amp;lt;&lt;/code&gt;&quot; &lt;em&gt;without&lt;/em&gt; letting it interpret it as part of a
    tag.  That probably isn&apos;t what you wanted, unless you&apos;re trying to write
    math inequalities or an article about how to write HTML.

&lt;p&gt; Yet another problem happens because word processors use proportional
    spacing, so that your post looks to you the way it&apos;s going to look in a
    browser, more or less.  The problem happens because some characters are
    &lt;small&gt;&lt;em&gt;really small&lt;/em&gt;&lt;/small&gt; in proportional-spaced fonts, so it&apos;s
    hard to select exactly the text you wanted to, and easy to overlook stray
    spaces and periods if they get pasted into your links by mistake.

&lt;p&gt; That&apos;s why programmers use text editors with fixed-width fonts, and rely
    on programs like web browsers and LaTeX to make their pages look good when
    you read or print them.

&lt;p&gt; &amp;nbsp;

&lt;p&gt; By the way, I did a little searching and found &lt;a href=&quot;https://mdlbear.dreamwidth.org/444693.html&quot;&gt;The Mandelbear&apos;s Rough
    Guide to HTML&lt;/a&gt;, from back in 2006.  It&apos;s still mostly good advice.

&lt;p&gt; &lt;em&gt;Another fine post from
    &lt;a href=&quot;https://mdlbear.dreamwidth.org/tag/curmudgeon&quot;&gt;The Computer Curmudgeon&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1624418&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://mdlbear.dreamwidth.org/1624418.html</comments>
  <category>computers</category>
  <category>curmudgeon</category>
  <category>web</category>
  <category>html</category>
  <lj:mood>didactic</lj:mood>
  <lj:security>public</lj:security>
  <lj:reply-count>8</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://mdlbear.dreamwidth.org/1618191.html</guid>
  <pubDate>Fri, 04 May 2018 02:41:34 GMT</pubDate>
  <title>HTML for Poets: The Joy of Static Sites</title>
  <link>https://mdlbear.dreamwidth.org/1618191.html</link>
  <description>

&lt;p&gt; Recently I read a couple of blog posts that set me thinking in some
    interesting directions.  Like most of the things I find on LinkedIn, they
    were mostly a little annoying, with a few good points.  For example,
    &lt;cite&gt;&lt;a href=&quot;https://cms2cms.com/blog/decisively-reject-using-wix/&quot;&gt;Why
    You Should Decisively Reject Using Wix&lt;/a&gt;&lt;/cite&gt; gives a lot of good
    reasons not to use Wix, which is a free website builder and host that lets
    you throw together a website in half an hour by simply picking a
    template and dragging and dropping things into it.  What&apos;s not to like,
    right?  Well,

&lt;ol&gt;
  &lt;li&gt; You don&apos;t own it.  It&apos;s on their site.  It has &lt;em&gt;their&lt;/em&gt; ads on
       it.  Say what you like about ad-supported websites, it isn&apos;t
       &lt;em&gt;your&lt;/em&gt; website they&apos;re supporting..  It&apos;s free, so you&apos;re the
       product, not the customer.
  &lt;li&gt; But wait!  You can pay them to take the ads off!  But it&apos;s not cheap:
       plans go from $4-$24 per month.  For that you can get a plan from, say,
       &lt;a href=&quot;https://www.hawkhost.com/&quot;&gt;Hawkhost.com&lt;/a&gt;, that will give
       you full control over your site and its content, and a choice of
       hundreds of different content management systems that you can switch
       between any time you want.
  &lt;li&gt; You don&apos;t have many choices in how your site looks.  Sure they have 500
       site templates.  But once you pick one, you&apos;re stuck with it.  And they
       have &lt;em&gt;millions&lt;/em&gt; of users.  Your site is going to look like at
       least a couple of thousand others.
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt; The site this post is on, &lt;a href=&quot;https://cms2cms.com/blog/decisively-reject-using-wix/&quot;&gt;CMS2CMS&lt;/a&gt;,
    is in the business of helping you migrate a website from one Content
    Management System -- CMS -- to another.  They&apos;ll help you get off of Wix,
    for example, and onto Wordpress or Joomla or...  Interesting thing is,
    they won&apos;t just give you plain old HTML and build your site from scratch.
    They&apos;ll happily get you &lt;em&gt;off&lt;/em&gt; of a plain HTML site and onto a CMS.
    They have this to say about HTML:

&lt;blockquote&gt;
&lt;p&gt; To create a static website may not cost you a thing but to maintain such
    site can be very expensive. You will have to hire programmers each time
    you want to perform some changes to your web project.

&lt;p&gt; It is possible to develop and add any kind of functionality to your
    website. It is a well-known fact that you have stricter control over the
    file structure, design, and SEO.	Although it is possible to customise
    your web project to fit your needs, there is the necessity to have deep
    coding knowledge. But even then there is the risk to make a mistake and to
    damage the code.

&lt;p&gt; A static site is lighter than a website built on CMS and this makes it
    faster.  Various plugins or extensions are not available for a static
    HTML site. In case you want some, then you will have to code every piece
    of functionality.

&lt;p&gt; If the website is not very big, it is easier to make some changes,
    modifications and to customise it according to your needs.	It is possible
    to design each page of HTML site in a different way with the available
    templates. But it will be your job to code in and around the template for
    each page. 
&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt; Rubbish.

&lt;p&gt; Let&apos;s look at their main points:

&lt;p&gt; &lt;em&gt;You will have to hire programmers each time you want to perform some
    changes to your web project.&lt;/em&gt; Huh?  With HTML your content is &lt;em&gt;just
    text&lt;/em&gt;.  Nobody programs a web server from the ground up these days.
    (I&apos;ve done it -- it&apos;s fun.)  On a shared-hosting site like HawkHost, it&apos;s
    &lt;em&gt;already there.&lt;/em&gt;  All you have to do is tell them your site&apos;s
    name.  

&lt;p&gt; Your site is just text.  HTML and CSS stand for HyperText Markup Language
    and Cascading Style Sheets, respectively.  They are &lt;em&gt;not&lt;/em&gt;
    programming languages, they&apos;re &lt;em&gt;markup&lt;/em&gt;.  HTML tags say what parts
    of a page &lt;em&gt;mean&lt;/em&gt; -- a headline, a paragraph, a link, an emphasized
    word, and so on.  You can print the basic cheat-sheet on a bookmark.
    There are some more specialized tags, like the ones for images, tables,
    and audio players.  But they&apos;re all simple.

&lt;p&gt; &lt;em&gt;[I]t will be your job to code in and around the template for each
    page. &lt;/em&gt; No, if you&apos;re writing in HTML, the &quot;code&quot; is already there.
    CSS is a description of what each part is supposed to &lt;em&gt;look like&lt;/em&gt;:
    a headline in bold sans-serif, a paragraph in Times Roman, a link red when
    before you click on it and blue afterwards, emphasized text in italics or
    boldface.  You can print &lt;em&gt;that&lt;/em&gt; cheat-sheet on the other side of
    the bookmark.  

&lt;p&gt; Yes, there&apos;s more advanced CSS, too, and you can do strange and wonderful
    things with it.  (Take a look at the &lt;a href=&quot;http://www.csszengarden.com/&quot;&gt;CSS Zen Garden&lt;/a&gt;, for example.)
    You can get one of thousands of the available CSS stylesheets, tweak it
    with your favorite fonts and layouts, and add it to your site.
    Complicated multi-column layouts that change to look great on everything
    from a phone to a wide screen?  Easy -- go to &lt;a href=&quot;https://purecss.io/&quot;&gt;Pure CSS&lt;/a&gt;, add one line to your basic page
    template and a few words to some of your tags, and you&apos;ve got it.

&lt;p&gt; You don&apos;t even have to write HTML or CSS if you don&apos;t want to -- you can
    write plain text in any of a variety of markup languages -- &lt;a href=&quot;https://daringfireball.net/projects/markdown/&quot;&gt;Markdown&lt;/a&gt; is the
    most popular at the moment -- and have it translated automatically to
    HTML.  There are also dozens of &lt;em&gt;static site generators&lt;/em&gt; that do it
    for you.

&lt;p&gt; &lt;em&gt;Various plugins or extensions are not available for a static
    HTML site. In case you want some, then you will have to code every piece
    of functionality.&lt;/em&gt; As a matter of fact, people have &lt;em&gt;already
    done&lt;/em&gt; that coding, and it&apos;s available for free in nearly infinite
    variety on sites like &lt;a href=&quot;https://github.com&quot;&gt;GitHub&lt;/a&gt;.  And see
    &quot;static site generators&quot; above.  They all have plugins and themes, and
    templates.  Change one template, re-build your site with one command, and
    deploy it.

&lt;p&gt; You may be wondering where Javascript fits in.  That &lt;em&gt;is&lt;/em&gt; a
    programming language, but it runs &lt;em&gt;on the reader&apos;s browser.&lt;/em&gt;  There
    are thousands of available libraries and pre-built Javascript applications
    -- plugins, effectively -- that you can add to your site to liven it up
    with animation and other special effects.  About the only thing that you
    can&apos;t do with a completely static site is add interactive features like
    comments and user logins, and there are ways around that.  

&lt;p&gt; But the best thing about static sites is the way you work on them, because
    you do that &lt;em&gt;on your own computer.&lt;/em&gt; Almost every CMS keeps your
    site content in a database on the server, and I have another whole rant
    about that.  A static site lives on your laptop; you can work on it
    without having to have an internet connection, and deploy it only when
    you have one and you&apos;re happy with the way it looks.

&lt;p&gt; Not only can you use your favorite text editor (and there are some
    &lt;em&gt;awesome&lt;/em&gt; ones out there -- take a look at &lt;a href=&quot;https://atom.io/&quot;&gt;Atom&lt;/a&gt; for example), but because you have a
    complete copy of your site on your computer &lt;em&gt;and&lt;/em&gt; on your web host,
    they effectively back each other up.  And because you can use &lt;a href=&quot;https://git-scm.com/doc&quot;&gt;git&lt;/a&gt; for version control, you not only
    have backups but a complete history of every change you make to your site.

&lt;p&gt; The next few posts in this series (did I mention that this is a series?) will
    go into how to write HTML in more detail, including the tiny bit of CSS
    magic that lets you embed poetry in &lt;em&gt;any&lt;/em&gt; page including a DW post,
    and teach you the basics of git.&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1618191&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://mdlbear.dreamwidth.org/1618191.html</comments>
  <category>curmudgeon</category>
  <category>web</category>
  <category>html</category>
  <lj:mood>didactic</lj:mood>
  <lj:security>public</lj:security>
  <lj:reply-count>11</lj:reply-count>
</item>
</channel>
</rss>
