Browse Source

Publish initial version

Build by running ./build.sh TITLE PREFIX
TITLE is what will be appended to the <title> after the <h1> in
markdown. I use "TT".
PREFIX is the prefix under which the site will be held, for example
'https://trivial.technology'.
master
Chloe Kudryavtsev 8 months ago
commit
b6af92ab5e
12 changed files with 1920 additions and 0 deletions
  1. +1
    -0
      .gitignore
  2. +24
    -0
      UNLICENSE
  3. +1450
    -0
      bin/Markdown.pl
  4. +276
    -0
      bin/ssg5
  5. +10
    -0
      build.sh
  6. +5
    -0
      src/_footer.html
  7. +15
    -0
      src/_header.html
  8. +51
    -0
      src/guidelines.md
  9. +11
    -0
      src/index.md
  10. +9
    -0
      src/landing.md
  11. +31
    -0
      src/manifesto.md
  12. +37
    -0
      src/style.css

+ 1
- 0
.gitignore View File

@@ -0,0 +1 @@
/dst

+ 24
- 0
UNLICENSE View File

@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

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 NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS 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 IN THE SOFTWARE.

For more information, please refer to <https://unlicense.org>

+ 1450
- 0
bin/Markdown.pl
File diff suppressed because it is too large
View File


+ 276
- 0
bin/ssg5 View File

@@ -0,0 +1,276 @@
#!/bin/sh -e
#
# https://rgz.ee/bin/ssg5
# Copyright 2018-2019 Roman Zolotarev <hi@romanzolotarev.com>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

main() {
test -n "$1" || usage
test -n "$2" || usage
test -n "$3" || usage
test -n "$4" || usage
test -d "$1" || no_dir "$1"
test -d "$2" || no_dir "$2"

src=$(readlink_f "$1")
dst=$(readlink_f "$2")

IGNORE=$(
if ! test -f "$src/.ssgignore"
then
printf ' ! -path "*/.*"'
return
fi
while read -r x
do
test -n "$x" || continue
printf ' ! -path "*/%s*"' "$x"
done < "$src/.ssgignore"
)

# files

title="$3"

h_file="$src/_header.html"
f_file="$src/_footer.html"
test -f "$f_file" && FOOTER=$(cat "$f_file") && export FOOTER
test -f "$h_file" && HEADER=$(cat "$h_file") && export HEADER

list_dirs "$src" |
(cd "$src" && cpiopdu "$dst")

fs=$(
if test -f "$dst/.files"
then list_affected_files "$src" "$dst/.files"
else list_files "$1"
fi
)

if test -n "$fs"
then
echo "$fs" | tee "$dst/.files"

if echo "$fs" | grep -q '\.md$'
then
if test -x "$(which lowdown 2> /dev/null)"
then
echo "$fs" | grep '\.md$' |
render_md_files_lowdown "$src" "$dst" "$title"
else
if test -x "$(which Markdown.pl 2> /dev/null)"
then
echo "$fs" | grep '\.md$' |
render_md_files_Markdown_pl "$src" "$dst" "$title"
else
echo "couldn't find lowdown nor Markdown.pl"
exit 3
fi
fi
fi

echo "$fs" | grep '\.html$' |
render_html_files "$src" "$dst" "$title"

echo "$fs" | grep -Ev '\.md$|\.html$' |
(cd "$src" && cpiopdu "$dst")
fi

printf '[ssg] ' >&2
print_status 'file, ' 'files, ' "$fs" >&2


# sitemap

base_url="$4"
date=$(date +%Y-%m-%d)
urls=$(list_pages "$src")

test -n "$urls" &&
render_sitemap "$urls" "$base_url" "$date" > "$dst/sitemap.xml"

print_status 'url' 'urls' "$urls" >&2
echo >&2
}


readlink_f() {
file="$1"
cd "$(dirname "$file")"
file=$(basename "$file")
while test -L "$file"
do
file=$(readlink "$file")
cd "$(dirname "$file")"
file=$(basename "$file")
done
dir=$(pwd -P)
echo "$dir/$file"
}


