Skip to content

Commit

Permalink
Merge pull request #82 from unsignedapps/docc-migration
Browse files Browse the repository at this point in the history
DocC Migration
  • Loading branch information
bok- authored Jun 14, 2021
2 parents c78c935 + ab3a832 commit 7a6c8f9
Show file tree
Hide file tree
Showing 128 changed files with 715 additions and 18,029 deletions.
59 changes: 59 additions & 0 deletions .github/scripts/generate-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env bash

# This script requires Xcode 13.0+ to be installed and selected
# as the DEVELOPER_DIR.

# It is expected you will run this script from the root of the package

SCHEME="Vexil-Package"
DERIVED_DATA=".build/DerivedData"

PRODUCT_DIR="${DERIVED_DATA}/Build/Products/Debug"
VEXIL_DOCCARCHIVE="${PRODUCT_DIR}/Vexil.doccarchive"
VEXILLOGRAPHER_DOCCARCHIVE="${PRODUCT_DIR}/Vexillographer.doccarchive"

WEBSITE_DIR=".github/website"

WORKING="docs"

# Build our docs
xcodebuild docbuild \
-scheme "${SCHEME}" \
-derivedDataPath "${DERIVED_DATA}"

# Make sure they exist
if [ ! -d "${VEXIL_DOCCARCHIVE}" ]; then
>&2 echo "Could not find Vexil.doccarchive inside ${PRODUCT_DIR}"
exit 1
fi

if [ ! -d "${VEXILLOGRAPHER_DOCCARCHIVE}" ]; then
>&2 echo "Could not find Vexillographer.doccarchive inside ${PRODUCT_DIR}"
exit 1
fi

# Lets start assembling
rm -rf "${WORKING}"
mkdir -p "${WORKING}"

# We copy the entire archive from Vexil into our working dir
cp -R "${VEXIL_DOCCARCHIVE}"/* "${WORKING}"

# But only the docs from Vexillographer
cp -R "${VEXILLOGRAPHER_DOCCARCHIVE}"/data/documentation/* "${WORKING}/data/documentation/"
cp -R "${VEXILLOGRAPHER_DOCCARCHIVE}"/images/* "${WORKING}/images/"

# Re-create the .json structure inside /documentation
find "${WORKING}/data" -type f -name '*.json' \
| sed 's%data/%%g' \
| sed 's%\.json%%g' \
| xargs -n 1 mkdir -p

# Copy the index.html file from the root into each of those folders
find "${WORKING}/documentation" -type d \
| xargs -n 1 cp "${WORKING}/index.html"

# Copy our website root files over the top too
cp "${WEBSITE_DIR}/index.html" "${WORKING}"
cp "${WEBSITE_DIR}/styles.css" "${WORKING}/css"
cp "${WEBSITE_DIR}/vexil.svg" "${WORKING}/img"
File renamed without changes
63 changes: 63 additions & 0 deletions .github/website/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="css/styles.css">
<meta name="description" content="">
<meta name="author" content="">
<title>Vexil</title>
</head>

<body>
<div class="wrapper">
<div class="container">
<div class="row">
<div class="col d-none d-lg-block"></div>
<div class="col logo">
<img src="img/vexil.svg" style: "width: 400px; height: 400px;" />
</div>
<div class="col align-self-center content">
<div>
<h1>Vexil</h1>
<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>
</div>
<div class="content-body">
<a class="btn btn-lg btn-primary" href="https://github.com/unsignedapps/Vexil">GitHub</a>&nbsp;
<a class="btn btn-lg btn-outline-documentation" href="/documentation/vexil">Documentation</a>
</div>
</div>
<div class="col d-none d-lg-block"></div>
</div>
</div>

<div class="modal fade" id="privacy" tabindex="-1" role="dialog" aria-labelledby="privacyLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Privacy</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p>Your email address will be added to a Mailchimp mailing list and will be sent emails related to:</p>
<ul>
<li>the initial TestFlight beta release for iOS</li>
<li>the initial TestFlight beta release for macOS</li>
<li>and details related to our launch.</li>
</ul>
<p>You will receive less than five emails total.
<p>
<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>
<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>
</div>
</div>
</div>
</div>

</body>

</html>
78 changes: 78 additions & 0 deletions .github/website/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
body {
--color-background-dark: #000000;
--color-background-light: #ffffff;
--color-background: var(--color-background-light);
--color-foreground-dark: #ffffff;
--color-foreground-light: #000000;
--color-foreground: var(--color-foreground-light);
--color-btn-outline-dark: #f8f9fa;
--color-btn-outline-light: #212529;
--color-btn-outline: var(--color-btn-outline-light);
--color-btn-outline-hover-dark: #212529;
--color-btn-outline-hover-light: #fff;
--color-btn-outline-hover: var(--color-btn-outline-hover-light);
background-color: var(--color-background);
color: var(--color-foreground);
}

@media screen and (prefers-color-scheme:dark) {
body {
--color-background: var(--color-background-dark);
--color-foreground: var(--color-foreground-dark);
--color-btn-outline: var(--color-btn-outline-dark);
--color-btn-outline-hover: var(--color-btn-outline-hover-dark);
}
}

.wrapper {
min-height: 100%;
/* Fallback for browsers do NOT support vh unit */
min-height: 100vh;
/* These two lines are counted as one :-) */
display: flex;
align-items: center;
}

