2023-05-23

HTML notes

Bits of HTML experimentation.
How to handle Tweetsand Toots
Mathematics presentation on web pages.
Chemical structure presentation on web pages.
My Site's config
Image "alt" text to display as a tooltip "on hover"
Next section
Next section
End of document

HTML Experimentations

I've been using HTML since ... some time in the early 1990s, I forget when. But I've never really had a good use for it, apart from building websites of stuff that interests me. Running my own domain, hosting a website, etc - I just can't be bothered with. But I seem to have found a reasonable level with Blogger, and I'm learning HTML a little better. And this CSS thing too. Two overlapping systems ... that's not so much bad design as absence of design. We all know the system "just grew", like Topsy.

But I need to practice, and keep notes. So that's what happens here.

Tooting

A link to a tweet doesn't show much : https://twitter.com/kendrakf13/status/1007088771500830721

OK, I obviously need to do some housekeeping code around the raw url. Twitter's site will produce a code block for you, which wraps this up in a blockquote element.

I should have seen the point of the blockquote myself. "Hashtag Homer_Doh!"

I want to see what Twitter (this is Musk we're talking about - the talking, walking exudate from the anal glands of a Himalayan deer ; as the previous owners of Twitter know, with Musk you can trust as much as anyone else, but you absolutely must verify. Verify every bloody word that comes out of his mouth/ keyboard. Stripping off the angle brackets and wrapping in some CODE tags, the code Twitter prepares is this

blockquote class="twitter-tweet" p lang="en" dir="ltr" Tweet text a href="https://t.co/0123456789ABCDEF" GT pic.twitter.com/0123456789ABCDEF /a /p — Tweet Author (@handle) a href="https://twitter.com/author/status/12345678901234567890?ref_src=twsrc%5Etfw" TweetDAte /a /blockquote script async src="https://platform.twitter.com/widgets.js" charset="utf-8" /script

OK, that's Twitter's code. It contains

  • the URI of the tweet, obviously ; that's unavoidable
  • the text of the tweet ; again, unavoidable. Or is it? I suppose they could have hidden that in the "special sauce" in the Twitter JavaScript object. That would avoid having a myriad of copies of the Words of Chairman Elon scattered around on a myriad of websites. That'd create a lot of work for a veritable army of Winston Smiths to do when Musk wants to retcon history to his desired version of reality. Well, I'm sure the idea will occur to someone, one of these days . Or they'll have some other reason for changing their desired form of embedding.
  • The Tweet's author attribution. Again, reasonable enough. Same distribution issues too. does it show that I've just watched a film about a Holocaust denier?
  • Then a link to the tweet's screenshot, (or associated images - I'm going t have to think about this a bit). But for some reason there's a caret ("^") encoded i nthe middle of the URI as "%5e", which ... is there some database-fu going on in there too? ["My spider sense is tingling."]
  • A little more scenery code tidying thing up. Then …
  • A call to the twitter-hosted JavaScript file which puts these elements together.

I don't see anything obviously hostile in that, with the caveats that I'm not a strong coder, and I haven't looked at one line of the JavaScript code blob. One thing I really should do is look at the expiry date for that .JS file - which is the programmer's assertion that it will not change before that date. A change in that would attract a lot of attention to it. Is that me being suspicious or just paranoia? Ask my NoScript settings.

Well, here is how Musk's code puts together a tweet :

quote

Which works.

Well, that was a merry little jaunt down into the depths of how Tweet embedding works. It's sunrise now, and I feel the need for a few hours sleep. Then back to do the actua interesting stuff - the chemistry in the tweet, and how to do "Toots".

Mastodon Web toot version

