A Microblog in Plain HTML

(#64)

#test #programming

Found out today that the built-in python html parser doesn't play well with strings that have been split.

from html.parser import HTMLParser
class MyParser(HTMLParser):
    def __init__(self):
        super().__init__()
    def handle_starttag(self, tag, attrs):
        print(tag, attrs)
parser = MyParser()
a = ["<a href=\"https://test.com\">","link", "</a>"]
b = " ".join(a).split()
print(b)
for string in a:
    parser.feed(string) 
    # a [('href', 'https://test.com')]
for string in b:
    parser.feed(string) # parse b 
    # ahref="https: [('test.com"', None)]

(#62)

#test #programming

I came up with a new feature for microblog.py again. (It's now 600 lines of code on the branch detect-html.)

The new feature is multi-line HTML detection. An example is a bulleted list like so

  • item1
  • item2
  • item3

Previously, the script added paragraph tags around each line which forces the user to put any html in a single line. Now, it adds paragraph tags, ideally in ways that shouldn't interfere with pre-existing microblogs. So far, my older notes are looking okay.

(#47)

(#45)

#test #surf

I made a new navigation bar even though I thought the old one is okay.

Why:

https://website.grader.com/tests/likho.neocities.org

Originally, the results gave me great marks for performance and security. (Can't get any more secure than absolutely no javascripts.) But I got docked down for mobile and "search engine optimization". For the former, I was apparently lacking "tap targets".

I've opened my own site on a phone before and didn't think there was any issue. (And I mistap things on small touchscreens plenty of times.)

With the new navigation bar, it should be even harder to accidentally tap on the wrong links.

Just for that I now have 30/30 on design for mobile as far as the website grader is concerned. But I only applied the new navigation bar to the index page.

I had fun making a new design, but I'm not sure if I like it yet.

(#40)

#programming #test

New update for microblog.py: image thumbnails.

For the entire time I've been posting screenshots of cartoons. Usually, the file sizes are small as is. For photographs and video game screenshots, however, posting too many images on one page will impact loading times (not good). So now, the mini-galleries in each post can now support paths to thumbnails.

microblog.py remains as a page generator and doesn't manage images, so I use another program to resize. Example:

https://imagemagick.org/Usage/resize/#percent

(#4)

(#3)

mini gallery generation #test

(#1)

Test. #test # blog

microblog.py