From 934a42125d52cfd1f91a29ea2d90208d3f2fe1eb Mon Sep 17 00:00:00 2001 From: Frotty Date: Fri, 16 Oct 2026 00:09:41 +0200 Subject: [PATCH] Remove unused website templates and consolidate Sass --- .gitignore | 2 +- README.md | 28 ++++-- _config.yml | 1 - _includes/branding_blog.html | 10 --- _includes/navigation_blog.html | 18 ---- _includes/promo.html | 28 ------ _layouts/documentation.html | 94 -------------------- _layouts/post.html | 88 ------------------- _layouts/tutorialdoc.html | 95 --------------------- _sass/doc.scss | 129 ---------------------------- _sass/landing.scss | 12 --- _sass/mixins.scss | 142 ------------------------------- _sass/{styles.scss => site.scss} | 0 _sass/theme-default.scss | 56 ++---------- assets/css/styles.scss | 7 +- tools/docgen/emit.ts | 3 +- tools/docgen/hotdoc.ts | 9 -- 17 files changed, 27 insertions(+), 695 deletions(-) delete mode 100644 _includes/branding_blog.html delete mode 100644 _includes/navigation_blog.html delete mode 100644 _includes/promo.html delete mode 100644 _layouts/documentation.html delete mode 100644 _layouts/post.html delete mode 100644 _layouts/tutorialdoc.html rename _sass/{styles.scss => site.scss} (100%) diff --git a/.gitignore b/.gitignore index bb0554e..5eaa389 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ _site _stdlib # Pagefind search index is generated by CI (.github/workflows/pages.yml) on -# every deploy. Never commit it — a hand-committed index drifts out of sync +# every deploy. Never commit it: a hand-committed index drifts out of sync # with the content and breaks search. pagefind/ node_modules/ diff --git a/README.md b/README.md index e0e4355..354c5c1 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,18 @@ This folder contains the complete source of the WurstScript website, configured `bundler install` -4. Run the server with: +4. Generate the API reference from a sibling checkout of `WurstStdlib2` + (requires Deno 2.x): + + ```shell + cd tools/docgen + deno task gen + cd ../.. + ``` + + See [the doc generator guide](tools/docgen/README.md) for custom source paths. + +5. Run the server with: `bundler exec jekyll serve` @@ -57,14 +68,13 @@ To create a new tutorial: Adding a standard library doc page works almost the same as tutorials. -* Create a new table of contents file in `_doc/stdlib/` -* Create a new set of tuturial pages in a subfolder of `_doc/stdlib/`, e.g. `_doc/stdlib/new_doc` -* Define the pages by changing the contents of `_doc/stdlib/new_doc/` -* __This part differs__ Add the new doc page to the stdlib index in `_doc/stdlib/intro.md`. Entries should be alphabetically sorted. -* Setup `new_doc.md` as necessary for your pages: - - Edit the title, excerpt, date, color. - - Change the `sections` to match the uri of the pages of your tutorial. -* Write your new_doc pages, being sure to update the heading sections as necessary. +* Create a guide in `_doc/stdlib/` with the `stdlibdoc` layout. Use an existing guide as a starting point. +* Put supporting section pages in a subfolder and list their document IDs in the guide's `sections` frontmatter. +* Link the guide from the relevant category in `_doc/stdlib/intro.md`. +* Add its package-to-guide mapping to `_data/stdlib_curated.yml` to link it from the generated API reference. + +API pages under `_doc/stdlib/ref/` are generated from standard-library source comments. +See [the doc generator guide](tools/docgen/README.md) before updating them. ## Search Index diff --git a/_config.yml b/_config.yml index 3cc1d85..6873667 100644 --- a/_config.yml +++ b/_config.yml @@ -24,7 +24,6 @@ url: https://wurstlang.org baseurl: "" logo: /assets/images/wurst_icon64.png image: /assets/images/wurst_icon300.png -blogurl: /blog highlighter: rouge title: &site_title WurstScript description: &site_description Programming language and IDE that compiles to Jass/Lua which is used in WarCraft III. The first complete, all-in-one warcraft modding environment. Get starting making your own warcraft 3 maps today - cross platform and editor independent. diff --git a/_includes/branding_blog.html b/_includes/branding_blog.html deleted file mode 100644 index 1f24599..0000000 --- a/_includes/branding_blog.html +++ /dev/null @@ -1,10 +0,0 @@ - - -
-

