{
    "componentChunkName": "component---packages-gatsby-theme-docs-src-templates-page-content-js",
    "path": "/views/code-blocks",
    "result": {"data":{"contentPage":{"title":"Code Blocks","globalNotification":null,"websitePrimaryColor":"#808080","beta":false,"isGlobalBeta":false,"excludeFromSearchIndex":false,"allowWideContentLayout":false,"body":"var _excluded = [\"components\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"Code Blocks\",\n  \"showTimeToRead\": true,\n  \"timeToRead\": false\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"section\", {\n    \"id\": \"section-terminalconsole\",\n    \"className\": \"section-h2\"\n  }, mdx(\"h1\", {\n    parentName: \"section\",\n    \"id\": \"terminalconsole\"\n  }, \"Terminal/Console\"), mdx(\"p\", {\n    parentName: \"section\"\n  }, \"Passing the option \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"noPromptLines=\\\"3-4\\\"\"), \".\"), mdx(\"pre\", {\n    parentName: \"section\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-console\",\n    \"metastring\": \"noPromptLines=\\\"3-4\\\"\",\n    \"noPromptLines\": \"\\\"3-4\\\"\"\n  }, \"cd project\\ncp -R \\\\\\n  dist \\\\\\n  public/\\nrm -rf dist\\nyarn start\\n\")), mdx(\"p\", {\n    parentName: \"section\"\n  }, \"No options, but you can check that the indentation in regards to the left prompt is aligned when the line wraps.\"), mdx(\"pre\", {\n    parentName: \"section\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-console\"\n  }, \"# fetch a token:\\ncurl https://auth.sphere.io/oauth/token --basic --user \\\"{client_id}:{client_secret}\\\" -X POST -d \\\"grant_type=client_credentials&scope=manage_project:{project_key}\\\"\\n# now access the API:\\ncurl -sH \\\"Authorization: Bearer ACCESS_TOKEN\\\" https://api.sphere.io/PROJECT_KEY/products\\n\")), mdx(\"p\", {\n    parentName: \"section\"\n  }, \"Passing the option \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"title=\\\"Fetching an access token\\\"\")), mdx(\"pre\", {\n    parentName: \"section\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-console\",\n    \"metastring\": \"title=\\\"Fetching an access token\\\"\",\n    \"title\": \"\\\"Fetching\",\n    \"an\": true,\n    \"access\": true,\n    \"token\\\"\": true\n  }, \"# fetch a token:\\ncurl https://auth.sphere.io/oauth/token --basic --user \\\"{client_id}:{client_secret}\\\" -X POST -d \\\"grant_type=client_credentials&scope=manage_project:{project_key}\\\"\\n# now access the API:\\ncurl -sH \\\"Authorization: Bearer ACCESS_TOKEN\\\" https://api.sphere.io/PROJECT_KEY/products\\n\"))), mdx(\"section\", {\n    \"id\": \"section-javascript\",\n    \"className\": \"section-h2\"\n  }, mdx(\"h1\", {\n    parentName: \"section\",\n    \"id\": \"javascript\"\n  }, \"Javascript\"), mdx(\"pre\", {\n    parentName: \"section\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-javascript\",\n    \"metastring\": \"highlightLines=\\\"2,5-6\\\"\",\n    \"highlightLines\": \"\\\"2,5-6\\\"\"\n  }, \"// Constructor\\nvar anObject = new Object();\\n\\n// Object literal\\nvar objectA = {};\\nvar objectA2 = {};\\nvar objectB = { index1: 'value 1', index2: 'value 2' };\\n\"))), mdx(\"section\", {\n    \"id\": \"section-python\",\n    \"className\": \"section-h2\"\n  }, mdx(\"h1\", {\n    parentName: \"section\",\n    \"id\": \"python\"\n  }, \"Python\"), mdx(\"pre\", {\n    parentName: \"section\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"s = \\\"Python syntax highlighting\\\"\\nprint s\\n\"))), mdx(\"section\", {\n    \"id\": \"section-c\",\n    \"className\": \"section-h2\"\n  }, mdx(\"h1\", {\n    parentName: \"section\",\n    \"id\": \"c\"\n  }, \"C\"), mdx(\"pre\", {\n    parentName: \"section\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-csharp\"\n  }, \"Person person = new Person {\\n    Name = \\\"John Doe\\\",\\n    Age = 39\\n};\\n\\n// Equal to\\nPerson person = new Person();\\n\"))), mdx(\"section\", {\n    \"id\": \"section-java\",\n    \"className\": \"section-h2\"\n  }, mdx(\"h1\", {\n    parentName: \"section\",\n    \"id\": \"java\"\n  }, \"Java\"), mdx(\"pre\", {\n    parentName: \"section\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-java\"\n  }, \"public class HelloWorldApp {\\n  public static void main(String[] args) {\\n      System.out.println(\\\"Hello World!\\\"); // Prints the string to the console.\\n  }\\n}\\n\"))), mdx(\"section\", {\n    \"id\": \"section-json\",\n    \"className\": \"section-h2\"\n  }, mdx(\"h1\", {\n    parentName: \"section\",\n    \"id\": \"json\"\n  }, \"JSON\"), mdx(\"pre\", {\n    parentName: \"section\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-json\"\n  }, \"{\\n  \\\"glossary\\\": {\\n    \\\"title\\\": \\\"example glossary\\\",\\n    \\\"GlossDiv\\\": {\\n      \\\"title\\\": \\\"S\\\",\\n      \\\"GlossList\\\": {\\n        \\\"GlossEntry\\\": {\\n          \\\"ID\\\": 123.45,\\n          \\\"Sort\\\": true,\\n          \\\"GlossTerm\\\": \\\"Standard Generalized Markup Language\\\",\\n          \\\"Acronym\\\": \\\"SGML\\\",\\n          \\\"Abbrev\\\": \\\"ISO 8879:1986\\\",\\n          \\\"GlossDef\\\": {\\n            \\\"para\\\": \\\"A meta-markup language, used to create markup languages such as DocBook.\\\",\\n            \\\"GlossSeeAlso\\\": [\\\"GML\\\", \\\"XML\\\"]\\n          },\\n          \\\"GlossSee\\\": null\\n        }\\n      }\\n    }\\n  }\\n}\\n\"))), mdx(\"section\", {\n    \"id\": \"section-php\",\n    \"className\": \"section-h2\"\n  }, mdx(\"h1\", {\n    parentName: \"section\",\n    \"id\": \"php\"\n  }, \"PHP\"), mdx(\"pre\", {\n    parentName: \"section\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-php\"\n  }, \"<?php\\nfunction myAge(int $birthYear):string {\\n    // calculate the age by subtracting the birth year from the current year.\\n    $yearsOld = date('Y') - $birthYear;\\n\\n    // return the age in a descriptive string.\\n    return $yearsOld . ' year' . ($yearsOld != 1 ? 's' : '');\\n}\\n\\necho 'I am currently ' . myAge(1995) . ' old.';\\n\"))), mdx(\"section\", {\n    \"id\": \"section-shell\",\n    \"className\": \"section-h2\"\n  }, mdx(\"h1\", {\n    parentName: \"section\",\n    \"id\": \"shell\"\n  }, \"Shell\"), mdx(\"pre\", {\n    parentName: \"section\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-sh\"\n  }, \"#!/bin/bash\\n# use $jpg in place of each filename given, in turn\\nfor jpg; do\\n    # construct the PNG version of the filename by replacing .jpg with .png\\n    png=\\\"${jpg%.jpg}.png\\\"\\n    # output status info to the user running the script\\n    echo converting \\\"$jpg\\\" ...\\n    # use the convert program (common in Linux) to create the PNG in a temp file\\n    if convert \\\"$jpg\\\" jpg.to.png ; then\\n        # if it worked, rename the temporary PNG image to the correct name\\n        mv jpg.to.png \\\"$png\\\"\\n    # ...otherwise complain and exit from the script\\n    else\\n        echo 'jpg2png: error: failed output saved in \\\"jpg.to.png\\\". adksjflkasd fkljasd lfkja lksdjf lkasdjf lkasdjf lkajsd fkljas dlkfj asdflk' >&2\\n        exit 1\\n    # the end of the \\\"if\\\" test construct\\n    fi\\n# the end of the \\\"for\\\" loop\\ndone\\n# tell the user the good news\\necho all conversions successful\\nexit 0\\n\"))), mdx(\"section\", {\n    \"id\": \"section-swift\",\n    \"className\": \"section-h2\"\n  }, mdx(\"h1\", {\n    parentName: \"section\",\n    \"id\": \"swift\"\n  }, \"Swift\"), mdx(\"pre\", {\n    parentName: \"section\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-swift\"\n  }, \"struct Player {\\n    var name: String\\n    var highScore: Int = 0\\n    var history: [Int] = []\\n\\n    init(_ name: String) {\\n        self.name = name\\n    }\\n}\\n\\nvar player = Player(\\\"Tomas\\\")\\n\"))), mdx(\"section\", {\n    \"id\": \"section-no-language-set\",\n    \"className\": \"section-h2\"\n  }, mdx(\"h1\", {\n    parentName: \"section\",\n    \"id\": \"no-language-set\"\n  }, \"No language set\"), mdx(\"pre\", {\n    parentName: \"section\"\n  }, mdx(\"code\", {\n    parentName: \"pre\"\n  }, \"No language indicated, so no syntax highlighting.\\nBut let's throw in a <b>tag</b> which should remain unparsed\\n\"))), mdx(\"section\", {\n    \"id\": \"section-last-section\",\n    \"className\": \"section-h2\"\n  }, mdx(\"h1\", {\n    parentName: \"section\",\n    \"id\": \"last-section\"\n  }, \"Last section\"), mdx(\"p\", {\n    parentName: \"section\"\n  }, \"This section is only useful as an anchor link target.\")));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"title":"Terminal/Console","url":"#terminalconsole"},{"title":"Javascript","url":"#javascript"},{"title":"Python","url":"#python"},{"title":"C","url":"#c"},{"title":"Java","url":"#java"},{"title":"JSON","url":"#json"},{"title":"PHP","url":"#php"},{"title":"Shell","url":"#shell"},{"title":"Swift","url":"#swift"},{"title":"No language set","url":"#no-language-set"},{"title":"Last section","url":"#last-section"}]},"navLevels":3,"showTimeToRead":true,"timeToRead":0,"estimatedTimeToRead":1}},"pageContext":{"slug":"/views/code-blocks","shortTitle":"Code blocks","hasReleaseNotes":true}},
    "staticQueryHashes": ["2494036674","3227520225","3295477089","3359654165","3845541775","636942989","801034918"]}