{% comment %} Copyright (C) 2020 Google LLC. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.foobar2 {% endcomment %} {% comment %} This adds logic for creating code snippets with selector buttons for different languages. Usage should be as follows in the markdown files if you want the buttons embedded into the page. To add buttons for Java and Kotlin: {::options parse_block_html="true" /}
{::options parse_block_html="false" /} Then the code snippets need to be written with the correct class selectors: ```java Java code example ``` {: .c-codeselector__code .c-codeselector__code_java } ```kotlin Kotlin code example ``` {: .c-codeselector__code .c-codeselector__code_kotlin } Also, in the _config.yml, two variables must be defined: enableCodeSelector: true defaultCodeLanguage: "java" This enables the code selector logic and chooses the site-wide default language. {% endcomment %} {% if site.enableCodeSelector %} {% endif %}