- - {% include icon.html icon=site.branding.icon %} - {{ site.branding.highlight }}{{ site.branding.blog }} - -

-
diff --git a/_includes/navigation_blog.html b/_includes/navigation_blog.html deleted file mode 100644 index d6005fb..0000000 --- a/_includes/navigation_blog.html +++ /dev/null @@ -1,18 +0,0 @@ - - -
- {% for navigation in include.navigation %} - {% assign post = site.doc | where: "id", navigation | first %} -
-
- Responsive image -

{{ post.title }}

-

{{ post.author }}

-

{{ post.date | date: '%B %d, %Y' }}

-
-

{{ post.excerpt | markdownify | remove: '

' | remove: '

' }}

- -
-
- {% endfor %} -
\ No newline at end of file diff --git a/_includes/promo.html b/_includes/promo.html deleted file mode 100644 index bbf3ccf..0000000 --- a/_includes/promo.html +++ /dev/null @@ -1,28 +0,0 @@ - -{% if include.promo %} -
-
-
-

{{ include.promo.title | markdownify }}

-
- -
-
-
-

{{ include.promo.content.title | markdownify }}

- {{ include.promo.content.desc | markdownify }} -
-
-
-
-
-
-
-{% endif %} diff --git a/_layouts/documentation.html b/_layouts/documentation.html deleted file mode 100644 index fde7c58..0000000 --- a/_layouts/documentation.html +++ /dev/null @@ -1,94 +0,0 @@ ---- -layout: compress ---- - - - - - - - -{% include head.html %} - - - -
- - {% include header.html %} - -
- {{ page.title }} - -
-
-

Documentation

-
Learn WurstScript.
-
-
- - - -
-

Tutorials

- -
- {% assign posts = site.tutorials | sort: 'date' | reverse %} - {% for post in posts %} - - -
- {% if post.image %} - {% endif %} -
-
-

{{ post.title }}

-

{{ post.excerpt }}

-
-
- {% endfor %} -
- -
- -
- -
- - - - {% include footer.html %} - - - - diff --git a/_layouts/post.html b/_layouts/post.html deleted file mode 100644 index 5647a7c..0000000 --- a/_layouts/post.html +++ /dev/null @@ -1,88 +0,0 @@ ---- -layout: compress ---- - - - - - - - -{% include head.html %} - - - -
- - - - -
-
- - -
- -

- {% include icon.html icon=page.icon %} {{ page.title }} -

- - {% if page.date %} -
- Published: {{ page.date | date: '%B %d, %Y' }}
- {% endif %} {% if page.author %} -
- Author: {{ page.author }}
- {% endif %} - -
- - -
- - -
-
- - {{ content | markdownify }} {% for id in page.sections %} {% assign section = site.doc | where: "id", id | first %} - -
-

{{ section.title }}

-
- {{ section.content | markdownify }} -
-
- - {% endfor %} - -
-
- - {% include sidebar.html sections=page.sections %} - -
- -
-
- -
- - {% include footer.html %} - - - - \ No newline at end of file diff --git a/_layouts/tutorialdoc.html b/_layouts/tutorialdoc.html deleted file mode 100644 index 204285f..0000000 --- a/_layouts/tutorialdoc.html +++ /dev/null @@ -1,95 +0,0 @@ ---- -layout: compress ---- - - - - - - - -{% include head.html %} - - - -
- - - - - {% include docs-navigation.html %} -
-
- - -
- -

- {% include icon.html icon=page.icon %} {{ page.title }} -

- - {% if page.date %} -
- Last updated: {{ page.date | date: '%B %d, %Y' }}
- {% endif %} {% if page.author %} -
- Author: {{ page.author }}
- {% endif %} - -
- - -
- - -
-
- {{ page.title }} - - {{ content | markdownify }} {% for id in page.sections %} {% assign section = site.doc | where: "id", id | first %} - -
-

{{ section.title }}

-
- {{ section.content | markdownify }} -
-
- - {% endfor %} - -
-
- - {% include sidebar.html sections=page.sections %} - -
- -
-
- -
- - {% include footer.html %} - - - - diff --git a/_sass/doc.scss b/_sass/doc.scss index df67acc..69c2a87 100644 --- a/_sass/doc.scss +++ b/_sass/doc.scss @@ -847,114 +847,6 @@ code { width: 230px; } -/* ===== Promo block ===== */ -.promo-block { - background: var(--color-primary-dark); - .body-green & { - background: var(--color-green-dark); - } - .body-blue & { - background: var(--color-blue-dark); - } - .body-orange & { - background: var(--color-orange-dark); - } - .body-pink & { - background: var(--color-pink-dark); - } - .body-purple & { - background: var(--color-purple-dark); - } - - a { - color: var(--text-on-brand-muted); - &:hover { - color: var(--text-on-brand); - } - } - .promo-block-inner { - padding: 45px; - color: var(--text-on-brand); - @include border-radius(4px); - } - .promo-title { - font-size: 20px; - font-weight: 800; - margin-top: 0; - margin-bottom: 45px; - .fa { - color: var(--text-on-brand-muted); - } - } - .figure-holder-inner { - background: var(--surface-1); - margin-bottom: 30px; - position: relative; - text-align: center; - img { - border: 5px solid var(--surface-1); - } - .mask { - display: block; - visibility: hidden; - position: absolute; - width: 100%; - height: 100%; - left: 0; - top: 0; - background: var(--overlay-light-65); - cursor: pointer; - text-decoration: none; - .icon { - color: var(--text-on-brand); - font-size: 42px; - display: block; - position: absolute; - width: 100%; - height: 100%; - top: 50%; - margin-top: -21px; - &.pink { - color: var(--color-pink); - } - } - } - &:hover { - .mask { - visibility: visible; - } - } - } - - .content-holder-inner { - padding-left: 15px; - padding-right: 15px; - } - - .content-title { - font-size: 16px; - font-weight: 600; - margin-top: 0; - } - - .highlight { - color: var(--text-on-brand-muted); - background: inherit; - } - - .btn-cta { - background: var(--overlay-dark-35); - border: none; - color: var(--text-on-brand) !important; - margin-bottom: 15px; - &:hover { - background: var(--overlay-dark-50); - border: none; - color: var(--text-on-brand) !important; - } - } -} - /* Extra small devices (phones, less than 768px) */ @media (max-width: 767px) { .doc-sidebar { @@ -979,28 +871,7 @@ code { font-size: 18px; } } - .promo-block .promo-block-inner { - padding: 30px 15px; - } - - .promo-block .content-holder-inner { - padding: 0; - } - .promo-block .promo-title { - margin-bottom: 30px; - } -} - -/* Small devices (tablets, 768px and up) */ -@media (min-width: 768px) { -} - -/* Medium devices (desktops, 992px and up) */ -@media (min-width: 992px) { -} -/* Large devices (large desktops, 1200px and up) */ -@media (min-width: 1200px) { } .doc-body:not(.news-article-page) { diff --git a/_sass/landing.scss b/_sass/landing.scss index 2b3112d..a0c71d1 100644 --- a/_sass/landing.scss +++ b/_sass/landing.scss @@ -562,15 +562,3 @@ flex-direction: column; } } - -/* Small devices (tablets, 768px and up) */ -@media (min-width: 768px) { -} - -/* Medium devices (desktops, 992px and up) */ -@media (min-width: 992px) { -} - -/* Large devices (large desktops, 1200px and up) */ -@media (min-width: 1200px) { -} diff --git a/_sass/mixins.scss b/_sass/mixins.scss index 27f469a..83164e5 100644 --- a/_sass/mixins.scss +++ b/_sass/mixins.scss @@ -1,28 +1,8 @@ -@mixin text-shadow ($string: 0 1px 3px rgba(0, 0, 0, 0.25)) { - text-shadow: $string; -} @mixin box-shadow ($string) { -webkit-box-shadow: $string; -moz-box-shadow: $string; box-shadow: $string; } -@mixin drop-shadow ($x: 0, $y: 1px, $blur: 2px, $spread: 0, $alpha: 0.25) { - -webkit-box-shadow: $x $y $blur $spread rgba(0, 0, 0, $alpha); - -moz-box-shadow: $x $y $blur $spread rgba(0, 0, 0, $alpha); - box-shadow: $x $y $blur $spread rgba(0, 0, 0, $alpha); -} -@mixin inner-shadow ($x: 0, $y: 1px, $blur: 2px, $spread: 0, $alpha: 0.25) { - -webkit-box-shadow: inset $x $y $blur $spread rgba(0, 0, 0, $alpha); - -moz-box-shadow: inset $x $y $blur $spread rgba(0, 0, 0, $alpha); - box-shadow: inset $x $y $blur $spread rgba(0, 0, 0, $alpha); -} - -@mixin box-sizing ($type: border-box) { - -webkit-box-sizing: $type; - -moz-box-sizing: $type; - box-sizing: $type; -} - @mixin border-radius ($radius: 5px) { -webkit-border-radius: $radius; -moz-border-radius: $radius; @@ -34,134 +14,12 @@ -webkit-background-clip: padding-box; background-clip: padding-box; } -@mixin border-radiuses ($topright: 0, $bottomright: 0, $bottomleft: 0, $topleft: 0) { - -webkit-border-top-right-radius: $topright; - -webkit-border-bottom-right-radius: $bottomright; - -webkit-border-bottom-left-radius: $bottomleft; - -webkit-border-top-left-radius: $topleft; - - -moz-border-radius-topright: $topright; - -moz-border-radius-bottomright: $bottomright; - -moz-border-radius-bottomleft: $bottomleft; - -moz-border-radius-topleft: $topleft; - - border-top-right-radius: $topright; - border-bottom-right-radius: $bottomright; - border-bottom-left-radius: $bottomleft; - border-top-left-radius: $topleft; - - -moz-background-clip: padding; - -webkit-background-clip: padding-box; - background-clip: padding-box; -} - -@mixin opacity ($opacity: 0.5) { - -webkit-opacity: $opacity; - -moz-opacity: $opacity; - opacity: $opacity; -} - -@mixin gradient ($startColor: #eee, $endColor: white) { - background-color: $startColor; - background: -webkit-gradient(linear, left top, left bottom, from($startColor), to($endColor)); - background: -webkit-linear-gradient(top, $startColor, $endColor); - background: -moz-linear-gradient(top, $startColor, $endColor); - background: -ms-linear-gradient(top, $startColor, $endColor); - background: -o-linear-gradient(top, $startColor, $endColor); -} -@mixin horizontal-gradient ($startColor: #eee, $endColor: white) { - background-color: $startColor; - background-image: -webkit-gradient(linear, left top, right top, from($startColor), to($endColor)); - background-image: -webkit-linear-gradient(left, $startColor, $endColor); - background-image: -moz-linear-gradient(left, $startColor, $endColor); - background-image: -ms-linear-gradient(left, $startColor, $endColor); - background-image: -o-linear-gradient(left, $startColor, $endColor); -} - -@mixin animation ($name, $duration: 300ms, $delay: 0, $ease: ease) { - -webkit-animation: $name $duration $delay $ease; - -moz-animation: $name $duration $delay $ease; - -ms-animation: $name $duration $delay $ease; -} - @mixin transition ($transition) { -webkit-transition: $transition; -moz-transition: $transition; -ms-transition: $transition; -o-transition: $transition; } -@mixin transform($string){ - -webkit-transform: $string; - -moz-transform: $string; - -ms-transform: $string; - -o-transform: $string; -} -@mixin scale ($factor) { - -webkit-transform: scale($factor); - -moz-transform: scale($factor); - -ms-transform: scale($factor); - -o-transform: scale($factor); -} -@mixin rotate ($deg) { - -webkit-transform: rotate($deg); - -moz-transform: rotate($deg); - -ms-transform: rotate($deg); - -o-transform: rotate($deg); -} -@mixin skew ($deg, $deg2) { - -webkit-transform: skew($deg, $deg2); - -moz-transform: skew($deg, $deg2); - -ms-transform: skew($deg, $deg2); - -o-transform: skew($deg, $deg2); -} -@mixin translate ($x, $y:0) { - -webkit-transform: translate($x, $y); - -moz-transform: translate($x, $y); - -ms-transform: translate($x, $y); - -o-transform: translate($x, $y); -} -@mixin translate3d ($x, $y: 0, $z: 0) { - -webkit-transform: translate3d($x, $y, $z); - -moz-transform: translate3d($x, $y, $z); - -ms-transform: translate3d($x, $y, $z); - -o-transform: translate3d($x, $y, $z); -} -@mixin perspective ($value: 1000) { - -webkit-perspective: $value; - -moz-perspective: $value; - -ms-perspective: $value; - perspective: $value; -} -@mixin transform-origin ($x:center, $y:center) { - -webkit-transform-origin: $x $y; - -moz-transform-origin: $x $y; - -ms-transform-origin: $x $y; - -o-transform-origin: $x $y; -} - -@mixin reset-box-sizing ($size:content-box) { - &, - *, - *:before, - *:after { - @include box-sizing($size); - } -} - -@mixin truncate ($max-width: 250px) { - max-width: $max-width; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -@mixin background-size ($string: contain) { - -webkit-background-size: $string; - -moz-background-size: $string; - -o-background-size: $string; - background-size: $string; -} - @mixin placeholder ($color: #999) { &::-webkit-input-placeholder { /* WebKit browsers */ color: $color; diff --git a/_sass/styles.scss b/_sass/site.scss similarity index 100% rename from _sass/styles.scss rename to _sass/site.scss diff --git a/_sass/theme-default.scss b/_sass/theme-default.scss index ffc1c46..3075b61 100644 --- a/_sass/theme-default.scss +++ b/_sass/theme-default.scss @@ -72,8 +72,6 @@ --shadow-pop: 0 14px 36px rgba(0, 0, 0, 0.18); --overlay-dark-25: rgba(0, 0, 0, 0.25); - --overlay-dark-35: rgba(0, 0, 0, 0.35); - --overlay-dark-50: rgba(0, 0, 0, 0.5); --overlay-light-65: rgba(255, 255, 255, 0.65); --search-item-hover-bg: var(--divider); @@ -131,21 +129,18 @@ } @media (prefers-color-scheme: dark) { - /* For the scrollbar track (background) */ ::-webkit-scrollbar { - background-color: #2e2e2e; /* Dark grey background */ + background-color: #2e2e2e; } - /* For the scrollbar handle */ ::-webkit-scrollbar-thumb { - background-color: #555; /* Darker grey scrollbar handle */ - border-radius: 6px; /* Rounded corners on the scrollbar handle */ - border: 3px solid #2e2e2e; /* Creates a small border with the same color as the track */ + background-color: #555; + border-radius: 6px; + border: 3px solid #2e2e2e; } - /* For the scrollbar handle on hover */ ::-webkit-scrollbar-thumb:hover { - background-color: #888; /* Lighter grey on hover */ + background-color: #888; } /* * Dark Colors @@ -153,50 +148,11 @@ */ body { - --color-primary: hsl(181, 49%, 50%); - --color-primary-light: hsl(181, 49%, 55%); - --color-primary-lightest: hsl(181, 49%, 70%); - --color-primary-dark: hsl(181, 49%, 45%); - --color-primary-darker: hsl(181, 49%, 40%); - --color-primary-darkest: hsl(181, 49%, 35%); - --color-green: hsl(129, 38%, 61%); - --color-green-lightest: hsl(129, 38%, 81%); - --color-green-dark: hsl(129, 38%, 56%); - --color-green-darker: hsl(129, 38%, 51%); - --color-green-darkest: hsl(129, 38%, 46%); - --color-red: hsl(7, 90%, 69%); - --color-red-lightest: hsl(7, 90%, 89%); - --color-red-dark: hsl(7, 90%, 64%); - --color-red-darker: hsl(7, 90%, 59%); - --color-red-darkest: hsl(7, 90%, 54%); - --color-blue: hsl(200, 82%, 64%); - --color-blue-lightest: hsl(200, 82%, 84%); - --color-blue-dark: hsl(200, 82%, 59%); - --color-blue-darker: hsl(200, 82%, 54%); - --color-blue-darkest: hsl(200, 82%, 49%); - --color-orange: hsl(28, 93%, 58%); - --color-orange-lightest: hsl(28, 93%, 78%); - --color-orange-dark: hsl(28, 93%, 53%); - --color-orange-darker: hsl(28, 93%, 48%); - --color-orange-darkest: hsl(28, 93%, 43%); - --color-pink: hsl(334, 78%, 62%); - --color-pink-lightest: hsl(334, 78%, 82%); - --color-pink-dark: hsl(334, 78%, 57%); - --color-pink-darker: hsl(334, 78%, 52%); - --color-pink-darkest: hsl(334, 78%, 47%); - --color-purple: hsl(283, 45%, 45%); - --color-purple-lightest: hsl(283, 45%, 65%); - --color-purple-dark: hsl(283, 45%, 40%); - --color-purple-darker: hsl(283, 45%, 35%); - --color-purple-darkest: hsl(283, 45%, 30%); - - --banner-color: hsl(216, 24%, 31%); --text-color: hsl(222, 28%, 95%); --text-color-dark: hsl(222, 26%, 89%); --text-color-secondary: hsl(220, 21%, 70%); --grey: hsl(215, 21%, 68%); --light-grey: hsl(216, 24%, 46%); - --black: #000; --smoky-white: #1e2023; --smoky-grey: #222428; --divider: #383a3e; @@ -225,8 +181,6 @@ --shadow-pop: 0 14px 36px rgba(0, 0, 0, 0.55); --overlay-dark-25: rgba(0, 0, 0, 0.35); - --overlay-dark-35: rgba(0, 0, 0, 0.45); - --overlay-dark-50: rgba(0, 0, 0, 0.62); --overlay-light-65: rgba(255, 255, 255, 0.12); --search-item-hover-bg: #2e333c; diff --git a/assets/css/styles.scss b/assets/css/styles.scss index a6152d1..c0d2445 100644 --- a/assets/css/styles.scss +++ b/assets/css/styles.scss @@ -3,9 +3,4 @@ @charset "utf-8"; -@use "theme-default"; -@use "base"; -@use "doc"; -@use "landing"; -@use "stdlibref"; -@use "docs-browser"; +@use "site"; diff --git a/tools/docgen/emit.ts b/tools/docgen/emit.ts index eaebd39..aa10435 100644 --- a/tools/docgen/emit.ts +++ b/tools/docgen/emit.ts @@ -1,7 +1,7 @@ import { dirname, join } from "@std/path"; import { stringify as yamlStringify } from "@std/yaml"; import type { Entity, PackageDoc } from "./types.ts"; -import { CATEGORIES, categoryLabel, categoryOrder } from "./categories.ts"; +import { categoryLabel, categoryOrder } from "./categories.ts"; import { hotdocToMarkdown, normalizeDashes } from "./hotdoc.ts"; export interface EmitContext { @@ -338,4 +338,3 @@ async function removeIfExists(path: string): Promise { if (!(err instanceof Deno.errors.NotFound)) throw err; } } -export { CATEGORIES }; diff --git a/tools/docgen/hotdoc.ts b/tools/docgen/hotdoc.ts index 07606f4..743fc2e 100644 --- a/tools/docgen/hotdoc.ts +++ b/tools/docgen/hotdoc.ts @@ -61,12 +61,3 @@ function isBlankInExample(lines: string[], i: number): boolean { function stripExamplePrefix(line: string): string { return line.replace(/^(\s*)[>|]\s?/, "$1"); } - -/** First sentence/line of a doc, plain text, for index cards. */ -export function summaryLine(doc: string): string { - for (const l of doc.split("\n")) { - const t = l.trim(); - if (t !== "" && !t.startsWith("```")) return t; - } - return ""; -}