Fixed development environment and overrides

This commit is contained in:
squidfunk 2022-11-11 18:39:38 +01:00
parent c62ff2c283
commit 6a1b86e8c6
41 changed files with 41 additions and 63 deletions

View File

@ -3,4 +3,4 @@ template: home.html
title: Material for MkDocs title: Material for MkDocs
--- ---
Welcome to Material for MkDocs. Welcome to Material for MkDocs.

View File

@ -0,0 +1 @@
{"version":3,"sources":["src/.overrides/assets/stylesheets/custom/_typeset.scss","../../../../src/.overrides/assets/stylesheets/custom.scss","src/assets/stylesheets/utilities/_break.scss","src/.overrides/assets/stylesheets/custom/layout/_banner.scss","src/.overrides/assets/stylesheets/custom/layout/_hero.scss","src/.overrides/assets/stylesheets/custom/layout/_iconsearch.scss","src/.overrides/assets/stylesheets/custom/layout/_sponsorship.scss"],"names":[],"mappings":"AA2BA,iBACE,cAIE,kBC7BF,CDgCA,QAEE,qBC/BF,CACF,CD0CE,qBACE,aCxCJ,CD4CE,uBACE,UC1CJ,CD6CI,8BAGE,QAAA,CACA,sBAAA,CAHA,iBAAA,CACA,UCzCN,CD+CI,8BAOE,WAAA,CAFA,WAAA,CAFA,MAAA,CAGA,eAAA,CALA,iBAAA,CACA,KAAA,CAEA,UC1CN,CDkDE,uBACE,2BChDJ,CDoDE,0BACE,aClDJ,CDsDE,+BACE,cAAA,CACA,uBCpDJ,CDuDI,0EAEE,WCtDN,CD0DI,oCAGE,2CAAA,CADA,gCAAA,CADA,aCtDN,CD6DE,4BACE,UAAA,CACA,uBC3DJ,CD8DI,2EAEE,SC7DN,CDqEI,wDAEE,cCnEN,CC2JI,wCF1FA,wDAMI,eClEN,CACF,CDsEI,4BACE,kBCpEN,CDyEE,wBACE,YAAA,CACA,gBCvEJ,CD0EI,4BAEE,kBAAA,CADA,WCvEN,CD+EM,sCACE,aAAA,CACA,kBC7ER,CDiFM,+BACE,aC/ER,CEnDE,mDAGE,kBFsDJ,CElDE,kBACE,kBFoDJ,CEhDE,8BACE,gBFkDJ,CEnDE,8BACE,iBFkDJ,CGlEA,eAEE,u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,CKhMI,6BACE,cLkMN,CK9LI,sCACE,YAAA,CACA,cAAA,CACA,sBLgMN,CK7LM,wCACE,aAAA,CACA,aL+LR,CKtLI,mCACE,YLwLN,CKrLM,yCAEE,UAAA,CACA,UAAA,CAFA,aLyLR,CKlLI,6CAEE,UL2LN,CK7LI,6CAEE,WL2LN,CK7LI,mCAOE,kBAAA,CANA,aAAA,CAGA,aAAA,CACA,YAAA,CACA,eAAA,CAEA,kBAAA,CACA,sCACE,CAPF,YL0LN,CK/KM,kFAEE,oBLgLR,CK7KQ,0FACE,mBL+KV,CK1KM,4CAME,+CAAA,CALA,yCAAA,CAEA,eAAA,CADA,eAAA,CAEA,kBAAA,CACA,iBL6KR,CKxKM,uCACE,aAAA,CAGA,mCAAA,CADA,WAAA,CAEA,uBAAA,CAHA,UL6KR,CKpKE,oCACE,eLsKJ,CKlKE,sEAEE,eLoKJ","file":"custom.css"}

View File

