new file: markdown/as-yaml.mdwn
authorPhilip Durbin <philipdurbin@gmail.com>
Mon, 16 Apr 2012 09:22:21 +0000 (05:22 -0400)
committerPhilip Durbin <philipdurbin@gmail.com>
Mon, 16 Apr 2012 09:22:21 +0000 (05:22 -0400)
markdown.mdwn [new file with mode: 0644]
markdown/as-yaml.mdwn [new file with mode: 0644]

diff --git a/markdown.mdwn b/markdown.mdwn
new file mode 100644 (file)
index 0000000..c28451a
--- /dev/null
@@ -0,0 +1 @@
+Markdown can be written [[as-yaml]].
diff --git a/markdown/as-yaml.mdwn b/markdown/as-yaml.mdwn
new file mode 100644 (file)
index 0000000..ead2652
--- /dev/null
@@ -0,0 +1,74 @@
+An unordered Markdown list can be written as YAML, like this:
+
+    - object-group:
+        - protocol:
+            - tcp-udp: both TCP and UDP
+        - port:
+            - ssh: 22
+            - https: 443
+    - port:
+        - ftp-data: 20
+        - ftp: 21
+        - smtp: 25
+        - domain: 53
+        - www: 80
+
+Why is this interesting?  Because the text can be rendered as HTML. . .
+
+- object-group:
+    - protocol:
+        - tcp-udp: both TCP and UDP
+    - port:
+        - ssh: 22
+        - https: 443
+- port:
+    - ftp-data: 20
+    - ftp: 21
+    - smtp: 25
+    - domain: 53
+    - www: 80
+
+. . . as well as being manipulated programmatically.  You could convert it to JSON, for example:
+
+    [
+       {
+          "object-group" : [
+             {
+                "protocol" : [
+                   {
+                      "tcp-udp" : "both TCP and UDP"
+                   }
+                ]
+             },
+             {
+                "port" : [
+                   {
+                      "ssh" : 22
+                   },
+                   {
+                      "https" : 443
+                   }
+                ]
+             }
+          ]
+       },
+       {
+          "port" : [
+             {
+                "ftp-data" : 20
+             },
+             {
+                "ftp" : 21
+             },
+             {
+                "smtp" : 25
+             },
+             {
+                "domain" : 53
+             },
+             {
+                "www" : 80
+             }
+          ]
+       }
+    ]