Skip to content

Commit

Permalink
updated site
Browse files Browse the repository at this point in the history
  • Loading branch information
abrighton committed Feb 27, 2024
1 parent 2aab059 commit 36ad123
Show file tree
Hide file tree
Showing 68 changed files with 8,395 additions and 0 deletions.
17 changes: 17 additions & 0 deletions assets/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.snippet-button {
float: right;
vertical-align: middle;
padding: 0.25em 0.25em;
border: 1px solid #ddd;
margin: 0.25em;
border-radius: 5px;
cursor: pointer;
}

.copy-snippet {
visibility: hidden;
}

.snippet-button:hover {
background: #c5cae9;
}
4 changes: 4 additions & 0 deletions assets/fonts/font-awesome.css

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions assets/fonts/material-icons.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*!
* 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.
*/@font-face{font-family:"Material Icons";font-style:normal;font-weight:400;src:local("Material Icons"),local("MaterialIcons-Regular"),url("specimen/MaterialIcons-Regular.woff2") format("woff2"),url("specimen/MaterialIcons-Regular.woff") format("woff"),url("specimen/MaterialIcons-Regular.ttf") format("truetype")}
Binary file added assets/fonts/specimen/FontAwesome.ttf
Binary file not shown.
Binary file added assets/fonts/specimen/FontAwesome.woff
Binary file not shown.
Binary file added assets/fonts/specimen/FontAwesome.woff2
Binary file not shown.
Binary file added assets/fonts/specimen/MaterialIcons-Regular.ttf
Binary file not shown.
Binary file added assets/fonts/specimen/MaterialIcons-Regular.woff
Binary file not shown.
Binary file added assets/fonts/specimen/MaterialIcons-Regular.woff2
Binary file not shown.
Binary file added assets/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/javascripts/application.583bbe55.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions assets/javascripts/modernizr.1aa3b519.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

216 changes: 216 additions & 0 deletions assets/javascripts/paradox-material-theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
/*!
Paradox Material Theme
Copyright (c) 2017 Jonas Fonseca
License: MIT
*/