print_status() {
test -z "$3" && printf 'no %s' "$2" && return

echo "$3" | awk -v singular="$1" -v plural="$2" '
END {
if (NR==1) printf NR " " singular
if (NR>1) printf NR " " plural
}'
}


usage() {
echo "usage: ${0##*/} src dst title base_url" >&2
exit 1
}


no_dir() {
echo "${0##*/}: $1: No such directory" >&2
exit 2
}

list_dirs() {
cd "$1" && eval "find . -type d ! -name '.' ! -path '*/_*' $IGNORE"
}


list_files() {
cd "$1" && eval "find . -type f ! -name '.' ! -path '*/_*' $IGNORE"
}


list_dependant_files () {
e="\\( -name '*.html' -o -name '*.md' -o -name '*.css' -o -name '*.js' \\)"
cd "$1" && eval "find . -type f ! -name '.' ! -path '*/_*' $IGNORE $e"
}

list_newer_files() {
cd "$1" && eval "find . -type f ! -name '.' $IGNORE -newer $2"
}


has_partials() {
grep -qE '^./_.*\.html$|^./_.*\.js$|^./_.*\.css$'
}


list_affected_files() {
fs=$(list_newer_files "$1" "$2")

if echo "$fs" | has_partials
then list_dependant_files "$1"
else echo "$fs"
fi
}


render_html_files() {
while read -r f
do render_html_file "$3" < "$1/$f" > "$2/$f"
done
}


render_md_files_lowdown() {
while read -r f
do
lowdown \
-D html-skiphtml \
-d metadata \
-d autolink < "$1/$f" |
render_html_file "$3" \
> "$2/${f%\.md}.html"
done
}


render_md_files_Markdown_pl() {
while read -r f
do
Markdown.pl < "$1/$f" |
render_html_file "$3" \
> "$2/${f%\.md}.html"
done
}


render_html_file() {
# h/t Devin Teske
awk -v title="$1" '
{ body = body "\n" $0 }
END {
body = substr(body, 2)
if (body ~ /<[Hh][Tt][Mm][Ll]/) {
print body
exit
}
if (match(body, /<[[:space:]]*[Hh]1(>|[[:space:]][^>]*>)/)) {
t = substr(body, RSTART + RLENGTH)
sub("<[[:space:]]*/[[:space:]]*[Hh]1.*", "", t)
gsub(/^[[:space:]]*|[[:space:]]$/, "", t)
if (t) title = t " &mdash; " title
}
n = split(ENVIRON["HEADER"], header, /\n/)
for (i = 1; i <= n; i++) {
if (match(tolower(header[i]), "<title></title>")) {
head = substr(header[i], 1, RSTART - 1)
tail = substr(header[i], RSTART + RLENGTH)
print head "<title>" title "</title>" tail
} else print header[i]
}
print body
print ENVIRON["FOOTER"]
}'
}


list_pages() {
e="\\( -name '*.html' -o -name '*.md' \\)"
cd "$1" && eval "find . -type f ! -path '*/.*' ! -path '*/_*' $IGNORE $e" |
sed 's#^./##;s#.md$#.html#;s#/index.html$#/#'
}


render_sitemap() {
urls="$1"
base_url="$2"
date="$3"

echo '<?xml version="1.0" encoding="UTF-8"?>'
echo '<urlset'
echo 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
echo 'xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9'
echo 'http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"'
echo 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'
echo "$urls" |
sed -E 's#^(.*)$#<url><loc>'"$base_url"'/\1</loc><lastmod>'\
"$date"'</lastmod><priority>1.0</priority></url>#'
echo '</urlset>'
}

cpiopdu() {
dst="$1"
while IFS='$\n' read -r f; do
b="$(basename $f)"
d="$(dirname $f)"
mkdir -p "$1/$d"
[ -d "$f" ] && mkdir -p "$1/$f"
[ -f "$f" ] && cp "$f" "$1/$d/$b"
done
}

main "$@"

+ 10
- 0
build.sh View File

