Skip to content

Commit 7a6c8f9

Browse files
authored
Merge pull request #82 from unsignedapps/docc-migration
DocC Migration
2 parents c78c935 + ab3a832 commit 7a6c8f9

File tree

128 files changed

+715
-18029
lines changed

Some content is hidden

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

128 files changed

+715
-18029
lines changed

.github/scripts/generate-docs.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env bash
2+
3+
# This script requires Xcode 13.0+ to be installed and selected
4+
# as the DEVELOPER_DIR.
5+
6+
# It is expected you will run this script from the root of the package
7+
8+
SCHEME="Vexil-Package"
9+
DERIVED_DATA=".build/DerivedData"
10+
11+
PRODUCT_DIR="${DERIVED_DATA}/Build/Products/Debug"
12+
VEXIL_DOCCARCHIVE="${PRODUCT_DIR}/Vexil.doccarchive"
13+
VEXILLOGRAPHER_DOCCARCHIVE="${PRODUCT_DIR}/Vexillographer.doccarchive"
14+
15+
WEBSITE_DIR=".github/website"
16+
17+
WORKING="docs"
18+
19+
# Build our docs
20+
xcodebuild docbuild \
21+
-scheme "${SCHEME}" \
22+
-derivedDataPath "${DERIVED_DATA}"
23+
24+
# Make sure they exist
25+
if [ ! -d "${VEXIL_DOCCARCHIVE}" ]; then
26+
>&2 echo "Could not find Vexil.doccarchive inside ${PRODUCT_DIR}"
27+
exit 1
28+
fi
29+
30+
if [ ! -d "${VEXILLOGRAPHER_DOCCARCHIVE}" ]; then
31+
>&2 echo "Could not find Vexillographer.doccarchive inside ${PRODUCT_DIR}"
32+
exit 1
33+
fi
34+
35+
# Lets start assembling
36+
rm -rf "${WORKING}"
37+
mkdir -p "${WORKING}"
38+
39+
# We copy the entire archive from Vexil into our working dir
40+
cp -R "${VEXIL_DOCCARCHIVE}"/* "${WORKING}"
41+
42+
# But only the docs from Vexillographer
43+
cp -R "${VEXILLOGRAPHER_DOCCARCHIVE}"/data/documentation/* "${WORKING}/data/documentation/"
44+
cp -R "${VEXILLOGRAPHER_DOCCARCHIVE}"/images/* "${WORKING}/images/"
45+
46+
# Re-create the .json structure inside /documentation
47+
find "${WORKING}/data" -type f -name '*.json' \
48+
| sed 's%data/%%g' \
49+
| sed 's%\.json%%g' \
50+
| xargs -n 1 mkdir -p
51+
52+
# Copy the index.html file from the root into each of those folders
53+
find "${WORKING}/documentation" -type d \
54+
| xargs -n 1 cp "${WORKING}/index.html"
55+
56+
# Copy our website root files over the top too
57+
cp "${WEBSITE_DIR}/index.html" "${WORKING}"
58+
cp "${WEBSITE_DIR}/styles.css" "${WORKING}/css"
59+
cp "${WEBSITE_DIR}/vexil.svg" "${WORKING}/img"

.github/website/index.html

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<!doctype html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
8+
<link rel="stylesheet" href="css/styles.css">
9+
<meta name="description" content="">
10+
<meta name="author" content="">
11+
<title>Vexil</title>
12+
</head>
13+
14+
<body>
15+
<div class="wrapper">
16+
<div class="container">
17+
<div class="row">
18+
<div class="col d-none d-lg-block"></div>
19+
<div class="col logo">
20+
<img src="img/vexil.svg" style: "width: 400px; height: 400px;" />
21+
</div>
22+
<div class="col align-self-center content">
23+
<div>
24+
<h1>Vexil</h1>
25+
<p class="lead">Vexil (named for Vexillology) is a Swift package for managing feature flags (also called feature toggles) in a flexible, multi-provider way.</p>
26+
</div>
27+
<div class="content-body">
28+
<a class="btn btn-lg btn-primary" href="https://github.com/unsignedapps/Vexil">GitHub</a>&nbsp;
29+
<a class="btn btn-lg btn-outline-documentation" href="/documentation/vexil">Documentation</a>
30+
</div>
31+
</div>
32+
<div class="col d-none d-lg-block"></div>
33+
</div>
34+
</div>
35+
36+
<div class="modal fade" id="privacy" tabindex="-1" role="dialog" aria-labelledby="privacyLabel" aria-hidden="true">
37+
<div class="modal-dialog" role="document">
38+
<div class="modal-content">
39+
<div class="modal-header">
40+
<h5 class="modal-title">Privacy</h5>
41+
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
42+
<span aria-hidden="true">&times;</span>
43+
</button>
44+
</div>
45+
<div class="modal-body">
46+
<p>Your email address will be added to a Mailchimp mailing list and will be sent emails related to:</p>
47+
<ul>
48+
<li>the initial TestFlight beta release for iOS</li>
49+
<li>the initial TestFlight beta release for macOS</li>
50+
<li>and details related to our launch.</li>
51+
</ul>
52+
<p>You will receive less than five emails total.
53+
<p>
54+
<p>After launch the mailing list will be deleted and our record of your email address will be removed. If you choose to join the TestFlight beta then you would need to supply your details separately there.</p>
55+
<p>For more information on how Mailchimp will use your email address see their <a href="https://mailchimp.com/legal/privacy/#3._Privacy_for_Contacts" target="_blank">Privacy Policy.</a></p>
56+
</div>
57+
</div>
58+
</div>
59+
</div>
60+
61+
</body>
62+
63+
</html>

.github/website/styles.css

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
body {
2+
--color-background-dark: #000000;
3+
--color-background-light: #ffffff;
4+
--color-background: var(--color-background-light);
5+
--color-foreground-dark: #ffffff;
6+
--color-foreground-light: #000000;
7+
--color-foreground: var(--color-foreground-light);
8+
--color-btn-outline-dark: #f8f9fa;
9+
--color-btn-outline-light: #212529;
10+
--color-btn-outline: var(--color-btn-outline-light);
11+
--color-btn-outline-hover-dark: #212529;
12+
--color-btn-outline-hover-light: #fff;
13+
--color-btn-outline-hover: var(--color-btn-outline-hover-light);
14+
background-color: var(--color-background);
15+
color: var(--color-foreground);
16+
}
17+
18+
@media screen and (prefers-color-scheme:dark) {
19+
body {
20+
--color-background: var(--color-background-dark);
21+
--color-foreground: var(--color-foreground-dark);
22+
--color-btn-outline: var(--color-btn-outline-dark);
23+
--color-btn-outline-hover: var(--color-btn-outline-hover-dark);
24+
}
25+
}
26+
27+
.wrapper {
28+
min-height: 100%;
29+
/* Fallback for browsers do NOT support vh unit */
30+
min-height: 100vh;
31+
/* These two lines are counted as one :-) */
32+
display: flex;
33+
align-items: center;
34+
}
35+
36+
.btn-outline-documentation {
37+
color: var(--color-btn-outline);
38+
background-color: transparent;
39+
background-image: none;
40+
border-color: var(--color-btn-outline);
41+
}
42+
43+
.btn-outline-documentation:hover {
44+
color: var(--color-btn-outline-hover);
45+
background-color: var(--color-btn-outline);
46+
border-color: var(--color-btn-outline);
47+
}
48+
49+
@media (min-width: 992px) {
50+
.logo {
51+
padding-right: 40px;
52+
text-align: right;
53+
}
54+
.content-header,
55+
.content-body {
56+
width: 500px;
57+
}
58+
.privacy-link {
59+
margin-right: 100px;
60+
}
61+
.subscribe-group {
62+
left: 100px;
63+
width: 300px;
64+
}
65+
}
66+
67+
@media (max-width: 991.98px) {
68+
.logo {
69+
padding-top: 20px;
70+
padding-bottom: 20px;
71+
text-align: center;
72+
}
73+
.content {
74+
padding-top: 20px;
75+
text-align: center;
76+
padding-bottom: 20px;
77+
}
78+
}

