News for hackers. Stuff that matters.
Re:We Should Have Markdown Rendered Websites by robinsonb5 on Thursday November 10, 2022 @01:21PM (#33550818)
The fatal flaw of HTML (and XML for that matter) is that the tags have the same visual weight as the text they're delimiting, which makes for a sense of clutter even in your minimal example.

Markdown really scores here, by having a pleasing plain text representation as a goal from the outset, and I've love to see it used more widely for web pages.

I'd also love to see it more widely used for offline reading, too - the help files in an application really shouldn't need to invoke a web browser to view them when a lightweight markdown viewer would do the job. Not that there is a lightweight markdown viewer, mind you!

Re:We Should Have Markdown Rendered Websites by 5560675260 on Thursday November 10, 2022 @01:48PM (#33551214)
> tags have the same visual weight as the text they're delimiting

IMO this issue should and can be easily solved by editor/viewer by rendering tags with lower contrast.

Re:We Should Have Markdown Rendered Websites by robinsonb5 on Thursday November 10, 2022 @02:36PM (#33551904)
Yes, that's a perfectly viable workaround, but it's still a band-aid that requires expending resources that wouldn't need to be spent if the markup method had been better chosen for readability. (To be specific, I believe the angle-brackets are the main culprit.)
Re:We Should Have Markdown Rendered Websites by ElemenoPicuares on Thursday November 10, 2022 @02:27PM (#33551742)
Markdown is undoubtedly more readable, but HTML can be more readable than most people make it. And considering that the ultimate goal is to wind up with a layed-out, styled document, its capabilities in that regard are just plain-old more important, especially since markdown isn't going to replace WYSIWYG editors any time soon, and almost everybody who needs to know HTML can learn it relatively easily. Browsers collapse white space by default, so you've got a lot of flexibility with its formatting:

    <!doctype html>

    <title>
        Page Title
    </title>

    <h1>
        Page Title
    </h1>

    <p>
        Lorem ipsum dolor sit amet, consectetur
        adipiscing  elit. Ut ac lorem ut massa 
        euismod vestibulum.
    
    <p>
        Nullam rutrum blandit eleifend. Aenean a 
        varius diam. Morbi sodales velit nunc, vel 
        vestibulum lorem tempus sodales.
--or--

    <!doctype html>

    <title>    Page Title    </title>
    <h1>       Page Title    </h1>

    <p>    Lorem ipsum dolor sit amet, consectetur
           adipiscing  elit. Ut ac lorem ut massa 
           euismod vestibulum.

    <p>    Nullam rutrum blandit eleifend. Aenean a 
           varius diam. Morbi sodales velit nunc, vel 
           vestibulum lorem tempus sodales.

I get why many developers like this idea... Web developers are responsible for implementing the complex user-facing parts, and their primary weapon is text: doing extra work sucks, and when you're a hammer, everything looks like a nail. But developers are not designers, and design not being left to developers in mature organizations is no accident. Absolute, deliberate, limiting simplicity is always an attractive argument if you dismiss the value of, or maybe don't even understand the reason for the complexity. I won't deny the advantages of reader-view-level simplicity in web design: it's easier to visually parse, more performant, and easier to navigate compared to most web pages, similar to how books compare to magazines-- but about 225 million people per year in the US read magazines and I assure you most of them would not choose to have textural printouts in lieu of their current form. While people like having the option of a uniform, grey, easily visually parseable mode to view webpages, that's probably not what they want even most of the time, let alone as a deliberate limitation.
Re:We Should Have Markdown Rendered Websites by robinsonb5 on Thursday November 10, 2022 @02:37PM (#33551917)
I may be that rare exception - a hobbyist developer who does design work as part of $dayjob.
Re:We Should Have Markdown Rendered Websites by ElemenoPicuares on Thursday November 10, 2022 @02:56PM (#33552253)
I don't think that's as rare as people say, especially in smaller organizations.

Having an art school design education and a bit over a decade in (mostly back-end) web development, I've had plenty of deseloper type roles. If they fall under a design or marketing department, they'll spend 80% of the time doing design work and try to throw it together on some shitty wysiwyg monstrosity, ignoring performance, stability, maintainability, etc. If they fall under technical departments, design, ahem, decoration and polish is something to be applied at the end, if there's time, after the real work is done. Either way, having the same group of people responsible for two halves of that coin rarely yields a good balance, and they almost never pay any real attention to usability ... at least not for use cases that don't exactly mirror their own. Seems to me that replacing the flexibility of current markup and styling tools with simple markdown and reader-type layouts is just trying to apply the tech-focused solution to the entire problem the way Flash tried to do the opposite.

Re:We Should Have Markdown Rendered Websites by nerdponx on Saturday November 12, 2022 @10:41PM (#33579778)
The problem is that this only really works well for "documents". Most webpages are anything but "documents", even those that do mostly focus on text.

Of course, HTML templating can help a lot with that: adding footers and sidebars and so on. But it's still no good for "web apps".

Re:We Should Have Markdown Rendered Websites by ElemenoPicuares on Tuesday November 15, 2022 @05:04PM (#33615712)
Compared to markdown I think HTML works a lot better as a general purpose format.
Re:We Should Have Markdown Rendered Websites by account42 on Monday November 14, 2022 @06:17AM (#33592550)
One problem with this style is that if you copy any text from this website you will have trailing spaces after each paragraph. To avoid that you have to close the tags (or open the next one) directly after the text.
Re:We Should Have Markdown Rendered Websites by ElemenoPicuares on Tuesday November 15, 2022 @05:10PM (#33615781)
Sure, if exact copy/paste functionality or precise :after placement is important then you'd need to modify the ending tag placement. I don't think that makes a drastic difference. Compared to markdown, you've still got a heck of a lot more formatting flexibility without changing the rendered product.
Re:We Should Have Markdown Rendered Websites by kridsdale2 on Thursday November 10, 2022 @02:49PM (#33552119)
IMO the main issue with writing HTML is it takes a two-armed key-chord to do a < or > char.
Re:We Should Have Markdown Rendered Websites by iso1631 on Thursday November 10, 2022 @03:30PM (#33552843)
Not entirely sure what you mean by "two-armed key-chord". It's shift-, or shift-. -- my keyboard's bottom line goes <shift>\ZXCVBNM,./<shift>. < is right-index and right-pinky, and > is right-index and right-pinky (as shift is so much wider)

Now sure, some are home row afficiandos, and having # on the home row is certainly beneficial to those as your right-index can stay on J as god intended

Or do you have a different keyboard layout to me. Keyboard layouts - especially the location of things like ,./<>?@;'#:@~[]{} vary a lot depending on the country you are in.

Re:We Should Have Markdown Rendered Websites by tannhaeuser on Thursday November 10, 2022 @03:59PM (#33553269)
HTML is based on SGML, and SGML has short references to handle lightweight custom syntaxes. For example, you can define that an asterisk appearing in your content within a <p> element is replaced by <em>, and moreover define that an asterisk appearing within <em> content is replaced by </em>, toggling emphasized text tags. So SGML very much acknowledges the need for lightweight markup, but the SHORTREF feature, like everything else requiring markup declarations, didn't make it into the XML subset of SGML.

HTML itself doesn't have these and other features (such as basic text macros) because SGML was understood to be available at least at authoring time.

Re:We Should Have Markdown Rendered Websites by nerdponx on Thursday November 10, 2022 @06:31PM (#33555175)
Why didn't we end up with SGML -> XML "compilers"?

As I understand it, XML is intended to be equivalent to SGML, with less syntactic flexibility to make it easier to parse. So once you've done the hard work of parsing SGML, it seems like it should be straightforward to emit the same data as XML for further machine processing.

Or are there some SGML features that cannot be represented with an equivalent in XML?

Re:We Should Have Markdown Rendered Websites by tannhaeuser on Thursday November 10, 2022 @07:09PM (#33555587)
> Why didn't we end up with SGML -> XML "compilers"?

We did; both the osx command-line tool of the venerable SP/OpenSP package, as well as sgmlproc (sgmljs) with output_format=xml does exactly that: output canonical XML markup with shortrefs resolved, omitted tags inferred, attribute values put in quotes and attribute names preprended where not already present, conditional marked sections included or omitted depending on parameter entities, and also entity references expanded, etc. But SGML can also output HTML proper, unlike XML.

SGML mostly has additional authoring features over XML indeed, but a number of additional concepts as well: much more powerful notations (used as general extension mechanism such as for math or parametric macro expansion) and stylesheets ie. link process declarations with state-dependent assignment of attributes and pipelining to yield markup projections, transforms, and views.

Re:We Should Have Markdown Rendered Websites by nerdponx on Thursday November 10, 2022 @08:01PM (#33556057)
Maybe I'm too young for all this, but that sure seems like something I've always wanted. Why aren't we using SGML for authoring HTML in 2022?
Re:We Should Have Markdown Rendered Websites by tuatoru on Thursday November 10, 2022 @09:42PM (#33556724)
Because back in 1995 - 2005, getting a site up and running quickly was more important than doing it right.

Cue (and queue) endless kludges to re-do parts of SGML, badly.

Re:We Should Have Markdown Rendered Websites by necovek on Thursday November 10, 2022 @09:57PM (#33556817)
I was a big supporter of SGML-based languages: markup language written for humans to author.

However, the trend in computing in late 90s and early 2000s was to come up with more easily parsed languages, thus came things like XML: a mark-up language tuned for computers to produce.

But let's be honest here: parsing most XML can be done very simply, whereas supporting basic SGML was only possible with the OpenSP.

SGML is a specification of over 1000 pages of dense text, and that's before you get a language DTD on top of it (like the HTML or DocBook or TEI DTDs). Basically, it is too complex and too flexible, and it was too expensive to produce the tooling to support it (GUI editors, processing tools, making them performant...).

I mean, we are looking at MD here that is even less flexible than HTML: simplicity wins even if it only caters to 90% of the usecases!

Re:We Should Have Markdown Rendered Websites by reilly3000 on Friday November 11, 2022 @12:30AM (#33557617)
I have been on this journey since html 4 was coming out next year, and I’ve never ever heard of SGML. Wow.

I can see how JSON would be a reaction to that.

Re:We Should Have Markdown Rendered Websites by necovek on Saturday November 12, 2022 @01:45AM (#33570672)
HTML4 was the last of "HTML-is-an-SGML-application" (that was the terminology when you define a document type with a SGML DTD) attempt before XHTML 1.0 came out.

SGML is what allows implicit closing tags, for instance.

Of course, even XHTML failed because it was too strict and browsers couldn't trust websites with following it to the letter, so we ended up with HTML as of today: clearly coming out of both, but not really either of them anymore.

Re:We Should Have Markdown Rendered Websites by dtagames on Friday November 11, 2022 @10:26AM (#33561960)
Me, too, having worked at IBM and used SGML there. But JSON is what really killed XML. It can be harder to read, especially at first, but it's shorter and fulfills all the same roles.
Re:We Should Have Markdown Rendered Websites by necovek on Saturday November 12, 2022 @02:05AM (#33570803)
I wouldn't say JSON killed XML: it's still widely in use for documents whose type definition changes rarely and which are more content oriented. The one benefit to XML/SGML languages is that you've got simple, ubiquotious support for "attributes", plain text content and nested tree content.

I.e. to represent

  <p>An <acronym expanded="HyperText Markup Language">HTML</> page was the driver for interactive web.
in JSON, you have to come up with your own conventions for attributes and content:

  [
    {
     "type": "p", 
     "content": [
       {"type": "STRING", "value": "An "},
       {"type": "acronym", "attributes": {"expanded": "HyperText Markup Language"}, "content": [{"type": "STRING", "content": "HTML"}]},
       {"type": "STRING", "content": " page was the driver for interactive web."}
     ]
    }
  ]
I know which one I'd prefer ;)

So with JSON, everyone comes up with their own format. And in these cases that XML was designed for (to mark up textual content), it handily beats JSON in expressiveness, simplicity and terseness too. The fact that it was misused for defining protocols and objects (i.e. SOAP, ugh) is a different matter.

I would say that SGML/XML languages still have this benefit over even Markdown: any contextual modifier is either impossible or uses a one-off syntax (like images or links with text).

Re:We Should Have Markdown Rendered Websites by dtagames on Saturday November 12, 2022 @09:51AM (#33573586)
Indeed. And I do miss XSLT. There's nothing like that for JSON.

Being document oriented from its SGML roots, XML always had more markup, rendering, and search options than JSON.

Re:We Should Have Markdown Rendered Websites by dtagames on Friday November 11, 2022 @10:24AM (#33561934)
Both XML and HTML are implementations of SGML. SGML is the parent reference and includes things that aren't in either subset.

SGML was invented by IBM for "pubs," authoring documents electronically but shipping them as printed manuals.

Lacking the need for print (in HTML) and for display (in XML) lead to those versions.

Re:We Should Have Markdown Rendered Websites by martyalain on Friday November 11, 2022 @01:04PM (#33564330)
It's said that the father of LISP, John McCarthy, lamented the W3C's choice of SGML as the basis for HTML : « An environment where the markup, styling and scripting is all s-expression based would be nice. »

The {lambda way} project could be an answer, small and simple: http://lambdaway.free.fr/lambdawalks/

Re:We Should Have Markdown Rendered Websites by snthpy on Friday November 11, 2022 @12:49AM (#33557701)
This is a great point.
Re:We Should Have Markdown Rendered Websites by Mikhail_Edoshin on Friday November 11, 2022 @04:38AM (#33558744)
Technically XML has some machinery to support more lightweight notations. It won't parse these notations, of course, but the information is accessible to the users of XML reader. The mechanism should work like that:

    <?xml version="1.0"?>
    <!DOCTYPE myDoc [
      <!NOTATION markdown PUBLIC "https://authority.org/markdown/v1.23">
      <!NOTATION rest     PUBLIC "urn:restructured-text/v4.56">
      <!ELEMENT myDoc (note+)>
      <!ELEMENT note CDATA>
      <!ATTLIST note 
        notation NOTATION (markdown|rest) #REQUIRED>
      ]>
    <myDoc>
      <note notation="rest">
        restructured text goes here
      </note>
      <note notation="markdown">
        markdown goes here
      </note>
    </myDoc>