Skip to content

Commit 8ce8ac1

Browse files
authored
Merge pull request #4 from flynnduism/bart-docs-toc
[option b] Import Spin docs and reorganize the menu
2 parents 0438748 + 614dd2b commit 8ce8ac1

File tree

432 files changed

+91737
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

432 files changed

+91737
-0
lines changed

.build/check-broken-links.sh

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
require() {
5+
if ! hash "$1" &>/dev/null; then
6+
echo "'$1' not found in PATH"
7+
exit 1
8+
fi
9+
}
10+
11+
cleanup() {
12+
if [[ "$?" == "124" ]]; then
13+
echo "timeout exceeded waiting for the developer portal to run"
14+
fi
15+
echo "stopping process for $$"
16+
cleanup_with_child $$ false
17+
}
18+
19+
cleanup_with_child() {
20+
local pid="$1"
21+
local and_self="${2:-false}"
22+
23+
echo "cleanup_with_child $pid"
24+
25+
if children="$(pgrep -P "$pid")"; then
26+
for child in $children; do
27+
echo "stopping child $child (parent: $pid)"
28+
cleanup_with_child "$child" true
29+
done
30+
fi
31+
32+
if [[ "$and_self" == true ]]; then
33+
echo "stopping self $pid"
34+
kill -9 "$pid" 2>/dev/null || true
35+
fi
36+
}
37+
38+
trap cleanup EXIT
39+
40+
## add broken-link-checker to PATH
41+
export PATH=$PATH:`pwd`/node_modules/broken-link-checker/bin
42+
43+
require spin
44+
require timeout
45+
require blc
46+
47+
echo "starting developer portal"
48+
49+
## allow unpublished content during broken link checker
50+
export PREVIEW_MODE=1
51+
52+
## start the developer portal in background
53+
npm run spin >/dev/null 2>&1 &
54+
55+
## wait for portal to be up and running
56+
export RESP_CODE="$(mktemp)"
57+
timeout 60s bash -c 'until curl -o /dev/null -s -w "%{http_code}\n" http://localhost:3000 > $RESP_CODE; do sleep 2; done'
58+
59+
echo "checking website health via http://localhost:3000"
60+
61+
[[ "$(< $RESP_CODE)" == "200" ]] && \
62+
(echo "Success: website returned a 200 response code") || \
63+
(echo "Failure: unexpected response code: $(< $RESP_CODE)" && exit 1)
64+
65+
echo "starting link checker"
66+
67+
## Run the broken link checker
68+
report="$(mktemp)"
69+
blc_error=false
70+
blc --recursive http://127.0.0.1:3000 \
71+
\
72+
`## Ignore searching Edit links` \
73+
--exclude 'https://github.com/fermyon/developer/blob/main/content/*' \
74+
\
75+
`## returns 403` \
76+
--exclude 'https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits' \
77+
--exclude 'https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account' \
78+
--exclude 'https://docs.github.com/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/remembering-your-github-username-or-email' \
79+
--exclude 'https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification' \
80+
--exclude 'https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template' \
81+
--exclude 'https://twitter.com/fermyontech' \
82+
--exclude 'https://twitter.com/fermyontech/status/1641537393818738710' \
83+
--exclude 'https://www.godaddy.com' \
84+
--exclude 'https://linux.die.net/man/1/which' \
85+
\
86+
`## false positives` \
87+
--exclude 'https://www.gnu.org/software/coreutils/' \
88+
--exclude 'https://events.hashicorp.com/hashitalksdeploy' \
89+
--exclude 'https://dotnet.microsoft.com/en-us/download/dotnet/8.0' \
90+
--exclude 'https://www.developerweek.com/' \
91+
--exclude 'https://marketplace.visualstudio.com/items?itemName=fermyon.spin-vscode&ssr=false#overview' \
92+
--exclude 'https://marketplace.visualstudio.com/items?itemName=fermyon.autobindle' \
93+
--exclude 'https://crates.io/' \
94+
--exclude 'https://crates.io/crates/bytes' \
95+
--exclude 'https://crates.io/crates/http' \
96+
--exclude 'https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one' \
97+
--exclude 'https://events.hashicorp.com/hashitalksdeploy' \
98+
--exclude 'https://www.instagram.com/fermyontech/' \
99+
--exclude 'https://www.linkedin.com/company/fermyon/' \
100+
--exclude 'https://support.google.com/webmasters/answer/7552505' \
101+
--exclude 'https://www.namecheap.com/support/knowledgebase/article.aspx/767/10/how-to-change-dns-for-a-domain/' \
102+
--exclude 'https://support.google.com/domains/answer/3290309?hl=en#' \
103+
--exclude 'https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blazor' \
104+
--exclude 'https://www.reddit.com/r/Clojure/comments/jkznto/web_assembly_clojure_current_state/' \
105+
--exclude 'https://www.reddit.com/r/Rlanguage/comments/b4izog/compile_r_to_webassembly_and_use_as_a_data/' \
106+
--exclude 'https://www.tutorialspoint.com/webassembly/webassembly_working_with_cplusplus.htm' \
107+
--exclude 'http://localhost:16686/' \
108+
--exclude 'http://localhost:5050/explore' \
109+
--exclude 'http://localhost:5050/explore' \
110+
--exclude 'https://stackshare.io/stackups/powershell-vs-webassembly' \
111+
--exclude 'https://blog.cloudflare.com/cloudflare-workers-now-support-cobol/' \
112+
--exclude 'https://support.google.com/webmasters/answer/9008080?hl=en' | tee "${report}" || blc_error=true
113+
114+
cat "${report}" | grep "├─BROKEN─" > broken_links || true
115+
116+
if [ -s broken_links ]; then
117+
echo "Some links are broken, retrying to check for transient errors"
118+
while read -r line; do
119+
url="$(echo $line | awk '{print $2}')"
120+
if curl --retry 5 --retry-all-errors --retry-delay 1 --output /dev/null --silent --head --fail "$url"; then
121+
echo "$url is not broken"
122+
else
123+
124+
echo "$line" >> final_broken
125+
fi
126+
done <broken_links
127+
if [ -f "final_broken" ]; then
128+
echo -e "The list of broken links are\n"
129+
cat -n final_broken
130+
exit 1
131+
else
132+
echo "All the errors were transient. The links are valid!"
133+
fi
134+
else
135+
if [ "${blc_error}" == "true" ]; then
136+
echo "Failure: error(s) encountered attempting to check website links" && exit 1
137+
fi
138+
echo "All the links are valid!"
139+
fi

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
node_modules/
2+
.parcel-cache/
3+
.vscode
4+
.DS_Store
5+
*.css.map
6+
broken_links
7+
final_broken
8+
.spin
9+
# The search index is generated at time of deploy
10+
static/data.json
11+
static/hub-index-data.json
12+
# The build version of spin up hub
13+
spin-up-hub/dist/
14+
# The documentation migration backup files
15+
migration_scripts/content_backup/
16+
# The python compiled files
17+
migration_scripts/__pycache__
18+
migration_scripts/*.py[cod]

.markdownlint-cli2.mjs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const options = {
2+
"config": {
3+
"default": false,
4+
"extends": null,
5+
// Headings can increment by only one step (h1 -> h2) and not (h1 -> h3)
6+
"heading-increment": true,
7+
// Multiple blank lines will throw an error
8+
"no-multiple-blanks": true,
9+
// Headings should be surrounded by new lines
10+
"blanks-around-headings": true,
11+
// Headings always start on new lines
12+
"heading-start-left": true,
13+
// Code blocks must have an empty line above and below them
14+
"blanks-around-fences": true,
15+
// There can not be empty spaces in links
16+
"no-space-in-links": true,
17+
// Links must always contain url or "#"
18+
"no-empty-links": true,
19+
// Images must contain alt texts
20+
"no-alt-text": true,
21+
// Enforce consistent style for code blocks
22+
"code-block-style": {
23+
"style": "fenced"
24+
},
25+
// Enforce consistent fence style for code blocks
26+
"code-fence-style": {
27+
"style": "backtick"
28+
},
29+
"titlecase-rule": true
30+
},
31+
"customRules": ["markdownlint-rule-titlecase"]
32+
}
33+
34+
export default options;

config/site.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
title = "Spin Docs"
2+
# base_url = "https://spinframework.com"
3+
base_url = ""
4+
about = "Spin is an open-source multi-language framework and CLI for building and deploying WebAssembly apps."
5+
index_site_pages = ["sitemap", "home", "changelog", "hub_list_api"]
6+
prepend_route_info = true
7+
8+
[extra]
9+
copyright = "Spin Project"
10+
github = "https://github.com/spinframework/spin-docs"
11+
twitter = "https://twitter.com/spinframework"
12+
13+
# Static assets that we need to provide
14+
favicon = "/static/image/icon/favicon.png"
15+
twitter_card_type = "summary"
16+
twitter_card = "/static/image/twitter_card_summary.png"

content/index.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
title = "Introducing Spin"
2+
template = "main"
3+
date = "2023-11-04T00:00:01Z"
4+
enable_shortcodes = true
5+
[extra]
6+
url = "https://github.com/spinframework/spin-docs/blob/main/content/spin/v3/index.md"
7+
8+
---
9+
10+
Spin is a framework for building and running event-driven microservice applications with WebAssembly (Wasm) components.
11+
12+
Spin uses Wasm because it is **sandboxed, portable, and fast**. Millisecond cold start times mean no need to keep applications "warm".
13+
14+
Many languages have Wasm implementations, so **developers don't have to learn new languages or libraries**.
15+
16+
Spin is **open source** and **built on standards**, meaning you can take your Spin applications anywhere. There are Spin implementations for local development, for self-hosted servers, for Kubernetes, and for cloud-hosted services.
17+
18+
**Want to see the kinds of things people are building with Spin?** Check out what's [Built With Spin](./see-what-people-have-built-with-spin)!
19+
20+
Or dive into the documentation and get started:
21+
22+
- [Quick Start: ](quickstart)
23+
- [Learn how to write Spin applications](writing-apps)

0 commit comments

Comments
 (0)