import seamless
from seamless.core import macro_mode_on
from seamless.core import context, cell

with macro_mode_on():
    ctx = context(toplevel=True)
    ctx.cson = cell("cson")
    ctx.cson.mount("/tmp/test.cson", mode="rw")
    ctx.json = cell("plain")
    ctx.json.mount("/tmp/test.json", mode="w")
    ctx.cson.connect(ctx.json)

if 1:
	ctx.cson.set("""
	# Comments!!!

	# An Array with no commas!
	greatDocumentaries: [
		'earthlings.com'
		'forksoverknives.com'
		'cowspiracy.com'
	]

	# An Object without braces!
	importantFacts:
		# Multi-Line Strings! Without Quote Escaping!
		emissions: '''
			Livestock and their byproducts account for at least 32,000 million tons of carbon dioxide (CO2) per year, or 51% of all worldwide greenhouse gas emissions.
			Goodland, <NAME>. "Livestock and Climate Change: What if the key actors in climate change were pigs, chickens and cows?"
			WorldWatch, November/December 2009. Worldwatch Institute, Washington, DC, USA. Pp. 10-19.
			http://www.worldwatch.org/node/6294
			'''

		landuse: '''
			Livestock covers 45% of the earth's total land.
			Thornton, Phillip, <NAME>, and <NAME>. "Livestock and Climate Change." Livestock Exchange, no. 3 (2011).
			https://cgspace.cgiar.org/bitstream/handle/10568/10601/IssueBrief3.pdf
			'''

		burger: '''
			One hamburger requires 660 gallons of water to produce - the equivalent of 2 months' worth of showers.
			Catanese, Christina. "Virtual Water, Real Impacts." Greenversations: Official Blog of the U.S. EPA. 2012.
			http://blog.epa.gov/healthywaters/2012/03/virtual-water-real-impacts-world-water-day-2012/
			"50 Ways to Save Your River." Friends of the River.
			http://www.friendsoftheriver.org/site/PageServer?pagename=50ways
			'''

		milk: '''
			1,000 gallons of water are required to produce 1 gallon of milk.
			"Water trivia facts." United States Environmental Protection Agency.
			http://water.epa.gov/learn/kids/drinkingwater/water_trivia_facts.cfm#_edn11
			'''

		more: 'http://cowspiracy.com/facts'
	""")

ctx.compute()
import seamless
from seamless.core import macro_mode_on
from seamless.core import context, cell

with macro_mode_on():
    ctx = context(toplevel=True)
    ctx.cson = cell("cson")
    ctx.cson.mount("/tmp/test.cson", mode="rw")
    ctx.json = cell("plain")
    ctx.json.mount("/tmp/test.json", mode="w")
    ctx.cson.connect(ctx.json)

if 1:
	ctx.cson.set("""
	# Comments!!!

	# An Array with no commas!
	greatDocumentaries: [
		'earthlings.com'
		'forksoverknives.com'
		'cowspiracy.com'
	]

	# An Object without braces!
	importantFacts:
		# Multi-Line Strings! Without Quote Escaping!
		emissions: '''
			Livestock and their byproducts account for at least 32,000 million tons of carbon dioxide (CO2) per year, or 51% of all worldwide greenhouse gas emissions.
			Goodland, <NAME>. "Livestock and Climate Change: What if the key actors in climate change were pigs, chickens and cows?"
			WorldWatch, November/December 2009. Worldwatch Institute, Washington, DC, USA. Pp. 10-19.
			http://www.worldwatch.org/node/6294
			'''

		landuse: '''
			Livestock covers 45% of the earth's total land.
			Thornton, Phillip, <NAME>, and <NAME>. "Livestock and Climate Change." Livestock Exchange, no. 3 (2011).
			https://cgspace.cgiar.org/bitstream/handle/10568/10601/IssueBrief3.pdf
			'''

		burger: '''
			One hamburger requires 660 gallons of water to produce - the equivalent of 2 months' worth of showers.
			Catanese, Christina. "Virtual Water, Real Impacts." Greenversations: Official Blog of the U.S. EPA. 2012.
			http://blog.epa.gov/healthywaters/2012/03/virtual-water-real-impacts-world-water-day-2012/
			"50 Ways to Save Your River." Friends of the River.
			http://www.friendsoftheriver.org/site/PageServer?pagename=50ways
			'''

		milk: '''
			1,000 gallons of water are required to produce 1 gallon of milk.
			"Water trivia facts." United States Environmental Protection Agency.
			http://water.epa.gov/learn/kids/drinkingwater/water_trivia_facts.cfm#_edn11
			'''

		more: 'http://cowspiracy.com/facts'
	""")

ctx.compute()
# Comments!!!  	# An Array with no commas! 	greatDocumentaries: [ 		'earthlings.com' 		'forksoverknives.com' 		'cowspiracy.com' 	]  	# An Object without braces! 	importantFacts: 		# Multi-Line Strings! Without Quote Escaping! 		emissions: ''' 			Livestock and their byproducts account for at least 32,000 million tons of carbon dioxide (CO2) per year, or 51% of all worldwide greenhouse gas emissions. 			Goodland, <NAME>. "Livestock and Climate Change: What if the key actors in climate change were pigs, chickens and cows?" 			WorldWatch, November/December 2009. Worldwatch Institute, Washington, DC, USA. Pp. 10-19. 			http://www.worldwatch.org/node/6294 			'''  		landuse: ''' 			Livestock covers 45% of the earth's total land. 			Thornton, Phillip, <NAME>, and <NAME>. "Livestock and Climate Change." Livestock Exchange, no. 3 (2011). 			https://cgspace.cgiar.org/bitstream/handle/10568/10601/IssueBrief3.pdf 			'''  		burger: ''' 			One hamburger requires 660 gallons of water to produce - the equivalent of 2 months' worth of showers. 			Catanese, Christina. "Virtual Water, Real Impacts." Greenversations: Official Blog of the U.S. EPA. 2012. 			http://blog.epa.gov/healthywaters/2012/03/virtual-water-real-impacts-world-water-day-2012/ 			"50 Ways to Save Your River." Friends of the River. 			http://www.friendsoftheriver.org/site/PageServer?pagename=50ways 			'''  		milk: ''' 			1,000 gallons of water are required to produce 1 gallon of milk. 			"Water trivia facts." United States Environmental Protection Agency. 			http://water.epa.gov/learn/kids/drinkingwater/water_trivia_facts.cfm#_edn11 			'''  		more: 'http://cowspiracy.com/facts'