.btn-outline-documentation {
color: var(--color-btn-outline);
background-color: transparent;
background-image: none;
border-color: var(--color-btn-outline);
}

.btn-outline-documentation:hover {
color: var(--color-btn-outline-hover);
background-color: var(--color-btn-outline);
border-color: var(--color-btn-outline);
}

@media (min-width: 992px) {
.logo {
padding-right: 40px;
text-align: right;
}
.content-header,
.content-body {
width: 500px;
}
.privacy-link {
margin-right: 100px;
}
.subscribe-group {
left: 100px;
width: 300px;
}
}

@media (max-width: 991.98px) {
.logo {
padding-top: 20px;
padding-bottom: 20px;
text-align: center;
}
.content {
padding-top: 20px;
text-align: center;
padding-bottom: 20px;
}
}
22 changes: 22 additions & 0 deletions .github/website/vexil.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Docs Build"

on:
pull_request:
branches: [ main ]
paths:
- '.github/workflows/docs.yml'
- '.github/generate-docs.sh'
- '**/*.swift'

env:
DEVELOPER_DIR: /Applications/Xcode_13.0.app/Contents/Developer

jobs:
BuildWebsite:
name: "Build Docs"
runs-on: macos-11.0
steps:
- name: 🛒 Checkout
uses: actions/checkout@v2

- name: 👷 Build Website
run: .github/scripts/generate-docs.sh
30 changes: 30 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Generate Website"

on:
push:
branches: [ main ]
paths:
- '.github/workflows/website.yml'
- '**/*.swift'
- '.github/scripts/generate-docs.sh'
- '.github/website/*'

env:
DEVELOPER_DIR: /Applications/Xcode_13.0.app/Contents/Developer

jobs:
BuildWebsite:
name: "Build Website"
runs-on: macos-11.0
steps:
- name: 🛒 Checkout
uses: actions/checkout@v2

- name: 👷 Build Website
run: .github/scripts/generate-docs.sh

- name: 🚀 Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs
Binary file removed Documentation/Images/Vexillographer-1.png
Binary file not shown.
Binary file removed Documentation/Images/Vexillographer-2.png
Binary file not shown.
Binary file removed Documentation/Images/Vexillographer-3.png
Binary file not shown.
21 changes: 0 additions & 21 deletions Documentation/README.md

This file was deleted.

Loading

0 comments on commit 7a6c8f9

Please sign in to comment.