.github/website/vexil.svg

Lines changed: 22 additions & 0 deletions
Loading

.github/workflows/docs.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "Docs Build"
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
paths:
7+
- '.github/workflows/docs.yml'
8+
- '.github/generate-docs.sh'
9+
- '**/*.swift'
10+
11+
env:
12+
DEVELOPER_DIR: /Applications/Xcode_13.0.app/Contents/Developer
13+
14+
jobs:
15+
BuildWebsite:
16+
name: "Build Docs"
17+
runs-on: macos-11.0
18+
steps:
19+
- name: 🛒 Checkout
20+
uses: actions/checkout@v2
21+
22+
- name: 👷 Build Website
23+
run: .github/scripts/generate-docs.sh

.github/workflows/website.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Generate Website"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- '.github/workflows/website.yml'
8+
- '**/*.swift'
9+
- '.github/scripts/generate-docs.sh'
10+
- '.github/website/*'
11+
12+
env:
13+
DEVELOPER_DIR: /Applications/Xcode_13.0.app/Contents/Developer
14+
15+
jobs:
16+
BuildWebsite:
17+
name: "Build Website"
18+
runs-on: macos-11.0
19+
steps:
20+
- name: 🛒 Checkout
21+
uses: actions/checkout@v2
22+
23+
- name: 👷 Build Website
24+
run: .github/scripts/generate-docs.sh
25+
26+
- name: 🚀 Deploy to GitHub Pages
27+
uses: JamesIves/[email protected]
28+
with:
29+
branch: gh-pages
30+
folder: docs
-14.6 KB
Binary file not shown.
-9.08 KB
Binary file not shown.
-26 KB
Binary file not shown.

0 commit comments

Comments
 (0)