News for hackers. Stuff that matters.
Re:Markdeep markup language by tannhaeuser on Saturday August 04, 2018 @12:46PM (#17687516)
To go beyond generic Wiki syntax, SGML lets you define context-specific token replacement rules. For example, to make SGML format a simplistic markdown fragment into HTML, you could use an SGML prolog like this:

    <!DOCTYPE p [
      <!ELEMENT p - - ANY>
      <!ELEMENT em - - (#PCDATA)>
      <!ENTITY start-em '<em>'>
      <!ENTITY end-em '</em>'>
      <!SHORTREF in-p '*' start-em>
      <!SHORTREF in-em '*' end-em>
      <!USEMAP in-p p>
      <!USEMAP in-em em>
    ]>
    <p>The following text:
       *this*
       will be put into EM
       element tags</p>
Re:Markdeep markup language by eponeponepon on Saturday August 04, 2018 @05:04PM (#17688421)
How does the parser distinguish between in-p and in-em to substitute in the corresponding entities? It seems to me that when it reaches the second asterisk it's not going to be able to know whether to open or close the em element.

Is this one of those pieces of occult witchery that SGML excels at..?

Re:Markdeep markup language by tannhaeuser on Saturday August 04, 2018 @05:40PM (#17688550)
If the context (top-most) element is "em", the "in-em" shortref map is current (as per the second USEMAP declaration), which defines the replacement text for "*" to be "</em>", ending the emphasized text span. Whereas within "p", it's "<em>", starting an emphasized text span, and making "em" the context element.
Re:Markdeep markup language by agumonkey on Saturday August 04, 2018 @02:12PM (#17687862)
so XML removed the best part of SGML..
Re:Markdeep markup language by JadeNB on Saturday August 04, 2018 @02:37PM (#17687967)
XML was always intended more for machine than for human consumption. It's easier for machines to consume extremely regular syntax, so that's what XML has.
Re:Markdeep markup language by agumonkey on Saturday August 04, 2018 @05:07PM (#17688435)
unfortunately it had its time as a pseudo programming language period..
Re:Markdeep markup language by JadeNB on Saturday August 04, 2018 @06:18PM (#17688689)
> unfortunately it had its time as a pseudo programming language period..

You are quite right. I should probably have said something more like "XML was intended by its creators more for machine than human consumption" (and, incidentally, creation; I think I have read that XML construction wasn't really intended to be done by humans either).

Re:Markdeep markup language by quink on Saturday August 04, 2018 @05:13PM (#17688452)
There’s XSLT Markdown to HTML converters out there. And while XSL isn’t XML, it is in every browser and available next to XML in near enough everything else.
Re:Markdeep markup language by Mikhail_Edoshin on Sunday August 05, 2018 @04:51AM (#17690395)
Yes, it's not only everywhere, it's nothing less than a second programming language for the web, although very much neglected :)