Ajout documents pour cours NoSQL
This commit is contained in:
1
cesi/nosql/Slides/Images
Symbolic link
1
cesi/nosql/Slides/Images
Symbolic link
@ -0,0 +1 @@
|
||||
../Images
|
99
cesi/nosql/Slides/make.php
Normal file
99
cesi/nosql/Slides/make.php
Normal file
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
if (empty($argv[1])) {
|
||||
die("Usage: make.php SOURCE_MARKDOWN > DESTINATION_HTML\n");
|
||||
}
|
||||
|
||||
$lines = file($argv[1]);
|
||||
$out = '';
|
||||
$in_list = $in_section = false;
|
||||
$section_class = null;
|
||||
|
||||
function escape($str) {
|
||||
$str = htmlspecialchars($str);
|
||||
$str = str_replace('<!--', '<sup>', $str);
|
||||
$str = str_replace('-->', '</sup>', $str);
|
||||
|
||||
$str = preg_replace_callback('/`(.*?)`/', function ($match) {
|
||||
return '<code>' . $match[1] . '</code>';
|
||||
}, $str);
|
||||
|
||||
$str = preg_replace_callback('/\[(.*?)\]\((.*?)\)/', function ($match) {
|
||||
return sprintf('<a href="%s">%s</a>', $match[2], $match[1]);
|
||||
}, $str);
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
foreach ($lines as $line)
|
||||
{
|
||||
if (preg_match('/^---+(?:\s*=(\w+))?$/', $line, $match)) {
|
||||
if ($in_section) {
|
||||
if ($in_list) {
|
||||
$out .= ' </ul>' . PHP_EOL;
|
||||
$in_list = false;
|
||||
}
|
||||
|
||||
$out .= '</section>' . PHP_EOL . PHP_EOL;
|
||||
$in_section = false;
|
||||
}
|
||||
|
||||
$section_class = !empty($match[1]) ? $match[1] : null;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ('' === trim($line)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!$in_section) {
|
||||
$out .= sprintf('<section class="%s">', $section_class) . PHP_EOL;
|
||||
$in_section = true;
|
||||
}
|
||||
|
||||
if (preg_match('/^(#+)\s+/', $line, $match)) {
|
||||
$size = strlen($match[1]);
|
||||
$title = trim(substr($line, strlen($match[0])));
|
||||
$out .= sprintf(' <h%d>%s</h%d>', $size, escape($title), $size) . PHP_EOL;
|
||||
}
|
||||
elseif (preg_match('/^\*\s+/', $line)) {
|
||||
if (!$in_list) {
|
||||
$out .= ' <ul>' . PHP_EOL;
|
||||
$in_list = true;
|
||||
}
|
||||
|
||||
$out .= sprintf(' <li>%s</li>', escape(trim(substr($line, 2)))) . PHP_EOL;
|
||||
}
|
||||
else {
|
||||
$out .= ' ' . trim($line) . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
if ($in_section) {
|
||||
if ($in_list) {
|
||||
$out .= ' </ul>' . PHP_EOL;
|
||||
$in_list = false;
|
||||
}
|
||||
|
||||
$out .= '</section>' . PHP_EOL . PHP_EOL;
|
||||
$in_section = false;
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Slides</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css" media="screen,presentation" />
|
||||
<link rel="stylesheet" type="text/css" href="print.css" media="print" />
|
||||
<script type="text/javascript" src="slides.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?=$out?>
|
||||
|
||||
</body>
|
||||
</html>
|
12
cesi/nosql/Slides/print.css
Normal file
12
cesi/nosql/Slides/print.css
Normal file
@ -0,0 +1,12 @@
|
||||
body {
|
||||
color: #666;
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
sup {
|
||||
vertical-align: baseline;
|
||||
font-size: 1.2em;
|
||||
display: block;
|
||||
font-style: italic;
|
||||
color: #000;
|
||||
}
|
148
cesi/nosql/Slides/slides.js
Normal file
148
cesi/nosql/Slides/slides.js
Normal file
@ -0,0 +1,148 @@
|
||||
var slides;
|
||||
var current_slide = 0;
|
||||
var current_slide_items;
|
||||
var current_item = 0;
|
||||
var slide_window;
|
||||
var clock;
|
||||
var timer;
|
||||
var timer_interval;
|
||||
var slideCounter;
|
||||
var planned_duration = 30;
|
||||
|
||||
function changeSlide(i, hide_items) {
|
||||
if (current_slide + i < 0 || current_slide + i >= slides.length)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (slide_window)
|
||||
{
|
||||
slide_window.window.changeSlide(i, hide_items);
|
||||
}
|
||||
|
||||
slides[current_slide].classList.remove('current');
|
||||
|
||||
current_slide += i;
|
||||
|
||||
// Change URL
|
||||
window.location.hash = "#" + current_slide;
|
||||
|
||||
// Get all items in a list
|
||||
current_slide_items = slides[current_slide].getElementsByTagName('li');
|
||||
current_item = 0;
|
||||
|
||||
for (var i = 0; i < current_slide_items.length; i++)
|
||||
{
|
||||
if (hide_items)
|
||||
{
|
||||
current_slide_items[i].classList.remove('shown');
|
||||
}
|
||||
else
|
||||
{
|
||||
current_slide_items[i].classList.add('shown');
|
||||
}
|
||||
}
|
||||
|
||||
slides[current_slide].classList.add('current');
|
||||
slideCounter.innerHTML = current_slide + 1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function progressSlide() {
|
||||
if (current_item + 1 > current_slide_items.length || current_slide_items[current_item].classList.contains('shown'))
|
||||
{
|
||||
return changeSlide(1, true);
|
||||
}
|
||||
|
||||
current_slide_items[current_item++].classList.add('shown');
|
||||
|
||||
if (slide_window)
|
||||
{
|
||||
slide_window.window.progressSlide();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function addTime() {
|
||||
if (!clock)
|
||||
{
|
||||
clock = document.createElement('div');
|
||||
clock.className = 'clock';
|
||||
document.body.appendChild(clock);
|
||||
}
|
||||
|
||||
function zerofill(v) {
|
||||
return ("0" + v).slice(-2);
|
||||
}
|
||||
timer = 0;
|
||||
window.clearInterval(timer_interval);
|
||||
timer_interval = window.setInterval(function () {
|
||||
timer += 1;
|
||||
clock.style.width = Math.round(timer / (planned_duration * 60) * 100) + '%';
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function initSlides () {
|
||||
slides = document.getElementsByTagName('section');
|
||||
var current = window.location.hash.substr(1);
|
||||
|
||||
if (current > 0)
|
||||
{
|
||||
current_slide = parseInt(current, 10);
|
||||
}
|
||||
|
||||
slides[current_slide].classList.add('current');
|
||||
current_slide_items = slides[current_slide].getElementsByTagName('li');
|
||||
|
||||
slideCounter = document.createElement('div');
|
||||
slideCounter.className = 'counter';
|
||||
document.body.appendChild(slideCounter);
|
||||
|
||||
document.onkeydown = function (e) {
|
||||
var prevent = false;
|
||||
|
||||
if (e.key == " ")
|
||||
{
|
||||
prevent = progressSlide();
|
||||
}
|
||||
else if (e.key == "ArrowRight" || e.key == "ArrowDown" || e.key == "PageDown")
|
||||
{
|
||||
prevent = changeSlide(1, false);
|
||||
}
|
||||
else if (e.key == "ArrowLeft" || e.key == "ArrowUp" || e.key == "PageUp")
|
||||
{
|
||||
prevent = changeSlide(-1, false);
|
||||
}
|
||||
else if (e.key == "Home")
|
||||
{
|
||||
prevent = changeSlide(-(current_slide), false);
|
||||
}
|
||||
else if (e.key == "End")
|
||||
{
|
||||
prevent = changeSlide(slides.length - 1, false);
|
||||
}
|
||||
else if (e.key == "o")
|
||||
{
|
||||
slide_window = window.open(document.location.href);
|
||||
document.body.className = "notes";
|
||||
prevent = true;
|
||||
}
|
||||
else if (e.key == "s")
|
||||
{
|
||||
addTime();
|
||||
}
|
||||
|
||||
if (prevent)
|
||||
{
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
window.onload = initSlides;
|
158
cesi/nosql/Slides/style.css
Normal file
158
cesi/nosql/Slides/style.css
Normal file
@ -0,0 +1,158 @@
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body, section, h1, h2, h3, h4, h5, h6, p, ol, ul, li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 400%;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 250%;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 200%;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
h1, h2, h3 {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
margin-left: 2em;
|
||||
font-size: 200%;
|
||||
}
|
||||
|
||||
li {
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
ul ul, ul ol, ol ul, ol ol {
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #000;
|
||||
font-family: "Eras Medium ITC", sans-serif;
|
||||
overflow: hidden;
|
||||
color: #fff;
|
||||
font-size: 16pt;
|
||||
}
|
||||
|
||||
section {
|
||||
width: 90%;
|
||||
opacity: 0;
|
||||
transition: all .7s ease-in-out;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 5%;
|
||||
background: #000;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
text-shadow: 0px 0px 10px #000;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
section.current {
|
||||
transform: translate(0);
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
border-bottom: 2px dashed darkblue;
|
||||
line-height: .8em;
|
||||
display: inline-block;
|
||||
transition: all .5s;
|
||||
border-radius: .2em;
|
||||
padding: 0 .1em;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
border-color: #fff;
|
||||
background: darkblue;
|
||||
}
|
||||
|
||||
.companyLogo {
|
||||
margin-top: 3rem;
|
||||
}
|
||||
|
||||
section {
|
||||
background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,0.7) 70%), url("Images/logo.svg") no-repeat center bottom;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
li {
|
||||
transform: translateX(-500px);
|
||||
opacity: 0;
|
||||
transition: all .5s;
|
||||
}
|
||||
|
||||
li.shown {
|
||||
transform: translate(0);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
sup {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.notes sup {
|
||||
display: block;
|
||||
background: #fff;
|
||||
padding: .2em;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.notes {
|
||||
font-size: 12pt;
|
||||
}
|
||||
|
||||
.clock {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
font-size: 2em;
|
||||
background: #333;
|
||||
height: 5px;
|
||||
width: 0px;
|
||||
transition: width 1s linear;
|
||||
}
|
||||
|
||||
.counter {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
bottom: 5px;
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
figure {
|
||||
margin: 0;
|
||||
border-radius: .5em;
|
||||
padding: 1em;
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
text-align: center;
|
||||
height: 70%;
|
||||
}
|
||||
|
||||
figure img {
|
||||
height: 95%;
|
||||
background: #fff;
|
||||
padding: .5em;
|
||||
border-radius: .5em;
|
||||
}
|
Reference in New Issue
Block a user