Skip to content

Instantly share code, notes, and snippets.

@eriwen
Last active February 21, 2024 12:08
Show Gist options
  • Save eriwen/84d222972eeb5db3d5c784abdd7fbd5e to your computer and use it in GitHub Desktop.
Save eriwen/84d222972eeb5db3d5c784abdd7fbd5e to your computer and use it in GitHub Desktop.
Multi-language examples for asciidoctor, including all the intermediate transforms, CSS, and HTML, and asciidoc source
<!-- This is the minimal HTML output needed for the CSS and JS to work (generated by Asciidoc for Gradle) -->
<div class="exampleblock testable-sample multi-language-sample">
<div class="title">build.gradle</div>
<div class="content">
<pre class="prettyprint highlight"><code class="language-groovy" data-lang="groovy">logging.captureStandardOutput LogLevel.INFO
println 'A message which is logged at INFO level'</code></pre>
</div>
</div>
<div class="exampleblock testable-sample multi-language-sample">
<div class="title">build.gradle.kts</div>
<div class="content">
<pre class="prettyprint highlight"><code class="language-kotlin" data-lang="kotlin">logging.captureStandardOutput(LogLevel.INFO)
println("A message which is logged at INFO level")</code></pre>
</div>
</div>
Example 1. My Title
build.gradle
link:samplesDir/my-sample/build.gradle[role=include]
build.gradle.kts
link:samplesDir/my-sample/build.gradle.kts[role=include]
.exampleblock > .content {
background-color: inherit;
border: 0 none;
box-shadow: none;
padding: 0;
}
.exampleblock > .content .title {
background-color: #f7f7f8;
border-top: 1px solid #ccc;
font-family: 'Inconsolata', monospace;
margin: 0;
padding: 1em 1em 0;
}
.exampleblock .listingblock {
margin: 0;
}
/* Multi-language selection */
.multi-language-selector .language-option[data-lang='groovy'],
.exampleblock[data-lang=groovy] > .content .title {
background-image: url('data:image/svg+xml;base64,PHN2Zw0KICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIg0KICAgd2lkdGg9IjYxNC4wNjA4NSINCiAgIGhlaWdodD0iMzAzLjU5ODYiDQogICB2ZXJzaW9uPSIxLjEiPg0KICA8Zw0KICAgICB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzUuMzk2NTk5LC0zMC41NTgxOTYpIj4NCiAgICA8cGF0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LTAuNDA0ODQgNS41OTQ3OSwtMC43Mzc1NyA2LjkzNDkxLC0wLjczOTM4IDQuMjg1NTEsLTAuMDA2IDYuOTAzMTksMi4wOTU5NSAxMS44OTI1MSw5LjU0ODU5IDMuNDQzNTEsNS4xNDM2NSAxMC45NzM5NiwxNy43NTUwOCAxMC45NzM5NiwxOC4zNzgzNiAwLDAuMzI0MDcgLTAuMzUxNDUsMC41NTIwOCAtMC44NTA5NywwLjU1MjA4IC0xLjA1MTA5LDAgLTUuNjIzMTQsLTEuMjQzOCAtOC45MzIxNCwtMi40Mjk5NCAtNC4zNDg1LC0xLjU1ODc1IC01Ny4yNzIzOCwtMjIuMDA1MjYgLTc0Ljc0Nzg2LC0yOC44Nzc5NSAtNDYuNjYzNSwtMTguMzUxNjIgLTYyLjAyODA1LC0yNC4yMTI0NiAtNjkuNTM2NTcsLTI2LjUyNDg5IC04LjExNDE3LC0yLjQ5ODk1IC0xMy42NDAyOSwtMy4wODUyMiAtMTguMTI2NjEsLTEuOTIzMDYgLTUuNTc5OTYsMS40NDU0NiAtODEuNzIwNjcsMzAuODY4ODggLTEyNi4xMzI0NSw0OC43NDE5NSAtMjEuOTMxMTksOC44MjYgLTI0LjY3NzQ5LDkuODc1NzcgLTI4Ljc4MTE2LDExLjAwMTU5IC0zLjI2MzAzLDAuODk1MjEgLTMuMTQ0MDcsMC44ODI5NCAtMy4xNDQwNywwLjMyNDI2IHoiIC8+DQogIDwvZz4NCjwvc3ZnPg==');
background-position: 16px 80%;
background-repeat: no-repeat;
background-size: 20px 12px;
padding-left: 2.5em;
}
.multi-language-selector .language-option[data-lang='kotlin'],
.exampleblock[data-lang=kotlin] > .content .title {
background-image: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCA2MCA2MCIgc3R5bGU9ImVuYWJsZS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5bGU9ImZpbGw6dXJsKCNTVkdJRF8yXyk7IiBwb2ludHM9IjMwLjEsMCAwLDMxLjcgMCw2MCAzMC4xLDI5LjkgNjAsMCAJIi8+DQo8L2c+DQo8L3N2Zz4=');
background-position: 17px 80%;
background-repeat: no-repeat;
background-size: 11px 11px;
padding-left: 2.3em;
}
.multi-language-selector {
display: block;
}
.multi-language-selector .language-option[data-lang='groovy'] {
background-position: 20px center;
padding-left: 32px;
}
.multi-language-selector .language-option[data-lang='kotlin'] {
background-position: 30px center;
padding-left: 27px;
}
.multi-language-selector .language-option {
background-color: white;
border: 1px solid #f7f7f8;
border-radius: 4px 4px 0 0;
cursor: pointer;
display: inline-block;
font-weight: normal;
font-family: 'Lato', Arial, sans-serif;
margin: 0;
padding: 4px 20px;
min-width: 130px;
max-width: 320px;
text-align: center;
filter: grayscale(1);
-webkit-filter: grayscale(1);
opacity: 0.7;
}
.multi-language-selector .language-option.selected {
background-color: #f7f7f8;
color: #02303a;
filter: none;
-webkit-filter: none;
opacity: 1;
}
.multi-language-text.hidden,
.multi-language-selector ~ .multi-language-sample.hidden {
display: none;
}
.multi-language-sample {
border-radius: 0 0 4px 4px;
}
function postProcessCodeBlocks() {
// Assumptions:
// 1) All siblings that are marked with class="multi-language-sample" should be grouped
// 2) Only one language can be selected per domain (to allow selection to persist across all docs pages)
// 3) There is exactly 1 small set of languages to choose from. This does not allow for multiple language preferences. For example, users cannot prefer both Kotlin and ZSH.
// 4) Only 1 sample of each language can exist in the same collection.
var GRADLE_DSLs = ["groovy", "kotlin"];
var preferredBuildScriptLanguage = initPreferredBuildScriptLanguage();
// Ensure preferred DSL is valid, defaulting to Groovy DSL
function initPreferredBuildScriptLanguage() {
var lang = window.localStorage.getItem("preferred-gradle-dsl");
if (GRADLE_DSLs.indexOf(lang) === -1) {
window.localStorage.setItem("preferred-gradle-dsl", "groovy");
lang = "groovy";
}
return lang;
}
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
function processSampleEl(sampleEl, prefLangId) {
var codeEl = sampleEl.querySelector("code[data-lang]");
if (codeEl != null) {
sampleEl.setAttribute("data-lang", codeEl.getAttribute("data-lang"));
if (codeEl.getAttribute("data-lang") !== prefLangId) {
sampleEl.classList.add("hidden");
} else {
sampleEl.classList.remove("hidden");
}
}
}
function switchSampleLanguage(languageId) {
var multiLanguageSampleElements = [].slice.call(document.querySelectorAll(".multi-language-sample"));
// Array of Arrays, each top-level array representing a single collection of samples
var multiLanguageSets = [];
for (var i = 0; i < multiLanguageSampleElements.length; i++) {
var currentCollection = [multiLanguageSampleElements[i]];
var currentSampleElement = multiLanguageSampleElements[i];
processSampleEl(currentSampleElement, languageId);
while (currentSampleElement.nextElementSibling != null && currentSampleElement.nextElementSibling.classList.contains("multi-language-sample")) {
currentCollection.push(currentSampleElement.nextElementSibling);
currentSampleElement = currentSampleElement.nextElementSibling;
processSampleEl(currentSampleElement, languageId);
i++;
}
multiLanguageSets.push(currentCollection);
}
multiLanguageSets.forEach(function (sampleCollection) {
// Create selector element if not existing
if (sampleCollection.length > 1 &&
(sampleCollection[0].previousElementSibling == null ||
!sampleCollection[0].previousElementSibling.classList.contains("multi-language-selector"))) {
var languageSelectorFragment = document.createDocumentFragment();
var multiLanguageSelectorElement = document.createElement("div");
multiLanguageSelectorElement.classList.add("multi-language-selector");
languageSelectorFragment.appendChild(multiLanguageSelectorElement);
sampleCollection.forEach(function (sampleEl) {
var optionEl = document.createElement("code");
var sampleLanguage = sampleEl.getAttribute("data-lang");
optionEl.setAttribute("data-lang", sampleLanguage);
optionEl.setAttribute("role", "button");
optionEl.classList.add("language-option");
optionEl.innerText = capitalizeFirstLetter(sampleLanguage);
optionEl.addEventListener("click", function updatePreferredLanguage(evt) {
var preferredLanguageId = optionEl.getAttribute("data-lang");
window.localStorage.setItem("preferred-gradle-dsl", preferredLanguageId);
// Record how far down the page the clicked element is before switching all samples
var beforeOffset = evt.target.offsetTop;
switchSampleLanguage(preferredLanguageId);
// Scroll the window to account for content height differences between different sample languages
window.scrollBy(0, evt.target.offsetTop - beforeOffset);
});
multiLanguageSelectorElement.appendChild(optionEl);
});
sampleCollection[0].parentNode.insertBefore(languageSelectorFragment, sampleCollection[0]);
}
});
[].slice.call(document.querySelectorAll(".multi-language-selector .language-option")).forEach(function (optionEl) {
if (optionEl.getAttribute("data-lang") === languageId) {
optionEl.classList.add("selected");
} else {
optionEl.classList.remove("selected");
}
});
[].slice.call(document.querySelectorAll(".multi-language-text")).forEach(function (el) {
if (!el.classList.contains("lang-" + languageId)) {
el.classList.add("hidden");
} else {
el.classList.remove("hidden");
}
});
}
switchSampleLanguage(preferredBuildScriptLanguage);
}
document.addEventListener("DOMContentLoaded", function(event) {
postProcessFooter();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment