YAML идеально подходит, и ваш «кон», что «плохо для редактирования многострочного текста, если текст содержит специальные символы, такие как двоеточие и т. Д.», Абсолютно необоснован. YAML на сегодняшний день является наиболее функциональным формат для многострочного текста:
---
# Block scalars are folded and stripped by default
preamble:
We the People of the United States, in Order to form a more
perfect Union, establish Justice, insure domestic Tranquility,
provide for the common defence, promote the general Welfare,
and secure the Blessings of Liberty to ourselves and our
Posterity, do ordain and establish this Constitution for the
United States of America.
# Chomping indicators (+ and -) allow explicit control over how
# leading/trailing whitespace will be preserved or stripped
chomp: >+
Hello: Is it me you're looking for?
# Literal style preserves formatting
homepage: |
<html>
<head>
<title>My kewl web site</title>
</head>
<body>
<h1>Hello world!</h1>
</body>
</html>
# The indentation indicator lets you explicitly control indentation if it
# can't be inferred
indentation: |4
I'll be indented eight spaces
I'll be indented six
# And colons (or other special characters) are not a problem
emoji: |
: Grinning face {U+1F600}
: Grimacing face {U+1F62C}
: Disappointed face {U+1F61E}
... и, конечно же, вы можете использовать любого из этих форматов в отображении (словарь) или последовательность (массив). Вы можете даже использовать сложные строки (или любую структуру YAML, as it happens) для сопоставления ключей.
Если у вас есть пример использования, который, по вашему мнению, YAML плохо подходит, не стесняйтесь оставлять комментарии. YAML не идеален для всего, но это здорово для многих вещей.
Для сравнения, вот то же самое в формате JSON:
{ "preamble": "We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America.",
"chomp": "\n\nHello: Is it me you're looking for?\n\n\n\n",
"homepage": "<html>\n <head>\n <title>My kewl web site</title>\n </head>\n <body>\n <h1>Hello world!</h1>\n </body>\n</html>\n",
"indentation": "\n I'll be indented eight spaces\n I'll be indented six\n",
"emoji": ": Grinning face {U+1F600}\n: Grimacing face {U+1F62C}\n: Disappointed face {U+1F61E}\n"
}
Любопытное зависит, что вам это нужно. В приложении C#/Js я бы рекомендовал JSON, потому что у C# есть хорошие JSON javascriptserializers, но для базы данных я бы рекомендовал CSV, так как вы можете определить свои собственные столбцы и разрывы строк, подобные этому. – kpp
Вы можете использовать Javascript с JSON, легко, чтобы показать данные на странице html. –