3 ms·
It looks like the P1 section, https://www.fifthtry.com/ftd/p1/ https://www.fifthtry.com/ftd/p1/ , is pretty confused on the difference between "documents" and "
by theamk 5y ago
It looks like the P1 section, https://www.fifthtry.com/ftd/p1/ https://www.fifthtry.com/ftd/p1/ , is pretty confused on the difference between "documents" and "multiline data"
HTML, XML, Markdown, RST is are all "markup languages" (this is what ML in XML/HTML stands for). This means that your file is a single logical stream of text, from start to end, and the format just adds properties ("marks up") to some section of the text. You can remove tags from HTML and syntax from RST and still get a readable and useful text. .
JSON and YAML are designed for storing data. There is no inherent stream of text; most of the times no one ever reads YAML documents from start to finish. If you remove all tags, the results make no sense.
(The data formats can be better or worse for working with multiline strings -- for example both YAML is great with multiline strings when using block quoting, and JSON is just a huge pain. But that does not make them markup languages)
Mixing data and markup format causes pain -- this is what XML did and this is one the big reasons people hate it. All the tooling is designed for "marked up text" use case, and using it to store data makes it awkward.
- amitu 5y agoFTD is XML with neater (hopefully) syntax. XML got a lot of things right, XML has XSD for rich data schema definition, Unlike JSON/YML. FTD too has first class data modelling capabilities, you can specify schema for a "record", which is equivalent of struct. And you can have ADT's (which we call or-type). Then we have variables, lists, etc. If you want to share a data file with someone, FTD is a very compelling alternative to define the schema, represent the data. Further, XML also has XSLT, which can be used for rendering XML data to arbitrary strings, but is mostly used for creating HTML, so data can be visualised properly. Unfortunately XML relined on HTML (which in turn relied on CSS and Javascript). With FTD you do not have to mess with such 4 technologies (these are hotchpotch mix, not a well designed whole). XML was meant to be handwritten, but markdown vs HTML has clearly demonstrated SGML syntax is not great for writing, markdown is. You will see that authoring types, representing data, and writing prose is really pleasant in FTD compared to all of them. Check out this FTD fiddle for example: https://play.fifthtry.com/?ekey=z2jcGxP1hAI01i1Fho515Q https://play.fifthtry.com/?ekey=z2jcGxP1hAI01i1Fho515Q, this has record definition, list creation. And then you can do event handling etc, for example here: https://play.fifthtry.com/?ekey=pMsktS3rOFnS0sGaSe3K0w https://play.fifthtry.com/?ekey=pMsktS3rOFnS0sGaSe3K0w