@@ -0,0 +1,10 @@
#!/bin/sh
d="$(dirname $0)"
case "$d" in
/*) ;;
*) d="$PWD/$d"
esac
export PATH="$PATH:$d/bin"

mkdir -p dst
ssg5 src dst "$@"

+ 5
- 0
src/_footer.html View File

@@ -0,0 +1,5 @@
<footer><p>
Maintained at <a href='https://github.com/TrivialTechnologies/TT'>github.com/TrivialTechnologies/TT</a> by <a href='mailto:toast+misc@toast.cafe'>toast@toast.cafe.</a>
</p></footer>
</body>
</html>

+ 15
- 0
src/_header.html View File

@@ -0,0 +1,15 @@
<!doctype html>
<html><head>
<title></title>
<meta charset="UTF-8">
<meta name="generator" content="romanzolotarev.com/ssg">
<meta name="stylesheet" content="perfectmotherfuckingwebsite.com">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
</head><body>
<nav>
<a href="index.html">Index</a>
<a href="manifesto.html">Manifesto</a>
<a href="landing.html">Landing</a>
<a href="guidelines.html">Guidelines</a>
</nav>

+ 51
- 0
src/guidelines.md View File

@@ -0,0 +1,51 @@
# Trivial Technologies: Guidelines

Let us say you are convinced, and you want some further instructions on how to help. This is that document. The first two sections are shorter and speak on how to help without developing brand new TT software. The third primary section will contain guidelines on how to maximally simplify software, in the attempt to be a TT.

## Use TT, Tell Your Friends

Empowering the people has no effect if the people do not use this ability. The truth is that *you* **are** capable of these things. If you are unhappy with the state of things in a given field, try a TT program. If you are still unhappy with it, it will be the easiest option for you to modify to your liking, so try doing that! If you see that your friends are unhappy, tell them about TT as an option. If you know developers, tell them about TT too. If you know people with similar goals to ours, tell them about TT so that they may host their own variation.

## Host Mirrors

TT is itself Trivial. It is not meant to be centralized. This hosted instance, whether it's the original one or not, is too, just a mirror. Your mirror may also contain changes, such that it will fit your needs and your community better. The whole thing is available under the Unlicense, so you needn't worry about anything you do with the idea. Here is the recommended procedure to make a mirror:

1. Copy the sources (whether using git or as plain files).

2. Modify the `_footer.html` file to have *your* contact data, as the maintainer.

3. Clean out the `external` page, if it exists and contains entries.

4. Make any further modifications you wish and deploy it.

In the `external` page, two things may optionally go if you so wish it. You may have a list of other known mirrors on there, in which case you may wish to stay in contact with the maintainers of them. Secondly, you may have a list of certified TT software.

The certification process is simple: find a lay person that has never seen that software, and ask them to spend a weekend (the source of the "2 days" requirement) trying to understand the software in its entirety - including the *API* of the dependencies, the entirety of the license, and the meta knowledge (how to build/deploy it). If you cannot find such a person, you may use a technologist instead, but then the time allowed is restricted to 1/8th (i.e 6 hours). This is a much harsher requirement. Finally, you cannot certify your own projects.,

People looking at the list of certified projects are encouraged to verify the certifications themselves, perhaps to add them to their own list. Scenarios of someone simply certifying whatever they wish, or their own projects, should become blatantly clear, in which case the mirror in question is to be ignored when it comes to that, for they are clearly acting in bad faith.

## Make TT Software

The first step is simple - you must desire for your project to be Trivial. If you have such a desire, insert a phrase into your README, proclaiming to the word that your project strives to achieve the standards of the TT movement, and link to a mirror of your choosing (you should link to the landing page). The rest matters little, if you manage to achieve those standards. The rest of this are but recommendations.

1. Your commits should be minimally small, and explain why the changes in question were made.

2. You should comment in locations whenever state is significantly changed.

3. Globals, if you have any, should be read-only to the modules in which they are defined. They should only be changed by library-style consumers, or in main. If that is the case, track that in a comment near them.

4. Keep functions and types logical and limited. In no case should you have a function that does a great many things.

5. Minimize the amount of arguments. If there are 10 arguments to a function, consider why they are there, and whether they can be grouped together under a reusable type.

6. Minimize nesting and other flow features. You should have few levels of indentation. If you need customizable behaviors, consider map/reduce, or a visitor pattern. Higher Order Functions are good as long as their use is clear.

7. Keep a NEWS file. It should be consistent, and only speak of user-visible changes.

8. Keep a READING file. It should explain how to read the sources, in what order, and gently guide the reader to understanding your program.

9. Minimize both the restrictions of your LICENSE file, as well as the length, for understanding it in its entirety is part of understanding your project. We recommend the Unlicense and 0BSD.

10. Minimize the amount of "meta-work" required. A project that uses CMake requires the reader to understand CMake. This needless context-switching greatly increases the difficulty of understanding projects, especially when the meta-work grows to thousands of lines. Prefer either very small amounts thereof (basic makefile, simple script) or languages that do not have meta-work associated with them (such as Go, where the entirety of the meta work is build-flags, the use of which should be minimal).

11. Only add the features you personally use. Instead of adding all the features, simply leave open points into which one may add features themselves. If you do not use a feature, you do not know how one might want to use it, so instead empower them to add it themselves, for their own fork.

+ 11
- 0
src/index.md View File

@@ -0,0 +1,11 @@
# Trivial Technologies

Trivial Technology (TT) is a new way of doing FOSS, whose goal is to maximally empower the individual, by providing a stepping stone for whatever they may wish to build.

TT is Trivial. A beginner should be able to completely understand it in 2 days. A professional should grasp it in a rainy afternoon. It is not meant to be a plug-and-play black box that one does not open lest they contact some ancient curse.

TT is malleable. There are visible hooks for adding features and open points where one can extend functionality. It is not a feature pinata where one has to dance around implementation details.

TT is open. As much as possible, TT is offered with no strings attached and we mean it. It's licenced under the most permissive licences we can find (0BSD, Unlicence, CC0) and even that we see as a compromise. Nobody will frown at you for forking TT, there's nobody to ask for permission, there's no original author that has to be forever mentioned.

TT is your own. To find out more about how this came to be and what are the larger principles behind this movement, be sure to read our manifesto.

+ 9
- 0
src/landing.md View File

@@ -0,0 +1,9 @@
# Trivial Technologies: Landing

You have likely arrived here by clicking on a link found in a project's README. That link being there means that the project strives to be what we call a "Trivial Technology". Here is what that means.

Copyright law was created to ensure access and promote the propagation of the useful arts. However, nowadays, it does quite the opposite. A select few control every piece of technology that you use, and you must ask, as beggars, for things essential to you or your community to be added, fixed, or not removed. Because of copyright, you may not do the modifications yourself. When you may, it is likely cost-prohibitive to do so. Further, due to the centralization of the controlling parties, the risks become great: the select few hold your information, control how you may use their product, and even if they are to be sane now, they could be bought out at any moment, for all of that to change.

A Trivial Technology, instead, seeks to be the opposite. Trivial Technologies reject copyright, even as a vehicle for self-perpetuation. Trivial Technologies seek to not have any central owners, modifications, remixes are encouraged, and the original writer need not even know about your use. Trivial Technologies seek to be simple, so simple even someone not in the industry could, within a short time (2 days) understand the entirety of the technology, and thus gain the ability to change it according to their own designs.

In short, the project that linked you here is not its own. It belongs to all. It belongs to you. You should be able to understand it easily, and you should feel free to do whatever you wish with it, approved by the authors or not. It is knowledge, in its purest, emancipated form.

+ 31
- 0
src/manifesto.md View File

@@ -0,0 +1,31 @@
# Trivial Technologies: Manifesto

A specter is haunting software—the specter of Emancipation. All of the world's Powers have entered into a holy alliance to exorcise this specter: Journal and Standards Body, Government and Judge, Media and IT Company. Those who would would seek to profit from those that may need knowledge they possess, whether it be monetarily or through increased influence. Those who would profit from entire fields of endeavor remaining accessible only to the elites, barred behind red tape, jargon and time barriers.

The open scientific endeavors are ridiculed. Those teaching others to make their own medication in the face of pharmaceutical abuse, when not ignored, are hunted as dangerous criminals. The open source movement only became acceptable when that fundamentally centralizing force became the very corporations it seeks to stop.

These tools: copyright, patent, trademark laws, all serve the same purpose—to centralize knowledge, keep it in the hands and control of the original creator. We, instead, seek the opposite. We seek the emancipation of knowledge, whenever possible. This movement, while pertaining to software, is fundamentally but a component of that grander philosophy.

To allow for the knowledge of software, and the ability to modify it, to spread, we reduce as many barriers as possible. Access to modification and use of any kind is granted by way of public domain (or a license free of obligations, when that is not possible). The software itself shall be accessible, ideally understandable by a layman within 2 days. Measures should be taken towards keeping it that way proactively, and easing any potential rough patches one may run into.

We call such understandable and emancipated software "Trivial Software", or perhaps a "Trivial Technology". Like the wheel, no one may lay claim to it. Like the lever, any can understand how to use, aggregate and modify it to make something else. Any may profit from the creation, but that profit shall never be allowed to get in the way of the knowledge itself.

## What is to Be Done

1. The Idea must be spread. All that you can see here is available freely, to use, modify, and distribute. Host copies, host mirrors, host modifications, tell your friends. If you desire to make significant modifications, or change the manifesto, do consider calling yourself something else, lest you be confused for us.

2. There must be projects that strive to be Trivial. It is not always attainable, but the intent and the effort put into sane design will still improve the state of things. Put links in your READMEs declaring your intentions, and linking to a mirror of your choosing. Not all software need be Trivial, but for any activity, there should be an alternative that is, so that one dissatisfied with the state of things may jump off of it to serve themselves.

3. The people must be informed. It is overwhelmingly common for one to believe that they cannot do things, whether it be in software or other fields of endeavor. That they are too dumb, too uneducated, too incapable to even attempt them. Show them otherwise. Encourage them otherwise. Allow the masses to rise beyond what they thought themselves capable of.

## Open Source is Broken

One may ask why one wouldn't simply follow an existing philosophy, such as that of GNU or the OSI. This is because Open Source is fundamentally broken.

Open Source has always focused on licensing. Using copyright as a tool to get its way. What good does that do, on its own? Imagine a codebase, truly humongous, with a workaround every 5 lines for a mistake in an entirely different section of the sources. Pretend that the product made from this codebase is widely used. Were it to be released under the GPL, how many would be able to mold it to better fit their needs? A license, on its own, means nothing. Further, these movements are inherently incompatible with the goals of TT.

When it comes to GNU, their promises and goals quickly fall apart. Their sources quickly get progressively more complex, bogged down by the requirements they put upon themselves. It uses copyright as a vessel for their restrictions, effectively reinforcing the system that it seeks to subvert. It speaks of sharing programs as the fundamental act of friendship, and yet GPL forks result only in never-ending feuds. GNU is fundamentally a force for centralization, and centralized systems are far easier for the Powers that be to corrupt than any others.

As for OSI, it refuses to hold to its definition. When the FSF asked, they certified the AGPL, a license that breaks at the very least point 6 of the OSD. It was rushed through because of the attached prestige, only later to be regretted. When an extremely similar license came along (the SSPL, by MongoDB Inc.), they rejected it, for the prestige was gone. Some members pointed out that the position is inconsistent. The OSI avoids the public domain like the plague, failing to certify CC0 and the Unlicense, despite neither violating any component of the OSD. They claim that this is because reviewing a public domain dedication requires reviewing the laws of each country, in the same breath as they mention a fallback license that is compliant. That mention goes nowhere.

Other similar movements (such as the various neo-licenses) are simply knock-offs of the GPL, plagued with the same problems, if not moreso.

+ 37
- 0
src/style.css View File

@@ -0,0 +1,37 @@
/* perfect motherfucking website */
body {
max-width:650px;
margin:40px auto;
padding:0 10px;
font:18px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
color:#444
}
h1, h2, h3 {
line-height:1.2
}
@media (prefers-color-scheme: dark) {
body {
color:white;
background:#444
}
a:link {
color:#5bf
}
a:visited {
color:#ccf
}
}

/* additions */
nav {
border-bottom: solid 1px grey;
text-align: center;
}
footer {
border-top: solid 1px grey;
text-align: center;
}
nav a {
padding-right: 10px;
}


Loading…
Cancel
Save