VSV Examples

VSV is easily converted to lists, tables, xml, and json.

(TBD: other formats, including subtitles, playlist, ...)

In the examples below, each VSV code block precedes their corresponding output after the code has been parsed in javascript. Comments are basically unclosed header fields. Style to your taste.

VSV to list

class="vsv2list"

List with no headers

,milk
,eggs
,patties
((forgot
, ,
,fries
,hazelnut creamer
,,
,Sliced bread
, ,

List with headers

{{Shopping List}}
,milk
,eggs
,patties
((forgot
, ,
,fries
,hazelnut creamer
,,
,sliced bread
, ,
[[loginname]]
:smithj
[[password]]
:x
[[userid]]
:561
[[groupid]]
:561
[[realname]]
:Joe Smith
[[homedir]]
:/home/smithj
[[shell]]
:/bin/bash
((etc.

Nested Lists

Two ways to make nested lists: with and without headers. First row will determine whether headers are used. Mixing both methods can lead to unpredictable results.

Nested Lists without Headers

Each consecutive delimiter (null data) at the beginning of the row will indent one tier.
*Things to do today

--Feed cat
+++Rinse bowl
+++Open cat food
+++Mix dry and wet food in bowl
+++Deliver on a silver platter to Pixel

--Wash car
+++Vacuum interior
+++Wash exterior
+++Wax exterior

--Grocery shopping
+++Plan meals
+++Clean out fridge
+++Make shopping List
####milk
####eggs
####patties&buns
+++Go to store

*Things to do tomorrow

Nested Lists with Headers

{{ use empty enclosed brackets to indent header and subsequent data rows
{{Things to do today}}
{{}}{{Feed cat}}
`Rinse bowl
`Open cat food
`Mix dry and wet food in bowl
`Deliver on a silver platter to Pixel
{{}}{{Wash car}}
`Vacuum interior
`Wash exterior
`Wax exterior
{{}}{{Grocery shopping}}
`Plan meals
`Clean out fridge
{{}}{{}}{{Make shopping List}}
,milk
,eggs
,patties,buns
{{}} {{row with only empty headers to return to that many previous tiers
`Go to store
{{Things to do tomorrow}}

VSV to table

class="vsv2table"

Table with headers and data

Choose your own delimiters--anything but space.

[[Name]] {{Age}} ((Gender))
((each row of data can have different delimiter, no problem
,Hammie, 20.5, F
-Chow, Vivian-40-F
:Amuseum:25:M:
*Shena'Fu *18+5/12 *F
|Grndr-1245|21 months||

	Fairy Nuff	14 K	N/A

Configuration file

[[General]]
((display options: fullscreen, windowed, windowedmax
=display=fullscreen
=width=1920
=height=1080

Horizontal table

[[loginname]] [[password]] [[userid]] [[groupid]] [[realname]] [[homedir]] [[shell]]
:smithj:x:561:561:Joe Smith:/home/smithj:/bin/bash

VSV to XML

class="vsv2xml"

Note: Angled brackets (the less-than and greater-than symbols) must be written as HTML entities if served within HTML page via a browser or HTTP stream (e.g. cUrl). Otherwise, just use the symbols directly (e.g. interpreting a VSV text file to XML.).

((should work for all XML derivatives
<<div>>
 <<p>>
  ~To: Tove
 <</>>
 <<p>>
  ~From: Jani
 <</>>
 <<h2>>
  ~Reminder
 <</>>
 <<p>>
   ~Meeting this weekend!
  <<span>>
   =style=color: red
   ~ Don't forget!
  <</>>
  <<p>>
   ~-J
  <</>>
 <</>>
<</>>

VSV to JSON

class="vsv2json"
((probably harder to read than JSON, but has similar capabilities
((however, JSON doesn't allow comments, like these first two lines
{{}}
 {{menu}}
  ~id~file
  ~value~File
  {{popup}}
   [[menuitem]]
    {{}}
     ~value~New
     ~onclick~CreateNewDoc()
    {{;}}
    {{}}
     ~value~Open
     ~onclick~OpenDoc()
    {{;}}
    {{}}
     ~value~Close
     ~onclick~CloseDoc()
    {{;}}
   [[;]]
  {{;}}
 {{;}}
{{;}}

VML (VSV markup language) for displaying pages

class="vsv2vml"
(( VML (VSV markup language)
(( for displaying pages, including webpages, documents, printed paper
(( use { } to create and close elements
(( use < > to start and end attributes definitions

{div
   {p
      $ To: Tove
   }
   {p
      $ From: Jani
   }
   {h2
      $ Reminder
   }
   {p
      $ Meeting this weekend!
      {span
         <
            =style=color: red
         >
         $ Don't forget!
      }
   }
   {p
      $ -J
   }
}

VON (VSV Object Notation) to represent programming objects

class="vsv2von"
(( VON (VSV Object Notation)
(( to represent programming objects
(( use { } to create and close objects, hashtables
(( use [ ] to create and close arrays, lists
(( use ( ) to create and close functions, code blocks
(( use < > to start and end function arguments

{menu
   $id$file
   ,value,File
   {popup
      [menuitem
         {
            ,value,New
            ^onclick^CreateNewDoc
         }
         {
            ,value,Open
            ^onclick^OpenDoc^file
         }
         {
            ,value,Close
            ^onclick^CloseDoc^file
         }
      ]
   }
}
(OpenDoc
   <
      =file=
   >
   $ contents = io.open(file);
   $ return contents;
)