From 5b4d4b3400acdace76f5970849fcb7f9cefd2c4d Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 30 Jul 2023 04:15:05 +0200 Subject: Genesis commit Not ready for release yet, but I need some commits for M4 to work properly. --- .gitignore | 1 + Makefile | 33 +++++++++ include/footer.html | 4 ++ include/head.html | 5 ++ include/nav.html | 4 ++ src/index.html | 62 +++++++++++++++++ src/srp/fw-ec/index.html | 98 +++++++++++++++++++++++++++ src/srp/fw-ec/led.diff.html | 32 +++++++++ src/srp/index.html | 49 ++++++++++++++ src/style.css | 162 ++++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 450 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 include/footer.html create mode 100644 include/head.html create mode 100644 include/nav.html create mode 100644 src/index.html create mode 100644 src/srp/fw-ec/index.html create mode 100644 src/srp/fw-ec/led.diff.html create mode 100644 src/srp/index.html create mode 100644 src/style.css diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..89f9ac0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +out/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..da2a9b6 --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +.PHONY: check clean serve + +srcdirs := ${shell find src -type d} +outdirs := ${srcdirs:src%=out%} +sources := ${shell find src -type f -name 'index.html' -or -name '*.css' -or -name '*.svg'} +outputs := ${sources:src/%=out/%} + +all: ${outdirs} ${outputs} + +${outdirs}: + @mkdir -p $@ + @printf 'MKDIR\t%s\n' "$@" + +out/%: src/% + @cp $< $@ + @printf 'CP\t%s\n' "$@" + +out/%.html: src/%.html include/head.html + @m4 -P ${foreach dir,${^D},-I${dir}} $< >$@ + @printf 'M4\t%s\n' "$@" + +src/srp/fw-ec/index.html: src/srp/fw-ec/led.diff.html + @touch $@ + +check: + LANG=en_US find src -name 'index.html' -exec \ + aspell --home-dir=./ --ignore-case check {} \; + +clean: + rm -rf out + +serve: + darkhttpd out --daemon diff --git a/include/footer.html b/include/footer.html new file mode 100644 index 0000000..c1c20e2 --- /dev/null +++ b/include/footer.html @@ -0,0 +1,4 @@ + + Page last edited: + m4_esyscmd(git log -1 --pretty='format:%cI' Makefile | xargs date +'%A %d %B %Y — %T %Z' -d) + diff --git a/include/head.html b/include/head.html new file mode 100644 index 0000000..97aa283 --- /dev/null +++ b/include/head.html @@ -0,0 +1,5 @@ + + + + +The Mango Tree diff --git a/include/nav.html b/include/nav.html new file mode 100644 index 0000000..9f8f2c2 --- /dev/null +++ b/include/nav.html @@ -0,0 +1,4 @@ + +
  • Home
  • +
  • Back
  • +
    diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..cbbbf20 --- /dev/null +++ b/src/index.html @@ -0,0 +1,62 @@ + + + + m4_include(head.html) + + +
    +

    Root Page

    + +
    +
    +

    If Java had true garbage collection, most programs would + delete themselves upon execution.

    +
    +
    + Robert Sewell +
    +
    +
    + +
    +

    + Welcome to my plot of the internet. This site is mostly oriented + towards topics related to software development, but you might + eventually find some things that are completely unrelated as + well. The “source code” for the site (if you can call + HTML1 and a basic build + system source code) + + are available through git + . +

    + + + +

    + Now go branch off to a subsection of the site: +

    + + +
    + +
    + + + + diff --git a/src/srp/fw-ec/index.html b/src/srp/fw-ec/index.html new file mode 100644 index 0000000..c04da7f --- /dev/null +++ b/src/srp/fw-ec/index.html @@ -0,0 +1,98 @@ + + + + m4_include(head.html) + + +
    +
    +

    Framework is Awesome

    + m4_include(nav.html) +
    + +
    +
    +

    UNIX was not designed to stop its users from doing stupid + things, as that would also stop them from doing clever + things.

    +
    +
    + Doug Gywn +
    +
    +
    + +
    +

    Framework and the EC

    + +

    + + Framework + + — for those unaware — is the coolest laptop manufacturer ever. + Their whole shtick is producing laptops that give the + user the ability to easily and effortlessly disassemble, repair, + and modify their hardware. I highly suggest checking them out if + you’re interested in computer hardware at all. The laptops even + have hotswappable I/O! +

    + +

    + Anyways getting back on topic, Framework has also been giving + power to the user on the software-side of things too! A good + while ago they open-sourced the + + code for the embedded controller + + of their laptops, which offers all sorts of possibilities for + customization of the keyboard, + LED + lights, and more. +

    + +

    LED Fun!

    + +

    + This is an area of the + EC + which I have not really looked at or touched much. I do want to + play around with this a lot more in the coming future though! So + far just for shits-and-giggles, I’ve patched the + EC + to make the power-button + LED + green instead of the normal boring white: +

    + + + +
    +
    + ~/board/hx20/led.c +
    +
    m4_include(led.diff.html)
    +
    + +

    + As you can see, it’s all fairly simple. I just had to change our + EC_LED_COLOR_WHITE for + EC_LED_COLOR_GREEN. The codebase defines a few + colors, but they’re defined as RGB + tuples which is awesome, because it opens the door to + custom RGB effects in the future! +

    +
    + +
    + + + + diff --git a/src/srp/fw-ec/led.diff.html b/src/srp/fw-ec/led.diff.html new file mode 100644 index 0000000..43f4e4f --- /dev/null +++ b/src/srp/fw-ec/led.diff.html @@ -0,0 +1,32 @@ +diff --git a/board/hx20/led.c b/board/hx20/led.c +index a4dc4564e..dacf73fda 100644 +--- a/board/hx20/led.c ++++ b/board/hx20/led.c +@@ -283,22 +283,22 @@ static void led_set_power(void) + /* don't light up when at lid close */ + if (!lid_is_open()) { + set_pwr_led_color(PWM_LED2, -1); +- enable_pwr_breath(PWM_LED2, EC_LED_COLOR_WHITE, breath_led_length, 0); ++ enable_pwr_breath(PWM_LED2, EC_LED_COLOR_GREEN, breath_led_length, 0); + return; + } + + if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND)) +- enable_pwr_breath(PWM_LED2, EC_LED_COLOR_WHITE, breath_led_length, 1); ++ enable_pwr_breath(PWM_LED2, EC_LED_COLOR_GREEN, breath_led_length, 1); + else +- enable_pwr_breath(PWM_LED2, EC_LED_COLOR_WHITE, breath_led_length, 0); ++ enable_pwr_breath(PWM_LED2, EC_LED_COLOR_GREEN, breath_led_length, 0); + + if (chipset_in_state(CHIPSET_STATE_ON) | power_button_enable) { + if (charge_prevent_power_on(0)) + set_pwr_led_color(PWM_LED2, (power_tick % + LED_TICKS_PER_CYCLE < LED_ON_TICKS) ? +- EC_LED_COLOR_WHITE : -1); ++ EC_LED_COLOR_GREEN : -1); + else +- set_pwr_led_color(PWM_LED2, EC_LED_COLOR_WHITE); ++ set_pwr_led_color(PWM_LED2, EC_LED_COLOR_GREEN); + } else + set_pwr_led_color(PWM_LED2, -1); + } diff --git a/src/srp/index.html b/src/srp/index.html new file mode 100644 index 0000000..aaf72b1 --- /dev/null +++ b/src/srp/index.html @@ -0,0 +1,49 @@ + + + + m4_include(head.html) + + +
    +
    +

    Software-Related Posts

    + m4_include(nav.html) +
    + +
    +
    +

    Object-oriented programming is an exceptionally bad idea + which could only have originated in California.

    +
    +
    + Edsgar W. Dijkstra +
    +
    +
    + +
    +

    + In this section of the website I cover random software-related + stuff that isn’t related to actual projects of mine. Posts here + could be about anything from a cool program I found, to a patch I + wrote, to me complaining about bad software design. +

    + +

    + Posts: +

    + + +
    + +
    + + + + diff --git a/src/style.css b/src/style.css new file mode 100644 index 0000000..2b67620 --- /dev/null +++ b/src/style.css @@ -0,0 +1,162 @@ +:root { + --serif: Vollkorn; + --mono: 'Iosevka Custom'; + --bg: #1D1F21; + --fg: #C5C8C6; + --bg-accent: #222427; + --accent: #DE935F; + --lesser: #969896; + --green: #B5BD68; + --red: #C66; +} + +*, *::before, *::after { box-sizing: border-box; } + +body { + font-family: var(--serif); + font-size: 1.2rem; + font-variant-numeric: lining-nums; + line-height: 1.5; + text-align: justify; + color: var(--fg); + background-color: var(--bg); + display: grid; + grid-template-columns: 1fr min(800px, 90%) 1fr; +} +body > * { grid-column: 2; } + +pre, code, kbd, samp { + font-family: var(--mono); + font-size: 1rem; + color: var(--accent); +} +pre > code { color: var(--fg); } + +h1 { + font-size: 3rem; + margin-bottom: 0; +} +h2 { font-size: 2.5rem; } + +h1, h2, p { overflow-wrap: break-word; } + +a { color: var(--accent); } +a:hover { text-decoration: none; } + +blockquote > p:first-child::before { content: '“'; } +blockquote > p:last-child::after { content: '”'; } +blockquote + figcaption::before { content: '— '; } + +blockquote, blockquote + figcaption { font-style: italic; } + +.quote { + border-left: 4px solid var(--accent); + padding: .4rem .8rem; + margin-inline: 2rem 0; + margin-block: 2rem; +} + +.quote blockquote { margin-inline-start: 1rem; } +.quote blockquote, .quote blockquote p { margin-block: .5rem; } + +.quote figcaption { + margin-inline-start: 2rem; + margin-block: .5rem; +} + +figure:not(.quote) figcaption { + text-align: center; + text-decoration: underline; +} + +hr { width: 100%; } +main { margin-block-end: 5rem; } + +footer { + margin-block: 2rem; + text-align: center; + font-style: italic; + color: var(--lesser); +} + +aside { + font-style: italic; + color: var(--lesser); + position: relative; + margin-block: 1.5rem; +} + +aside > p::before, +x-ref { + vertical-align: super; + font-size: .8rem; +} + +aside > p::before { + content: attr(data-ref); + position: absolute; + left: -1.5ch; +} + +abbr { + cursor: help; + position: relative; + text-decoration-line: underline; + text-decoration-style: dotted; +} + +abbr:hover::before { + opacity: 1; + pointer-events: inherit; +} + +abbr::before { + opacity: 0; + position: absolute; + bottom: 100%; + transition: .15s ease opacity; + white-space: nowrap; + padding: .15em .25em; + border: 1px solid var(--fg); + border-radius: 2px; + background: var(--bg-accent); + pointer-events: none; +} + +abbr.ec::before { content: 'Embedded Controller'; } +abbr.html::before { content: 'Hypertext Markup Language'; } +abbr.led::before { content: 'Light-Emitting Diode'; } +abbr.rgb::before { content: 'Red Green Blue'; } + +.diff-ins { color: var(--green); } +.diff-del { color: var(--red); } +.diff-loc { color: var(--lesser); } +.diff-meta { font-weight: bold; } + +figure > pre { margin-left: 4ch; overflow-x: scroll; } +figure > pre > code { counter-increment: line; } +figure > pre > code::before { + position: absolute; + content: counter(line); + padding-right: .5ch; + margin-left: -4ch; + width: 3ch; + text-align: right; + display: inline-block; + border-right: 1px solid var(--lesser); + color: var(--lesser); + z-index: 1; + background-color: var(--bg); +} + +header > div { + display: flex; + justify-content: space-between; + align-items: center; +} + +header > div menu { + display: flex; + gap: 2ch; +} +header > div li { list-style: none; } -- cgit v1.2.3