[docs][site] Introduce static index html for the project website (#961)

pull/968/head
tsreaper 3 years ago committed by GitHub
parent 41a5463437
commit 8c3dfda48e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,6 +28,12 @@ export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
export REPO_NAME="${GITHUB_REPOSITORY##*/}"
temp_docs_root=`mktemp -d`
ls
# step-1.5: copy main site content to temp dir
# this must be done before `make -C docs clean` otherwise the contents will be removed
rsync -avz "docs/site/" "${temp_docs_root}/"
# step-2: build sites for all branches(for multiple versioned docs), excludes 'HEAD' and 'gh-pages'
make -C docs clean
branches="`git for-each-ref '--format=%(refname:lstrip=-1)' refs/remotes/origin/ | grep -viE '^(HEAD|gh-pages|release-1.0|release-1.1|release-1.2|release-1.3)$'| grep -iE '^(release-|master)'`"
@ -59,18 +65,6 @@ git remote add deploy "https://token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSIT
git checkout -b gh-pages
touch .nojekyll
cat > index.html <<EOF
<!DOCTYPE html>
<html>
<head>
<title>Flink CDC</title>
<meta http-equiv = "refresh" content="0; url='/${REPO_NAME}/master/'" />
</head>
<body>
<p>Please wait while you're redirected to our <a href="/${REPO_NAME}/master/">documentation</a>.</p>
</body>
</html>
EOF
git add .
git commit -m "Generated docs from commit ${GITHUB_SHA}"
@ -78,4 +72,4 @@ git push deploy gh-pages --force
# pop back and exit
popd
exit 0
exit 0

@ -0,0 +1,8 @@
Flink CDC Site
Copyright 2022 Ververica Inc.
This project bundles the following dependencies under the MIT license.
See bundled license files for details.
- termynal (https://github.com/ines/termynal)
-> in lib directory

Binary file not shown.

After

Width:  |  Height:  |  Size: 649 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

@ -0,0 +1,245 @@
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css">
<!-- Termynal CSS -->
<link rel="stylesheet" href="lib/termynal.css">
<title>Flink CDC</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark px-4 py-2" style="background: #336699">
<a class="navbar-brand" href="#">Flink CDC</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbarContent">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="https://github.com/ververica/flink-cdc-connectors/releases/">Download</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="https://ververica.github.io/flink-cdc-connectors/master/">Documentation</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="https://github.com/ververica/flink-cdc-connectors/">Source</a>
</li>
</ul>
</div>
</nav>
<section class="hero-banner position-relative">
<div class="bg"></div>
<div class="container position-relative">
<div class="container py-xs-2 py-sm-3 py-md-4 py-xxl-5">
<div class="row py-5">
<div class="col-xl-6 col-lg-8">
<h1 class="display-5 fw-bold lh-1 mb-3" style="color: #336699;">Flink CDC</h1>
<h3 style="color: #336699;">Embrace Database Changes</h3>
<p><a class="github-button" href="https://github.com/ververica/flink-cdc-connectors" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star ververica/flink-cdc-connectors on GitHub">Star</a></p>
<p class="lead">Flink CDC Connectors is a set of source connectors for Apache Flink, ingesting changes from different databases using change data capture.</p>
<div class="d-grid gap-2 d-md-flex justify-content-md-start">
<a role="button" class="btn btn-primary btn-lg px-4 me-md-2" href="https://github.com/ververica/flink-cdc-connectors/releases/">Download</a>
<a role="button" class="btn btn-secondary btn-lg px-4" href="https://ververica.github.io/flink-cdc-connectors/master/">Documentation</a>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="bg-white">
<div class="container py-4">
<div class="row py-3">
<div class="col-12 text-center"><h1>Key Features</h1></div>
</div>
<div class="row py-4">
<div class="col-md-12 col-lg-4 px-4">
<a class="no-decoration-anchor" href="https://ververica.github.io/flink-cdc-connectors/master/content/about.html#features">
<div class="text-center text-primary">
<h1><i class="bi bi-calculator"></i></h1>
<h4>Exactly-once Semantics</h4>
</div>
</a>
<div class="py-3">Flink CDC supports reading database snapshots and continues to read binlogs with exactly-once processing, even after failures.</div>
</div>
<div class="col-md-12 col-lg-4 px-4">
<a class="no-decoration-anchor" href="https://ververica.github.io/flink-cdc-connectors/master/content/about.html#usage-for-table-sql-api">
<div class="text-center text-primary">
<h1><i class="bi bi-hdd-network"></i></h1>
<h4>Table/SQL API</h4>
</div>
</a>
<div class="py-3">Users can use SQL DDL to create a CDC source to monitor changes on a single table.</div>
</div>
<div class="col-md-12 col-lg-4 px-4">
<a class="no-decoration-anchor" href="https://ververica.github.io/flink-cdc-connectors/master/content/about.html#usage-for-datastream-api">
<div class="text-center text-primary">
<h1><i class="bi bi-water"></i></h1>
<h4>DataStream API</h4>
</div>
</a>
<div class="py-3">Users can consume changes on multiple databases and tables in a single job without Debezium and Kafka deployed.</div>
</div>
</div>
</div>
</section>
<section class="bg-dark text-light">
<div class="container py-4">
<div class="row py-4">
<div class="col-md-12 col-lg-5 mx-auto py-4 align-self-center">
<div class="pb-4 text-center"><h2>Getting Started</h2></div>
<div class="py-4" style="font-size: 20px">Flink CDC provides a series of quick start demos without any dependencies or java code, only a Linux or MacOS computer with Docker installed is enough. With these demos, you can quickly feel the power and convenience of Flink CDC.</div>
<a role="button" class="btn btn-outline-primary btn-lg px-4" href="https://ververica.github.io/flink-cdc-connectors/master/content/quickstart/index.html">Learn More</a>
</div>
<div class="col-md-12 col-lg-6 mx-auto">
<div class="termynal" data-termynal data-ty-typeDelay="20" data-ty-lineDelay="20">
<span data-ty="input" data-ty-prompt="Flink SQL>">-- creates a mysql cdc table source</span>
<span data-ty="input" data-ty-prompt="Flink SQL>">CREATE TABLE mysql_binlog (</span>
<span data-ty="input" data-ty-prompt="">&nbsp;&nbsp;id INT NOT NULL,</span>
<span data-ty="input" data-ty-prompt="">&nbsp;&nbsp;name STRING,</span>
<span data-ty="input" data-ty-prompt="">&nbsp;&nbsp;description STRING,</span>
<span data-ty="input" data-ty-prompt="">&nbsp;&nbsp;weight DECIMAL(10,3),</span>
<span data-ty="input" data-ty-prompt="">&nbsp;&nbsp;PRIMARY KEY(id) NOT ENFORCED</span>
<span data-ty="input" data-ty-prompt="">) WITH (</span>
<span data-ty="input" data-ty-prompt="">&nbsp;&nbsp;'connector' = 'mysql-cdc',</span>
<span data-ty="input" data-ty-prompt="">&nbsp;&nbsp;'hostname' = 'localhost',</span>
<span data-ty="input" data-ty-prompt="">&nbsp;&nbsp;'port' = '3306',</span>
<span data-ty="input" data-ty-prompt="">&nbsp;&nbsp;'username' = 'flinkuser',</span>
<span data-ty="input" data-ty-prompt="">&nbsp;&nbsp;'password' = 'flinkpw',</span>
<span data-ty="input" data-ty-prompt="">&nbsp;&nbsp;'database-name' = 'inventory',</span>
<span data-ty="input" data-ty-prompt="">&nbsp;&nbsp;'table-name' = 'products'</span>
<span data-ty="input" data-ty-prompt="">);</span>
<span data-ty="input" data-ty-prompt=""></span>
<span data-ty="input" data-ty-prompt="Flink SQL>">-- read snapshot and binlog data from mysql</span>
<span data-ty="input" data-ty-prompt="Flink SQL>">-- and do some transformation</span>
<span data-ty="input" data-ty-prompt="Flink SQL>">-- and show on the client</span>
<span data-ty="input" data-ty-prompt="Flink SQL>">SELECT id, UPPER(name), description, weight FROM mysql_binlog;</span>
</div>
</div>
</div>
</div>
</section>
<section class="bg-white">
<div class="container py-4">
<div class="row py-4">
<div class="col-md-12 col-lg-7 text-center mx-auto" style="color: #2a3a4a;">
<div class="pb-4"><h2>Connect to Your Favorite Database</h2></div>
<div style="font-size: 20px;">Flink CDC Supports ingesting snapshot data and real time changes from databases to Flink and then transform and sink to various downstream systems.</div>
</div>
<div class="col-md-12 col-lg-10 text-center mx-auto"><img src="assets/cdc-flow.png" width="100%" /></div>
</div>
</div>
</section>
<section style="background-color: #ddeeff;">
<div class="container py-4">
<div class="row py-3">
<div class="col-12 text-center"><h2>Join the Community</h2></div>
</div>
<div class="row py-4 justify-content-center">
<div class="col-12 col-md-4 col-xl-3 px-4 align-self-center">
<img src="assets/dingtalk.png" width="100%" />
</div>
<div class="col-12 col-md-8 col-xl-6 p-3">
<a class="no-decoration-anchor" href="https://h5.dingtalk.com/circle/healthCheckin.html?dtaction=os&corpId=dinge369343b40eb68f87c231cb892228ad7&14ee9113-c3=cc3ed38a-82&cbdbhh=qwertyuiop">
<div class="card border-primary my-3">
<div class="card-body" style="background-color: #ddeeff">
<div class="row">
<div class="col-2 align-self-center text-center text-primary">
<h1><i class="bi bi-envelope-paper"></i></h1>
</div>
<div class="col-10">
<h4 class="card-title text-primary">DingTalk Group</h4>
<p class="card-text">Discussion and help from your fellow users.</p>
</div>
</div>
</div>
</div>
</a>
<a class="no-decoration-anchor" href="https://github.com/ververica/flink-cdc-connectors">
<div class="card border-primary my-3">
<div class="card-body" style="background-color: #ddeeff">
<div class="row">
<div class="col-2 align-self-center text-center text-primary">
<h1><i class="bi bi-github"></i></h1>
</div>
<div class="col-10">
<h4 class="card-title text-primary">Github</h4>
<p class="card-text">Development takes place here!</p>
</div>
</div>
</div>
</div>
</a>
<a class="no-decoration-anchor" href="https://github.com/ververica/flink-cdc-connectors/issues">
<div class="card border-primary my-3">
<div class="card-body" style="background-color: #ddeeff">
<div class="row">
<div class="col-2 align-self-center text-center text-primary">
<h1><i class="bi bi-clipboard-check"></i></h1>
</div>
<div class="col-10">
<h4 class="card-title text-primary">Issue Tracking</h4>
<p class="card-text">Report here if you find any issue.</p>
</div>
</div>
</div>
</div>
</a>
</div>
</div>
</div>
</section>
<!-- Copyright -->
<div class="text-center p-3 bg-dark text-light">Copyright &copy; 2022 Ververica, Licensed under the <a href="https://www.apache.org/licenses/">Apache License, Version 2.0</a>.</div>
<!-- Copyright -->
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<!-- Termynal JS -->
<script src="lib/termynal.js" data-termynal-container=".termynal"></script>
<!-- Github Buttons JS -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
</body>
<style>
.hero-banner {
height: 475px;
}
.hero-banner > .bg {
background: no-repeat right center;
background-image: linear-gradient(to left, rgba(219, 219, 221, 0.7) 0%, rgba(219, 219, 221, 0.7) 20%, rgba(219, 219, 221, 0.7) 40%), url(assets/squirrel.jpg);
background-color: #dbdbdd;
height: 475px;
top: 0;
position: absolute;
right: 0;
width: 100%;
}
@media (min-width: 992px) {
.hero-banner > .bg {
background-image: linear-gradient(to left, rgba(219, 219, 221, 0) 0%, rgba(219, 219, 221, 0) 20%, rgba(219, 219, 221, 0.5) 40%), url(assets/squirrel.jpg);
}
}
.no-decoration-anchor {
text-decoration: inherit;
color: inherit;
}
</style>
</html>

@ -0,0 +1,101 @@
/**
* termynal.js
*
* @author Ines Montani <ines@ines.io>
* @version 0.0.1
* @license MIT
*/
:root {
--color-bg: #252a33;
--color-text: #eee;
--color-text-subtle: #a2a2a2;
}
[data-termynal] {
width: 750px;
max-width: 100%;
background: var(--color-bg);
color: var(--color-text);
font-size: 14px;
font-family: 'Fira Mono', Consolas, Menlo, Monaco, 'Courier New', Courier, monospace;
border-radius: 4px;
padding: 75px 45px 35px;
position: relative;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
[data-termynal]:before {
content: '';
position: absolute;
top: 15px;
left: 15px;
display: inline-block;
width: 15px;
height: 15px;
border-radius: 50%;
/* A little hack to display the window buttons in one pseudo element. */
background: #d9515d;
-webkit-box-shadow: 25px 0 0 #f4c025, 50px 0 0 #3ec930;
box-shadow: 25px 0 0 #f4c025, 50px 0 0 #3ec930;
}
[data-termynal]:after {
content: 'Flink SQL Client';
position: absolute;
color: var(--color-text-subtle);
top: 5px;
left: 0;
width: 100%;
text-align: center;
}
[data-ty] {
display: block;
line-height: 1.5;
}
[data-ty]:before {
/* Set up defaults and ensure empty lines are displayed. */
content: '';
display: inline-block;
vertical-align: middle;
}
[data-ty="input"]:before,
[data-ty-prompt]:before {
margin-right: 0.75em;
color: var(--color-text-subtle);
}
[data-ty="input"]:before {
content: '$';
}
[data-ty][data-ty-prompt]:before {
content: attr(data-ty-prompt);
}
[data-ty-cursor]:after {
content: attr(data-ty-cursor);
font-family: monospace;
margin-left: 0.5em;
-webkit-animation: blink 1s infinite;
animation: blink 1s infinite;
}
/* Cursor animation */
@-webkit-keyframes blink {
50% {
opacity: 0;
}
}
@keyframes blink {
50% {
opacity: 0;
}
}

@ -0,0 +1,197 @@
/**
* termynal.js
* A lightweight, modern and extensible animated terminal window, using
* async/await.
*
* @author Ines Montani <ines@ines.io>
* @version 0.0.1
* @license MIT
*/
'use strict';
/** Generate a terminal widget. */
class Termynal {
/**
* Construct the widget's settings.
* @param {(string|Node)=} container - Query selector or container element.
* @param {Object=} options - Custom settings.
* @param {string} options.prefix - Prefix to use for data attributes.
* @param {number} options.startDelay - Delay before animation, in ms.
* @param {number} options.typeDelay - Delay between each typed character, in ms.
* @param {number} options.lineDelay - Delay between each line, in ms.
* @param {number} options.progressLength - Number of characters displayed as progress bar.
* @param {string} options.progressChar Character to use for progress bar, defaults to .
* @param {number} options.progressPercent - Max percent of progress.
* @param {string} options.cursor Character to use for cursor, defaults to .
* @param {Object[]} lineData - Dynamically loaded line data objects.
* @param {boolean} options.noInit - Don't initialise the animation.
*/
constructor(container = '#termynal', options = {}) {
this.container = (typeof container === 'string') ? document.querySelector(container) : container;
this.pfx = `data-${options.prefix || 'ty'}`;
this.startDelay = options.startDelay
|| parseFloat(this.container.getAttribute(`${this.pfx}-startDelay`)) || 600;
this.typeDelay = options.typeDelay
|| parseFloat(this.container.getAttribute(`${this.pfx}-typeDelay`)) || 90;
this.lineDelay = options.lineDelay
|| parseFloat(this.container.getAttribute(`${this.pfx}-lineDelay`)) || 1500;
this.progressLength = options.progressLength
|| parseFloat(this.container.getAttribute(`${this.pfx}-progressLength`)) || 40;
this.progressChar = options.progressChar
|| this.container.getAttribute(`${this.pfx}-progressChar`) || '█';
this.progressPercent = options.progressPercent
|| parseFloat(this.container.getAttribute(`${this.pfx}-progressPercent`)) || 100;
this.cursor = options.cursor
|| this.container.getAttribute(`${this.pfx}-cursor`) || '▋';
this.lineData = this.lineDataToElements(options.lineData || []);
if (!options.noInit) this.init()
}
/**
* Initialise the widget, get lines, clear container and start animation.
*/
init() {
// Appends dynamically loaded lines to existing line elements.
this.lines = [...this.container.querySelectorAll(`[${this.pfx}]`)].concat(this.lineData);
/**
* Calculates width and height of Termynal container.
* If container is empty and lines are dynamically loaded, defaults to browser `auto` or CSS.
*/
const containerStyle = getComputedStyle(this.container);
this.container.style.width = containerStyle.width !== '0px' ?
containerStyle.width : undefined;
this.container.style.minHeight = containerStyle.height !== '0px' ?
containerStyle.height : undefined;
this.container.setAttribute('data-termynal', '');
this.container.innerHTML = '';
this.start();
}
/**
* Start the animation and rener the lines depending on their data attributes.
*/
async start() {
await this._wait(this.startDelay);
for (let line of this.lines) {
const type = line.getAttribute(this.pfx);
const delay = line.getAttribute(`${this.pfx}-delay`) || this.lineDelay;
if (type == 'input') {
line.setAttribute(`${this.pfx}-cursor`, this.cursor);
await this.type(line);
await this._wait(delay);
}
else if (type == 'progress') {
await this.progress(line);
await this._wait(delay);
}
else {
this.container.appendChild(line);
await this._wait(delay);
}
line.removeAttribute(`${this.pfx}-cursor`);
}
}
/**
* Animate a typed line.
* @param {Node} line - The line element to render.
*/
async type(line) {
const chars = [...line.textContent];
const delay = line.getAttribute(`${this.pfx}-typeDelay`) || this.typeDelay;
line.textContent = '';
this.container.appendChild(line);
for (let char of chars) {
await this._wait(delay);
line.textContent += char;
}
}
/**
* Animate a progress bar.
* @param {Node} line - The line element to render.
*/
async progress(line) {
const progressLength = line.getAttribute(`${this.pfx}-progressLength`)
|| this.progressLength;
const progressChar = line.getAttribute(`${this.pfx}-progressChar`)
|| this.progressChar;
const chars = progressChar.repeat(progressLength);
const progressPercent = line.getAttribute(`${this.pfx}-progressPercent`)
|| this.progressPercent;
line.textContent = '';
this.container.appendChild(line);
for (let i = 1; i < chars.length + 1; i++) {
await this._wait(this.typeDelay);
const percent = Math.round(i / chars.length * 100);
line.textContent = `${chars.slice(0, i)} ${percent}%`;
if (percent>progressPercent) {
break;
}
}
}
/**
* Helper function for animation delays, called with `await`.
* @param {number} time - Timeout, in ms.
*/
_wait(time) {
return new Promise(resolve => setTimeout(resolve, time));
}
/**
* Converts line data objects into line elements.
*
* @param {Object[]} lineData - Dynamically loaded lines.
* @param {Object} line - Line data object.
* @returns {Element[]} - Array of line elements.
*/
lineDataToElements(lineData) {
return lineData.map(line => {
let div = document.createElement('div');
div.innerHTML = `<span ${this._attributes(line)}>${line.value || ''}</span>`;
return div.firstElementChild;
});
}
/**
* Helper function for generating attributes string.
*
* @param {Object} line - Line data object.
* @returns {string} - String of attributes.
*/
_attributes(line) {
let attrs = '';
for (let prop in line) {
attrs += this.pfx;
if (prop === 'type') {
attrs += `="${line[prop]}" `
} else if (prop !== 'value') {
attrs += `-${prop}="${line[prop]}" `
}
}
return attrs;
}
}
/**
* HTML API: If current script has container(s) specified, initialise Termynal.
*/
if (document.currentScript.hasAttribute('data-termynal-container')) {
const containers = document.currentScript.getAttribute('data-termynal-container');
containers.split('|')
.forEach(container => new Termynal(container))
}

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (C) 2017 Ines Montani
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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 OR COPYRIGHT HOLDERS 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.

@ -256,6 +256,8 @@ under the License.
<exclude>docs/make.bat</exclude>
<exclude>docs/_templates/version.html</exclude>
<exclude>docs/_static/button.js</exclude>
<!-- Site -->
<exclude>docs/site/**</exclude>
<!-- Tests -->
<exclude>**/*.txt</exclude>
<exclude>flink-connector-mysql-cdc/src/test/resources/file/*.json</exclude>

Loading…
Cancel
Save