function initParadoxMaterialTheme() {
// callout -> ammonition
document.querySelectorAll('.callout').forEach(callout => {
callout.classList.add('admonition')
callout.querySelectorAll('.callout-title').forEach(title => {
title.classList.add('admonition-title')
})
callout.style.visibility = 'visible';
})

var headers = ['h2', 'h3', 'h4', 'h5', 'h6']
headers.forEach(headerName => {
document.querySelectorAll(headerName).forEach(header => {
var link = header.querySelector('a')
if (link) {
header.id = link.name
link.name = ''
header.removeChild(link)
link.text = '¶'
link.title = 'Permanent link'
link.className = 'headerlink'
header.appendChild(link)
}
})
})

document.querySelectorAll('nav.md-nav--primary > ul').forEach((root, rootIndex) => {
function createNavToggle(path, active) {
var input = document.createElement('input')
input.classList.add('md-toggle')
input.classList.add('md-nav__toggle')
input.type = 'checkbox'
input.id = path
input.checked = active || false
input.setAttribute('data-md-toggle', path)
return input
}

function createNavLabel(path, active, contentNode) {
var label = document.createElement('label')
label.classList.add('md-nav__link')
if (active)
label.classList.add('md-nav__link--active')
label.setAttribute('for', path)
if (contentNode)
label.appendChild(contentNode)
return label
}

function visitListItem(item, path, level) {
item.classList.add('md-nav__item')

var link = item.querySelector(':scope > a')
if (link) {
link.classList.add('md-nav__link')
link.classList.remove('page')
if (link.classList.contains('active')) {
item.classList.add('md-nav__item--active')
link.classList.add('md-nav__link--active')
}
link.setAttribute('data-md-state', '')
}

var nestedNav = null
var nestedRoot = item.querySelector(':scope > ul')
if (nestedRoot) {
var active = item.querySelector(':scope a.active') != null
item.classList.add('md-nav__item--nested')
var nestedNav = document.createElement('nav')
nestedNav.classList.add('md-nav')
nestedNav.setAttribute('data-md-component', 'collapsible')
nestedNav.setAttribute('data-md-level', level)

var input = createNavToggle(path, active)

var label = createNavLabel(path, false, link)
if (link)
link.classList.remove('md-nav__link')

var labelInner = document.createElement('label')
labelInner.classList.add('md-nav__title')
labelInner.setAttribute('for', path)
labelInner.textContent = link ? link.textContent : '???'

nestedNav.appendChild(labelInner)
nestedNav.appendChild(nestedRoot)
item.appendChild(input)
item.appendChild(label)
item.appendChild(nestedNav)
visitList(nestedRoot, path, level + 1)
}

if (link && link.classList.contains('active')) {
var toc = document.querySelector('nav.md-nav--primary > .md-nav--secondary')
if (toc && toc.children.length > 0) {
var input = createNavToggle('__toc', false)
var labelText = nestedNav ? 'Table of contents' : link ? link.textContent : '???'
var label = createNavLabel('__toc', true, document.createTextNode(labelText))

if (nestedNav) {
var node = nestedNav.children[1]
nestedNav.insertBefore(input, node)
nestedNav.insertBefore(label, node)
nestedNav.appendChild(toc)
} else if (link) {
item.insertBefore(input, link)
item.insertBefore(label, link)
item.appendChild(toc)
}
}
}
}

function visitList(list, path, level) {
list.classList.add('md-nav__list')
list.setAttribute('data-md-scrollfix', '')
list.querySelectorAll('li').forEach((item, itemIndex) => {
visitListItem(item, path + '-' + itemIndex, level)
})
}

visitList(root, 'nav-' + rootIndex, 1)
var projectVersion = document.getElementById("project.version")
if (projectVersion) {
root.appendChild(projectVersion)
}
root.parentNode.style.visibility = 'visible'
})

document.querySelectorAll('.md-sidebar--secondary .md-nav--secondary > ul').forEach(tocRoot => {
function visitListItem(item) {
item.classList.add('md-nav__item')
item.querySelectorAll(':scope> a').forEach(link => {
link.classList.add('md-nav__link')
link.setAttribute('data-md-state', '')
})
item.querySelectorAll(':scope > ul').forEach(list => {
visitList(list)
})
}

function visitList(list) {
list.classList.add('md-nav__list')
list.querySelectorAll(':scope > li').forEach(item => {
visitListItem(item)
})
}

var parent = tocRoot.parentNode
parent.removeChild(tocRoot)

tocRoot.querySelectorAll(':scope > li > ul').forEach(list => {
parent.append(list)
list.setAttribute('data-md-scrollfix', '')
visitList(list)
})

parent.style.visibility = 'visible';
})

document.querySelectorAll('dl').forEach(dl => {
const tabContents = dl.querySelectorAll(':scope > dd > pre')
if (tabContents.length > 0) {
dl.classList.add('mdc-tab-bar')
var first = true
var contentContainer = document.createElement('div')
contentContainer.classList.add('mdc-tab-content-container')

tabContents.forEach(pre => {
var dd = pre.parentNode
var dt = dd.previousSibling
while (dt.nodeType != dt.ELEMENT_NODE) {
dt = dt.previousSibling
}

var tabContent = document.createElement('div')
tabContent.classList.add('mdc-tab-content')
contentContainer.appendChild(tabContent)
while (dd.childNodes.length > 0) {
tabContent.appendChild(dd.childNodes[0]);
}
dl.removeChild(dd)

dt.classList.add('mdc-tab')
if (first) {
dt.classList.add('mdc-tab--active')
tabContent.classList.add('mdc-tab-content--active')
}
first = false
dt.onclick = event => {
dl.querySelectorAll(':scope .mdc-tab--active').forEach(active => {
active.classList.remove('mdc-tab--active')
})
contentContainer.querySelectorAll(':scope .mdc-tab-content--active').forEach(active => {
active.classList.remove('mdc-tab-content--active')
})
dt.classList.add('mdc-tab--active')
tabContent.classList.add('mdc-tab-content--active')
}
})

if (dl.nextSibling)
dl.parentNode.insertBefore(contentContainer, dl.nextSibling)
else
dl.parentNode.appendChild(contentContainer)
}
})
}

initParadoxMaterialTheme()
Loading

0 comments on commit 36ad123

Please sign in to comment.