This iframe takes a few seconds to load, but gives several clikcable links within the iframe. It has a property of "allowfullscreen" which is all OK. Functionally it seems to be the same as for Twitter (given that I haven't looked into either of their JS codes).

Sengi App toot version.

OK, so here's the first thing - I don't think Sengi can load toots from before it was started. I had to do a search or it. Is that so odd?

The Sengi link

The link from Sengi is just a plain weblink. Which works, and gives you the toot and it's context, on the server of whichever server your account is on.

My Mastodon account

Back to List.

Mathematics presentation on web pages.

I use enough maths to need to do it a bit better than inline "1+2 = 3", so I need to work on this. The basic system is "MathML", and it's a bit complex. But the equation editor in LibvreOffice will produce both the equations and the MAthML to go with them, so that's good enough for my uses.

The MathML code from LibreOffice needs to be wrapped in a tag pair ' math xmlns="http://www.w3.org/1998/Math/MathML" display="[block | inline]" ' and closed with ' /math '. Code can be displayed inline like this binomial expression C ( n , k ) = C k n = C k n = ( n k ) = n ! k ! ( n k ) ! (I've stripped most of the neatening whitespace from that code for compactness while I'm editing but it doesn't make it any the more readable. That's not actually LibreOffice code, but from some other source. LibreOffice has some "semantics" sections too, which try to make the logic of the expression available to machine tools, rather than concentrating on the presentation aspects which are here. But frankly, with the LibreOffice route, I don't really need to worry about that. I am developing a library od math snippets in /Study/Gnuplot_&_Maths, so I need to remember to dump the math there, once I've got it presentable.

The alternative to "inline" presentation like above (should be!) is "block" presentation, like this. (does this go outside the paragraph's closing brace, or inside? Try inside. 0 1 x x x = n = 1 ( 1 ) n + 1 n n It looks as if Blogger is tolerant of a block within a block like this. Which shouldn't surprise me.

BTW, this expression is the "Sophomore's Dream" because it makes integration easier, I think.

Writing MathMl from scratch is complex - you've got to build a semantic tree to express your expression, then read out the tree in an infix presentation. I remember doing that with storage of data in trees in CS2.0.1, and it was headache-inducing and prone to errors by hand. W3C recommend using tools to develop and produce MathML.

I'm not going to fight that.

Back to List.

Chemical structure presentation on web pages.

link

Having just had to paste a link to a Wikipedia SVG for a molecular structure (Luminol), I need to know about the Chemical equivalents to the mathematical expressions above. That's a new topic. I know there are such tools, because I've seen chemical expression manipulation programmes in the Linux package lists. Research to be done!

Wiki has a page on CML - Chemical Markup Language.

This page describes several different types of chemical representations. Their list is incomplete, and I indicate others :

  • KekulĂ© (a.k.a. Lewis) Structures - A KekulĂ© Formula or structural formula displays the atoms of the molecule in the order they are bonded. They don't say it, but with pipes and em-dashes you could build these with on a typewriter.
  • Condensed Formula -A condensed formula is made up of the elemental symbols. Condensed structural formulas show the order of atoms like a structural formula but are written in a single line to save space and make it more convenient and faster to write out. "CH3CH2OH", for example, complete with buggering around with sub tags.
  • Line Formula - Because organic compounds can be complex at times, line-angle formulas are used to write carbon and hydrogen atoms more efficiently by replacing the letter "C" with lines. Handling out-of-plane structures for steroisomers isn't covered, but really needs to be.
  • Space-filling models - constructed from the formula and interpretations for the electron clouds of average atoms and bonds. And lone pairs, and un-paired electrons.
  • Perspective views in a rotatable viewer.

What does wiki say on the subject? "Wikipedia:Manual of Style/Chemistry advises avoiding the tag chem and tag math chem markup methods when possible." These are derivatives of MathML. ... And then the only things they give as examples in the help files are tag chem objects. The Wiki Help Page talks mostly about using Tex outside the browser. Most of their examples for structures, they use images not a programmable markup. The Manual of Style isn't terribly helpful.

Here's a molecule display tool which understands 47 (if I counted right!) different molecular structure file formats. A lot of them are tied to particular imaging techniques, as if that helps. This doesn't bode well for finding a uniform molecular description language.

And that's as far as I've got. I've got other things to do.

MMMM Perhaps ... I should choose a phyllosilicate as an example. Such a mixture of covalent and ionic bonding should make life difficult in a world dominated by organic chemicals.

Blockquote
quote mark

P …

Back to List.

Problems with this site's configuration

For some reason my blockquote customisation is keeping the yellow overprint (good) but is putting the font size up a couple of notches.

The available options for "font-size:" include these "absolute" ones : "xx-small; , x-small; , small; , medium; , large; , x-large; , xx-large; xxx-large;" and these relative-size ones : "font-size: smaller; , larger;". So why isn't it working?

OK, I've found it. I'd put an example HTML comment in the "style" tag, which was breaking things. Hiding the HTML comment within an CSS comment (C-style) re-enabled the CSS header code.

So now, can I control the number of open tabs - say, one for Wiki, one for pages from my blog, and all the others create new tabs? That could get complicated, fast.

Back to List.

Using tooltips to display image ALT text.

link

I'd like to see what ALT text is associated with an image - part of checking that there is ALT text, for a start - so I need to put some CSS into IMG tags which will - any time an image is loaded - extract it's ALT data, put that into a tooltip (both of which are on W3Schools) and display the tooltip while mouse-hovering.

Back to List.

Article

link
Blockquote
quote mark

P …

P …

P …

Back to List.

Article

link
Blockquote
quote mark

P …

P …

P …

Back to List.

Article

link
Blockquote
quote mark

P …

P …

P …

Back to List.

End of Document
Back to List.

Footings

Blockquote
quote mark

P …

P …

Tables & bits

  • ul
  • ul
  1. ol
  2. ol

Tables

Table with properties set - caption, width, border-style, border-width, border-coloUr, ... border-collapse, ...
Heading 1Hdg 2Heading 3
Row 1 CS 1 ; CP 11 R1 C2 CS 2; CP 3 R1 C3 CS 5 ; CP4
Row 2 CS 2 ; CP 12 …R2 C2 CS 6; CP 6 R2 C3 CS 7 ; CP 8
Row 3 CS 3 ; CP 13 R3 C2 CS 9; CP 9 R3 C3 CS 9 ; CP 16
Sections
Heading
a
b
c …

2023-01-31

Duolingo - French, before 2022-10 update

I did notes on my French Duo course for a while, but not very consistently. When they updated the course (after I finished it. Curses!) I started taking more consistent notes. This is the PDF stored on Box. You'll have to click the "Download" button on the page that links to. but it's good enough for me, for now.

Sandbox

styles

/styles


Tables

Table with properties set - caption, width, border-style, border-width, border-coloUr, ... border-collapse, ...
Row 1 CS 1 ; CP 11 R1 C2 CS 2; CP 3 R1 C3 CS 5 ; CP4
Row 2 CS 2 ; CP 12 R2 C2 CS 6; CP 6 R2 C3 CS 7 ; CP 8
Row 3 CS 3 ; CP 13 R3 C2 CS 9; CP 9 R3 C3 CS 9 ; CP 16
Sections
a
b
c

Working area

============

math xmlns works best

a x2 +bx +c

raw MathML - doesn't work so well

a x2 +bx +c

other

  • ul
  • ul
  1. ol
  2. ol

What was the "onRollOver" function I was looking at for? I think I wanted to make blockquote elements flash, or add a background. But the ":hover" functionality seems adequate.

Other Stuff

===========

Colour list :
#000000 Black#000080 Navy#00008B DarkBlue#0000CD MediumBlue#0000FF Blue#006400 DarkGreen#008000 Green#008080 Teal
#008B8B DarkCyan#00BFFF DeepSkyBlue#00CED1 DarkTurquoise#00FA9A MediumSpringGreen#00FF00 Lime#00FF7F SpringGreen#00FFFF Aqua#00FFFF Cyan
#191970 MidnightBlue#1E90FF DodgerBlue#20B2AA LightSeaGreen#228B22 ForestGreen#2E8B57 SeaGreen#2F4F4F DarkSlateGray#2F4F4F DarkSlateGrey#32CD32 LimeGreen
#3CB371 MediumSeaGreen#40E0D0 Turquoise#4169E1 RoyalBlue#4682B4 SteelBlue#483D8B DarkSlateBlue#48D1CC MediumTurquoise#4B0082 Indigo#556B2F DarkOliveGreen
#5F9EA0 CadetBlue#6495ED CornflowerBlue#663399 RebeccaPurple#66CDAA MediumAquaMarine#696969 DimGray#6A5ACD SlateBlue#6B8E23 OliveDrab#708090 SlateGray
#708090 SlateGrey#778899 LightSlateGray#7B68EE MediumSlateBlue#7CFC00 LawnGreen#7FFF00 Chartreuse#7FFFD4 Aquamarine#800000 Maroon#800080 Purple
#808000 Olive#808080 Gray#87CEEB SkyBlue#87CEFA LightSkyBlue#8A2BE2 BlueViolet#8B0000 DarkRed#8B008B DarkMagenta#8B4513 SaddleBrown
#8FBC8F DarkSeaGreen#90EE90 LightGreen#9370DB MediumPurple#9400D3 DarkViolet#98FB98 PaleGreen#9932CC DarkOrchid#9ACD32 YellowGreen#A0522D Sienna
#A52A2A Brown#A9A9A9 DarkGray#A9A9A9 DarkGrey#ADD8E6 LightBlue#ADFF2F GreenYellow#AFEEEE PaleTurquoise#B0C4DE LightSteelBlue#B0E0E6 PowderBlue
#B22222 FireBrick#B8860B DarkGoldenRod#BA55D3 MediumOrchid#BC8F8F RosyBrown#BDB76B DarkKhaki#C0C0C0 Silver#C71585 MediumVioletRed#CD5C5C IndianRed
#CD853F Peru#D2691E Chocolate#D2B48C Tan#D3D3D3 LightGray#D8BFD8 Thistle#DA70D6 Orchid#DAA520 GoldenRod#DB7093 PaleVioletRed
#DC143C Crimson#DCDCDC Gainsboro#DDA0DD Plum#DEB887 BurlyWood#E0FFFF LightCyan#E6E6FA Lavender#E9967A DarkSalmon#EE82EE Violet
#EEE8AA PaleGoldenRod#F08080 LightCoral#F0E68C Khaki#F0F8FF AliceBlue#F0FFF0 HoneyDew#F0FFFF Azure#F4A460 SandyBrown#F5DEB3 Wheat
#F5F5DC Beige#F5F5F5 WhiteSmoke#F5FFFA MintCream#F8F8FF GhostWhite#FA8072 Salmon#FAEBD7 AntiqueWhite#FAF0E6 Linen#FAFAD2 LightGoldenRodYellow
#FDF5E6 OldLace#FF0000 Red#FF00FF Fuchsia#FF00FF Magenta#FF1493 DeepPink#FF4500 OrangeRed#FF6347 Tomato#FF69B4 HotPink
#FF7F50 Coral#FF8C00 DarkOrange#FFA07A LightSalmon#FFA500 Orange#FFB6C1 LightPink#FFC0CB Pink#FFD700 Gold#FFDAB9 PeachPuff
#FFDEAD NavajoWhite#FFE4B5 Moccasin#FFE4C4 Bisque#FFE4E1 MistyRose#FFEBCD BlanchedAlmond#FFEFD5 PapayaWhip#FFF0F5 LavenderBlush#FFF5EE SeaShell
#FFF8DC Cornsilk#FFFACD LemonChiffon#FFFAF0 FloralWhite#FFFAFA Snow#FFFF00 Yellow#FFFFE0 LightYellow#FFFFF0 Ivory#FFFFFF White

Monthly Notes Page

==================

blockquote
Articles studied this $Month_Name - some of which might go to Slashdot.
first Article Description
next Article Description
next Article Description
End of document

$Month_Name science readings.

Blockquote
quote mark


Article Title

link

Blockquote
quote mark


Article Title

link

Blockquote
quote mark


Article Title

link

Blockquote
quote mark

Blockquote
quote mark


End of Document
Back to List.


Next Template Page

==================

Blockquote
quote mark