Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                -
	const json = `
	{
		"@context": "https://schema.org",
		"@type": "TVSeries",
		"name": "Star Trek: Short Treks",
		"containsSeason": [
			{
				"@type": "TVSeason",
				"seasonNumber": 1,
				"episode": [
					{
						"@type": "Episode",
						"episodeNumber": "S1:E1",
						"name": "Runaway",
						"datePublished": "2018-10-04",
						"workTranslation": {
							"@type": "Episode",
							"name": " Runaway",
							"alternateName": "Entlaufen",
							"inLanguage": "de",
							"datePublished": "2019-01-17"
						},
						"director": {
							"@id": "#MajaVrvilo",
							"@type": "Person",
							"name": "Maja Vrvilo"
						},
						"abstract": "Sylvia Tilly entdeckt eine blinde Passagierin und findet heraus, dass diese eine flüchtige Königin ist."
					},
					{
						"@type": "Episode",
						"episodeNumber": "S1:E2",
						"name": "Calypso",
						"datePublished": "2018-11-08",
						"workTranslation": {
							"@type": "Episode",
							"name": " Calypso",
							"inLanguage": "de",
							"datePublished": "2019-01-17"
						},
						"director": {
							"@id": "#OlatundeOsunsanmi",
							"@type": "Person",
							"name": "Olatunde Osunsanmi"
						},
						"abstract": "Der autonom weiterentwickelte Schiffscomputer der Discovery rettet den Soldaten Craft 1000 Jahre nach der Serie aus einer Rettungskapsel. Zora, die künstliche Intelligenz der Discovery, beginnt sich in Craft zu verlieben, lässt ihn am Ende jedoch zu seinem Heimatplaneten aufbrechen."
					},
					{
						"@type": "Episode",
						"episodeNumber": "S1:E3",
						"name": "The Brightest Star",
						"datePublished": "2018-12-06",
						"workTranslation": {
							"@type": "Episode",
							"name": " The Brightest Star",
							"alternateName": "Der hellste Stern",
							"inLanguage": "de",
							"datePublished": "2019-01-17"
						},
						"director": {
							"@id": "#DouglasAarniokoski",
							"@type": "Person",
							"name": "Douglas Aarniokoski"
						},
						"abstract": "Saru findet auf seiner Heimatwelt ein defektes Kommunikationsgerät und kann es reparieren. So kommt er als erster Kelpianer zur Föderation. "
					},
					{
						"@type": "Episode",
						"episodeNumber": "S1:E4",
						"name": "The Escape Artist",
						"datePublished": "2019-01-03",
						"workTranslation": {
							"@type": "Episode",
							"name": "Houdini",
							"inLanguage": "de",
							"datePublished": "2019-01-17"
						},
						"director": {
							"@id": "#RainnWilson",
							"@type": "Person",
							"name": "Rainn Wilson"
						},
						"abstract": "Harry Mudd ist einem Kopfgeldjäger in die Hände gefallen, der ihn an die Föderation ausliefern will."
					}
				]
			},
			{
				"@type": "TVSeason",
				"seasonNumber": 2,
				"episode": [
					{
						"@type": "Episode",
						"episodeNumber": "S2:E1",
						"name": "Q&A",
						"datePublished": "2019-10-05",
						"director": {
							"@id": "#MarkPellington",
							"@type": "Person",
							"name": "Mark Pellington"
						},
						"abstract": "Spock hat seinen ersten Tag auf der Enterprise. Er bleibt mit Nummer Eins im Turbolift stecken."
					},
					{
						"@type": "Episode",
						"episodeNumber": "S2:E2",
						"name": "The Trouble with Edward",
						"datePublished": "2019-10-10",
						"director": {
							"@id": "#DanielGrayLongino",
							"@type": "Person",
							"name": "Daniel Gray Longino"
						},
						"abstract": "Lynne Lucero übernimmt ihr erstes Kommando. Dort trifft sie auf Edward Larkin."
					},
					{
						"@type": "Episode",
						"episodeNumber": "S2:E3",
						"name": "Ask Not",
						"datePublished": "2019-11-14",
						"director": {
							"@id": "#SanjiSenaka",
							"@type": "Person",
							"name": "Sanji Senaka"
						},
						"abstract": "Als Sternenbasis 28 angegriffen wird, kümmert sich Kadett Thira Sidhu um einen meuternden Gefangenen: Kapitän Christopher Pike von der Enterprise. Pike versucht Sidhu unter Druck zu setzen, ihn freizulassen, aber sie lehnt ab. Pike enthüllt, dass dies ein simulierter Test ist, und bei Bestehen wird Sidhu als Teil der Enterprise-Crew akzeptiert."
					},
					{
						"@type": "Episode",
						"episodeNumber": "S2:E4",
						"name": "Ephraim and Dot",
						"datePublished": "2019-12-12",
						"director": {
							"@id": "#MichaelGiacchino",
							"@type": "Person",
							"name": "Michael Giacchino"
						},
						"abstract": "Ein weibliches Bärtierchen, das nach einem Ort sucht, an dem es seine Eier ablegen kann, kreuzt den Weg der USS Enterprise und wird von einer Reparaturdrohne namens Dot angegriffen."
					},
					{
						"@type": "Episode",
						"episodeNumber": "S2:E5",
						"name": "The Girl Who Made the Stars",
						"datePublished": "2019-12-12",
						"director": {
							"@id": "#OlatundeOsunsanmi",
							"@type": "Person",
							"name": "Olatunde Osunsanmi"
						},
						"abstract": "Die kleine Michael Burnham wacht in der Nacht auf. Um sie zu beruhigen, erzählt ihr Vater ihr eine Geschichte eines afrikanischen Stammes."
					},
					{
						"@type": "Episode",
						"episodeNumber": "S2:E6",
						"name": "Children of Mars",
						"datePublished": "2020-01-09",
						"workTranslation": {
							"@type": "Episode",
							"name": "Kinder des Mars",
							"inLanguage": "de",
							"datePublished": "2021-01-14"
						},
						"director": {
							"@id": "#MarkPellington",
							"@type": "Person",
							"name": "Mark Pellington"
						},
						"abstract": "Die Folge handelt von zwei Schülerinnen, deren Eltern auf dem Mars arbeiten. Die beiden drangsalieren sich, was in einer Prügelei endet. Kurz darauf erfahren alle Lehrer und Schüler von einem Angriff auf den Mars."
					}
				]
			}
		]
	}
	`;

