[HN Gopher] On yak shaving and <md-block>, a new HTML elem...
       ___________________________________________________________________
        
       On yak shaving and <md-block>, a new HTML element for
       Markdown
        
       Author : feross
       Score  : 68 points
       Date   : 2021-11-26 16:17 UTC (6 hours ago)
        
 (HTM) web link (lea.verou.me)
 (TXT) w3m dump (lea.verou.me)
        
       | dmix wrote:
       | The source of the documentation site is a good example of it
       | being used:
       | 
       | view-source:https://md-block.verou.me/
       | 
       | Nice and clean.
       | 
       | That being said I've never used web components and haven't really
       | planned on. Not sure what their status has been in terms of
       | adoption.
        
       | axiomdata316 wrote:
       | Nuts... I thought this was going to be a fun article about people
       | that actually shave yaks and, a little bit about "a New HTML
       | Element for Markdown". :-p
        
       | smitty1e wrote:
       | Mixing older and newer slang in the context of a nasty process at
       | the office, I derived:
       | 
       | "Shave enough yak to yeet a yurt".
        
         | whatshisface wrote:
         | I don't see how that works because while you may construct
         | parts of a yurt out of yak hair, you wouldn't _throw_ a yurt
         | using yak hair, although maybe you could with the help of the
         | yaks.
        
           | smitty1e wrote:
           | Obviously, one would felt[1] the yak hair into a yurt-shape
           | prior to launch.
           | 
           | It's either a nice alliterative run, or pedantic
           | completeness, boss.
           | 
           | [1] https://en.wikipedia.org/wiki/Felt
        
           | codetrotter wrote:
           | If you shave sufficiently many yaks you will eventually come
           | across a yak that is ill tempered. Place the yurt behind the
           | angry yak and watch the yurt get yeeted when the yak kicks
           | with its hind legs.
           | 
           | Snappy yaks yeet yurts yonder.
        
       | unbanned wrote:
       | Oh dear. Markdown has no standard grammar or standard way of
       | rendering.
       | 
       | This website lags while I scroll on mobile.
       | 
       | I remember when the internet used to be fast and responsive.
       | Probably just getting old.
        
         | Gualdrapo wrote:
         | Not sure if it's just me but with Firefox mobile nightly,
         | sometimes when scrolling it instead randomly zooms in a bit.
        
         | ViViDboarder wrote:
         | Website scrolls just fine (quickly) on my iPhone. I do have ad
         | blockers though.
        
         | rain1 wrote:
         | there is the commonmark specification
         | https://spec.commonmark.org/0.30/
        
           | gravypod wrote:
           | I work a lot with common mark and hoedown for work. There's
           | no formal Grammer for parsing markdown unfortunately. The
           | closest thing to what the parent comment is talking about is
           | pandoc which most people are afraid of because Haskell is
           | scary and the markdown format they use is strange.
           | 
           | Also all of the parsers for md are very complicated.
        
         | wildrhythms wrote:
         | Every time the user scrolls, this site updates a style
         | attribute on the root <html> element with this a CSS variable:
         | --scrolltop:700 (that appears to be first updating to the
         | actual scrollTop value, THEN re-updating the value rounded to
         | 100 increments). So TWO updates to this variable every scroll
         | event.
         | 
         | There's a media query consuming this variable, and doing a
         | calculation:
         | 
         | --logo-y: calc(3em - var(--scrolltop, 0) * 1px);
         | 
         | So every time the user scrolls, TWO variable updates take
         | place, TWO redraws, and TWO of these calculations take place,
         | TWO more redraws, just to center the sunburst background on the
         | logo.
        
         | somehnguy wrote:
         | Website lags scrolling on my desktop too. How do website even
         | manage to break _scrolling_..?
        
           | kevin_thibedeau wrote:
           | By being accidentally quadratic or, more likely, naively.
        
         | mastax wrote:
         | Interestingly Chrome Mobile has issues with it while Firefox
         | mobile does not.
        
         | [deleted]
        
         | blowski wrote:
         | > I remember when the internet used to be fast and responsive.
         | Probably just getting old.
         | 
         | This has got to be the most hackneyed comment on HN, and has
         | been for the 10 years I've been on here.
        
       | ravenstine wrote:
       | Just gonna say it as I always do; _I love web components._
       | 
       | I'm curious how this would work with SSR. I noticed that nothing
       | appears in the spaces where these elements are used when I have
       | NoScript blocking scripts on the page. _Obviously_ this would
       | prevent execution of web components, but are these written in
       | such a way that it would be practical to prerender the content
       | and the client-side code to replace or rehydrate them?
        
       | Devasta wrote:
       | Finally, the web has a way of authoring and publishing documents.
        
       | [deleted]
        
       | fouc wrote:
       | I suppose some sort of element that supports various LMLs
       | (Lightweight Markup Languages) could be useful. I don't think
       | Markdown is all that great - there's still room for improvement.
        
       | ghengeveld wrote:
       | This just looks like applying the boy scouts rule to me. She had
       | a reason to update an old library to modern standards, and she
       | did it. That's great! Let's get rid of that tech debt.
        
       | jagged-chisel wrote:
       | Sounds like lots of self-imposed yak shaving. I really hate the
       | kind that requires deep dives into discovering just the right
       | combination of Linux distro version, std lib versions, python
       | versions, node versions ... just to see if the demo of this tool
       | provides the functionality I need...
        
       | sandGorgon wrote:
       | What about MDX? https://mdxjs.com/
       | 
       | It's fairly well adopted in many tools
        
         | ravenstine wrote:
         | That's pretty neat! :D
         | 
         | Though I'm not sure exactly why you're comparing it to a custom
         | element that renders Markdown.
        
       ___________________________________________________________________
       (page generated 2021-11-26 23:00 UTC)