@ -3,7 +3,7 @@
-#} -#}
{% extends "base.html" %} {% extends "base.html" %}
{% block extrahead %} {% block extrahead %}
<link rel="stylesheet" href="{{ 'overrides/assets/stylesheets/main.7073df5a.min.css' | url }}"> <link rel="stylesheet" href="{{ 'assets/stylesheets/custom.7073df5a.min.css' | url }}">
{% endblock %} {% endblock %}
{% block announce %} {% block announce %}
<a href="https://twitter.com/squidfunk"> <a href="https://twitter.com/squidfunk">
@ -16,5 +16,5 @@
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
{{ super() }} {{ super() }}
<script src="{{ 'overrides/assets/javascripts/bundle.d665d539.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/custom.525be7f2.min.js' | url }}"></script>
{% endblock %} {% endblock %}

View File

@ -1 +0,0 @@
{"version":3,"sources":["src/overrides/assets/stylesheets/main/_typeset.scss","../../../../src/overrides/assets/stylesheets/main.scss","src/assets/stylesheets/utilities/_break.scss","src/overrides/assets/stylesheets/main/layout/_banner.scss","src/overrides/assets/stylesheets/main/layout/_hero.scss","src/overrides/assets/stylesheets/main/lay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AAA,CACA,iBL6KR,CKxKM,uCACE,aAAA,CAGA,mCAAA,CADA,WAAA,CAEA,uBAAA,CAHA,UL6KR,CKpKE,oCACE,eLsKJ,CKlKE,sEAEE,eLoKJ","file":"main.css"}

View File

@ -34,9 +34,9 @@
{% if not config.theme.palette is mapping %} {% if not config.theme.palette is mapping %}
<form class="md-header__option" data-md-component="palette"> <form class="md-header__option" data-md-component="palette">
{% for option in config.theme.palette %} {% for option in config.theme.palette %}
{% set scheme = option.scheme | d("default", true) %} {% set scheme = option.scheme | d("default", true) %}
{% set primary = option.primary | d("indigo", true) %} {% set primary = option.primary %}
{% set accent = option.accent | d("indigo", true) %} {% set accent = option.accent %}
<input class="md-option" data-md-color-media="{{ option.media }}" data-md-color-scheme="{{ scheme | replace(' ', '-') }}" data-md-color-primary="{{ primary | replace(' ', '-') }}" data-md-color-accent="{{ accent | replace(' ', '-') }}" {% if option.toggle %} aria-label="{{ option.toggle.name }}" {% else %} aria-hidden="true" {% endif %} type="radio" name="__palette" id="__palette_{{ loop.index }}"> <input class="md-option" data-md-color-media="{{ option.media }}" data-md-color-scheme="{{ scheme | replace(' ', '-') }}" data-md-color-primary="{{ primary | replace(' ', '-') }}" data-md-color-accent="{{ accent | replace(' ', '-') }}" {% if option.toggle %} aria-label="{{ option.toggle.name }}" {% else %} aria-hidden="true" {% endif %} type="radio" name="__palette" id="__palette_{{ loop.index }}">
{% if option.toggle %} {% if option.toggle %}
<label class="md-header__button md-icon" title="{{ option.toggle.name }}" for="__palette_{{ loop.index0 or loop.length }}" hidden> <label class="md-header__button md-icon" title="{{ option.toggle.name }}" for="__palette_{{ loop.index0 or loop.length }}" hidden>

View File

@ -36,7 +36,7 @@ copyright: Copyright &copy; 2016 - 2022 Martin Donath
# Configuration # Configuration
theme: theme:
name: material name: material
custom_dir: material/overrides custom_dir: material/.overrides
features: features:
# - announce.dismiss # - announce.dismiss
- content.code.annotate - content.code.annotate

View File

@ -68,4 +68,4 @@ include = ["/material"]
[tool.hatch.build.targets.sdist] [tool.hatch.build.targets.sdist]
include = ["/material", "/package.json", "/requirements.txt"] include = ["/material", "/package.json", "/requirements.txt"]
exclude = ["/material/overrides"] exclude = ["/material/.overrides"]

View File

@ -80,7 +80,7 @@ export function mountIconSearch(
): Observable<Component<IconSearch>> { ): Observable<Component<IconSearch>> {
const config = configuration() const config = configuration()
const index$ = requestJSON<IconSearchIndex>( const index$ = requestJSON<IconSearchIndex>(
new URL("overrides/assets/javascripts/iconsearch_index.json", config.base) new URL("assets/javascripts/iconsearch_index.json", config.base)
) )
/* Retrieve query and result components */ /* Retrieve query and result components */

View File

@ -36,11 +36,9 @@
@import "config"; @import "config";
@import "main/typeset"; @import "custom/typeset";
@import "main/layout/banner"; @import "custom/layout/banner";
@import "main/layout/hero"; @import "custom/layout/hero";
@import "main/layout/iconsearch"; @import "custom/layout/iconsearch";
@import "main/layout/sponsorship"; @import "custom/layout/sponsorship";
@import "main/shame";

View File

@ -28,7 +28,7 @@
<!-- Extra style sheets (can't be set in mkdocs.yml due to content hash) --> <!-- Extra style sheets (can't be set in mkdocs.yml due to content hash) -->
<link <link
rel="stylesheet" rel="stylesheet"
href="{{ 'overrides/assets/stylesheets/main.css' | url }}" href="{{ 'assets/stylesheets/custom.css' | url }}"
/> />
{% endblock %} {% endblock %}
@ -48,5 +48,5 @@
{{ super() }} {{ super() }}
<!-- Extra JavaScript (can't be set in mkdocs.yml due to content hash) --> <!-- Extra JavaScript (can't be set in mkdocs.yml due to content hash) -->
<script src="{{ 'overrides/assets/javascripts/bundle.js' | url }}"></script> <script src="{{ 'assets/javascripts/custom.js' | url }}"></script>
{% endblock %} {% endblock %}

View File

@ -159,9 +159,9 @@
{% if not palette is mapping %} {% if not palette is mapping %}
{% set palette = palette | first %} {% set palette = palette | first %}
{% endif %} {% endif %}
{% set scheme = palette.scheme | d("default", true) %} {% set scheme = palette.scheme | d("default", true) %}
{% set primary = palette.primary | d("indigo", true) %} {% set primary = palette.primary %}
{% set accent = palette.accent | d("indigo", true) %} {% set accent = palette.accent %}
<body <body
dir="{{ direction }}" dir="{{ direction }}"
data-md-color-scheme="{{ scheme | replace(' ', '-') }}" data-md-color-scheme="{{ scheme | replace(' ', '-') }}"

View File

@ -1,25 +0,0 @@
////
/// Copyright (c) 2016-2022 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// ----------------------------------------------------------------------------
// Nothing to see here, move along
// ----------------------------------------------------------------------------

View File

@ -73,9 +73,9 @@
{% if not config.theme.palette is mapping %} {% if not config.theme.palette is mapping %}
<form class="md-header__option" data-md-component="palette"> <form class="md-header__option" data-md-component="palette">
{% for option in config.theme.palette %} {% for option in config.theme.palette %}
{% set scheme = option.scheme | d("default", true) %} {% set scheme = option.scheme | d("default", true) %}
{% set primary = option.primary | d("indigo", true) %} {% set primary = option.primary %}
{% set accent = option.accent | d("indigo", true) %} {% set accent = option.accent %}
<input <input
class="md-option" class="md-option"
data-md-color-media="{{ option.media }}" data-md-color-media="{{ option.media }}"

View File

@ -49,6 +49,7 @@ import glob from "tiny-glob"
interface ResolveOptions { interface ResolveOptions {
cwd: string /* Working directory */ cwd: string /* Working directory */
watch?: boolean /* Watch mode */ watch?: boolean /* Watch mode */
dot?: boolean /* Hidden files or directories */
} }
/** /**
@ -106,7 +107,7 @@ function now() {
export function resolve( export function resolve(
pattern: string, options?: ResolveOptions pattern: string, options?: ResolveOptions
): Observable<string> { ): Observable<string> {
return from(glob(pattern, options)) return from(glob(pattern, { ...options, dot: true }))
.pipe( .pipe(
catchError(() => EMPTY), catchError(() => EMPTY),
concatAll(), concatAll(),

View File

@ -169,7 +169,7 @@ const sources$ = copyAll("**/*.py", {
const stylesheets$ = resolve("**/[!_]*.scss", { cwd: "src" }) const stylesheets$ = resolve("**/[!_]*.scss", { cwd: "src" })
.pipe( .pipe(
mergeMap(file => zip( mergeMap(file => zip(
of(ext(file, ".css")), of(ext(file, ".css").replace(".overrides/", "")),
transformStyle({ transformStyle({
from: `src/${file}`, from: `src/${file}`,
to: ext(`${base}/${file}`, ".css") to: ext(`${base}/${file}`, ".css")
@ -178,10 +178,10 @@ const stylesheets$ = resolve("**/[!_]*.scss", { cwd: "src" })
) )
/* Transform scripts */ /* Transform scripts */
const javascripts$ = resolve("**/{bundle,search}.ts", { cwd: "src" }) const javascripts$ = resolve("**/{custom,bundle,search}.ts", { cwd: "src" })
.pipe( .pipe(
mergeMap(file => zip( mergeMap(file => zip(
of(ext(file, ".js")), of(ext(file, ".js").replace(".overrides/", "")),
transformScript({ transformScript({
from: `src/${file}`, from: `src/${file}`,
to: ext(`${base}/${file}`, ".js") to: ext(`${base}/${file}`, ".js")
@ -209,7 +209,10 @@ const manifest$ = merge(
.pipe( .pipe(
scan((prev, mapping) => ( scan((prev, mapping) => (
mapping.reduce((next, [key, value]) => ( mapping.reduce((next, [key, value]) => (
next.set(key, value.replace(`${base}/`, "")) next.set(key, value.replace(
new RegExp(`${base}\\/(\.overrides\\/)?`),
""
))
), prev) ), prev)
), new Map<string, string>()), ), new Map<string, string>()),
) )
@ -222,6 +225,7 @@ const templates$ = manifest$
to: base, to: base,
watch: process.argv.includes("--watch"), watch: process.argv.includes("--watch"),
transform: async data => { transform: async data => {
console.log(manifest)
const metadata = require("../../package.json") const metadata = require("../../package.json")
const banner = const banner =
"{#-\n" + "{#-\n" +
@ -300,7 +304,7 @@ const index$ = zip(icons$, emojis$)
} as IconSearchIndex } as IconSearchIndex
}), }),
switchMap(data => write( switchMap(data => write(
`${base}/overrides/assets/javascripts/iconsearch_index.json`, `${base}/.overrides/assets/javascripts/iconsearch_index.json`,
JSON.stringify(data) JSON.stringify(data)
)) ))
) )

View File

@ -20,7 +20,7 @@
"noUnusedParameters": true, "noUnusedParameters": true,
"paths": { "paths": {
"~/*": ["./assets/javascripts/*"], "~/*": ["./assets/javascripts/*"],
"_/*": ["./overrides/assets/javascripts/*"] "_/*": ["./.overrides/assets/javascripts/*"]
}, },
"removeComments": false, "removeComments": false,
"sourceMap": true, "sourceMap": true,
@ -34,7 +34,7 @@
}, },
"include": [ "include": [
"src/assets/javascripts", "src/assets/javascripts",
"src/overrides/assets/javascripts", "src/.overrides/assets/javascripts",
"tools", "tools",
"typings" "typings"
] ]