- const isDirectorVisible = false;
- const isWorkTranslationDatePublishedVisible = false;

- const data = JSON.parse(json);

table(lang=data.inLanguage, typeof=data['@type'], vocab=data['@context']['@vocab']||data['@context'])
	caption= data.name
	each season in data.containsSeason
		tbody(property="containsSeason", typeof=season['@type'])
			each episode in season.episode
				tr(property="episode", typeof=episode['@type'])
					th(property="episodeNumber")= episode.episodeNumber
					td(property="name")= episode.name
					if episode.workTranslation
						td(property="workTranslation", typeof=episode.workTranslation['@type'], lang=episode.workTranslation.inLanguage, resource=`_:${episode.episodeNumber}@${episode.workTranslation.inLanguage}`)
							span(property="name")= episode.workTranslation.name
							if episode.workTranslation.alternateName
								|  / 
								span(property="alternateName")= episode.workTranslation.alternateName
					else
						td
					td
						time(property="datePublished")= episode.datePublished
					if isWorkTranslationDatePublishedVisible
						if episode.workTranslation
							td(resource=`_:${episode.episodeNumber}@${episode.workTranslation.inLanguage}`)
								time(property="datePublished")= episode.workTranslation.datePublished
						else
							td
					if isDirectorVisible
						td(property="director", typeof=episode.director['@type'], resource=`https://bittersmann.de/startrek/persons${episode.director['@id']}`)
							span(property="name")= episode.director.name
					if episode.abstract
						td
							details
								summary Synopsis
								p(property="abstract", lang="de")= episode.abstract
					else
						td

              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console