Commit 47717fd8 authored by sarah's avatar sarah
Browse files

first drafts

parent 5f2680a9
bash liveGraph.sh "https://ethertoff.caveat.be/ether/p/dispositifmd"
#!/bin/bash
echo $1;
while true
do
curl $1/export/txt > livegraph.dot
dot -Tpng livegraph.dot -O
sleep 30
done
\ No newline at end of file
# fsm.py - http://www.graphviz.org/content/fsm
from graphviz import Digraph
f = Digraph('finite_state_machine', filename='fsm.gv')
f.attr(rankdir='LR', size='8,5')
f.attr('node', shape='doublecircle')
f.node('LR_0')
f.node('LR_3')
f.node('LR_4')
f.node('LR_8')
f.attr('node', shape='circle')
f.edge('LR_0', 'LR_2', label='SS(B)')
f.edge('LR_0', 'LR_1', label='SS(S)')
f.edge('LR_1', 'LR_3', label='S($end)')
f.edge('LR_2', 'LR_6', label='SS(b)')
f.edge('LR_2', 'LR_5', label='SS(a)')
f.edge('LR_2', 'LR_4', label='S(A)')
f.edge('LR_5', 'LR_7', label='S(b)')
f.edge('LR_5', 'LR_5', label='S(a)')
f.edge('LR_6', 'LR_6', label='S(b)')
f.edge('LR_6', 'LR_5', label='S(a)')
f.edge('LR_7', 'LR_8', label='S(b)')
f.edge('LR_7', 'LR_5', label='S(a)')
f.edge('LR_8', 'LR_6', label='S(b)')
f.edge('LR_8', 'LR_5', label='S(a)')
This diff is collapsed.
This diff is collapsed.
......@@ -5,55 +5,81 @@
<title>OSP works</title>
<link href="http://pads.osp.kitchen/p/balsa2014-css/export/txt" rel="stylesheet" text="text/css">
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<style>
img {
max-width: 200px;
max-height: 200px;
float: left;
}
.archived {
background-color: gray;
}
.repo {
display: flex;
}
.iceberg, .processus {
width: 50%;
}
</style>
</head>
<body>
<h1>Works</h1>
<div class="filters">
View through:
View through:
<ul>
<li><a href="#" id="filter-commit">Last update</a></li>
<li><a href="#" id="filter-fonts">Fonts</a></li>
<li><a href="works-fonts.html" id="filter-fonts">Fonts</a></li>
<li><a href="#" id="filter-images">Images</a></li>
<li><a href="#" id="filter-readme">Description</a></li>
<li><a href="#" id="filter-tree">Diagram</a></li>
</ul>
</div>
<div class="repo">
<h2 class="repo-title"></h2>
<div id="latest-commit"></div>
</div>
<div class="repo">
<h2 class="repo-title"></h2>
<div id="latest-commit"></div>
</div>
<div class="repo">
<h2 class="repo-title"></h2>
<div id="latest-commit"></div>
</div>
<script type="text/javascript" charset="utf-8">
let body = document.querySelector('body');
var gitlab_url = "http://gitlab.constantvzw.org";
var user_name = "osp";
var repos = [351, 456, 508]
var repos = [448,]
for (i=0; i < repos.length; i++) {
let repo = document.createElement('div'),
title = document.createElement('h2'),
commit = document.createElement('div');
iceberg = document.createElement('div'),
processus = document.createElement('div');
iceberg_h3 = document.createElement('h3'),
processus_h3 = document.createElement('h3');
repo.classList.add("repo");
title.classList.add("repo-title");
commit.setAttribute('id', 'latest-commit');
iceberg.classList.add('iceberg');
processus.classList.add('processus');
iceberg_h3.innerHTML = "Iceberg";
processus_h3.innerHTML = "Processus";
repo.appendChild(title);
repo.appendChild(commit);
processus.appendChild(processus_h3);
repo.appendChild(processus);
iceberg.appendChild(iceberg_h3);
repo.appendChild(iceberg);
body.appendChild(repo);
getMetadata(i, repos[i], repo);
getLatestCommit(i, repos[i], repo);
let processus_url = "https://gitlab.constantvzw.org/api/v4/projects/" + repos[i] + "/repository/tree?path=processus";
let iceberg_url = "https://gitlab.constantvzw.org/api/v4/projects/" + repos[i] + "/repository/tree?path=iceberg";
getImages(i, repos[i], repo, processus_url, processus);
getImages(i, repos[i], repo, iceberg_url, iceberg);
}
// METADATA ///////////////////////////////
......@@ -70,44 +96,44 @@
let title = repoElt.querySelector('.repo-title');
name = data.name.split(".").slice(1);
title.innerHTML = name.replace(",", ".");
if (data.default_branch == "archive"){
repoElt.classList.add("archived");
}
})
}
// COMMITS ///////////////////////////////
function getLatestCommit(i, repoID, repoElt){
let commits_elt = repoElt.querySelector('#latest-commit');
let commits_url = "https://gitlab.constantvzw.org/api/v4/projects/" + repoID + "/repository/commits?per_page=1";
function getImages(i, repoID, repoElt, fetchURL, imageElt){
console.log(fetchURL);
fetch(commits_url)
.then(function(resp){
return resp.json();
})
.then(function(data){
return data.map(function(commit) {
let li = document.createElement('li'),
time = document.createElement('time'),
msg = document.createElement('p'),
author = document.createElement('p');
msg.classList.add("msg");
author.classList.add("author");
time.innerHTML = commit.created_at;
msg.innerHTML = commit.message;
author.innerHTML = commit.author_name;
li.appendChild(time);
li.appendChild(msg);
li.appendChild(author);
commits_elt.appendChild(li);
})
fetch(fetchURL)
.then(function(resp){
return resp.json();
})
.then(function(data){
let title = repoElt.querySelector('.repo-title:first-child').innerHTML;
return data.map(function(image) {
let img = document.createElement('img'),
filename = document.createElement('p');
project_path = [gitlab_url, user_name, "work." + title].join('/');
img.src = project_path + "/raw/master/" + image.path;
filename.innerHTML = image.name;
imageElt.appendChild(filename);
imageElt.appendChild(img);
})
})
//.catch(function(error) {
// console.log(JSON.stringify(error));
//});
//});
}
// END COMMITS
</script>
</script>
<script type="text/javascript" charset="utf-8" src="pad.js"> </script>
</body>
......
......@@ -6,45 +6,68 @@
<title>OSP works</title>
<link rel="stylesheet" href="https://semestriel.framapad.org/p/9f7m-osp-website-css/export/txt" type="text/css" media="all" charset="utf-8">
<style>
img {
max-width: 200px;
max-height: 200px;
img {
max-width: 200px;
max-height: 200px;
}
</style>
</head>
<body>
<h1>Works</h1>
<div class="filters">
View through:
<ul>
<li><a href="#" id="filter-commit">Last update</a></li>
<li><a href="works-fonts.html" id="filter-fonts">Fonts</a></li>
<li><a href="#" id="filter-images">Images</a></li>
<li><a href="#" id="filter-readme">Description</a></li>
<li><a href="#" id="filter-tree">Diagram</a></li>
</ul>
</div>
<div id="menu-wrapper">
<div class=logo>
<img id="logo" src="/home/smagnan/Work/osp/osp.cloud/OSP-frog/OSP_frogy-frog.svg"/>
<span><h1><a>Open Source Publishing</a></h1><h2>applied and performative research in graphic design</h2></span>
</div>
<nav class="menu">
<ul id="menu">
<li><a>Tools</a></li>
<li><a>Foundry</a></li>
<li><a>Workshops</a></li>
<li><a>Works</a></li>
<li><a>Researches</a></li>
<li><a>Live</a></li>
<li><a>Blog</a></li>
<li><a>Infos</a></li>
</ul>
</nav>
</div>
<main>
<div class="repo">
<header class="header">
<h2>work.</h2>
<h2 class="repo-title"></h2>
<ul id="views">
<span>views:</span>
<li><a href="#" id="filter-readme">Description</a></li>
<li><a href="#" id="filter-commit">Last update</a></li>
<li><a href="#" id="filter-images">visual process </a></li>
<li><a href="works-fonts.html" id="filter-fonts">Font used</a></li>
<li><a href="#" id="filter-tree">Diagram</a></li>
</ul>
</header>
</div>
</main>
<script type="text/javascript" charset="utf-8">
let body = document.querySelector('body');
let body = document.querySelector('main');
var gitlab_url = "http://gitlab.constantvzw.org";
var user_name = "osp";
var repos = [351, 456, 508]
var repos = [508]
for (i=0; i < repos.length; i++) {
let repo = document.createElement('div'),
title = document.createElement('h2'),
let header = document.querySelector('header.header'),
nav = document.querySelector('ul#views'),
title = document.querySelector('h2.repo-title'),
repo = document.querySelector('div.repo'),
commit = document.createElement('div');
repo.classList.add("repo");
title.classList.add("repo-title");
commit.classList.add('latest-commit');
repo.appendChild(title);
header.appendChild(title);
header.append(nav);
repo.appendChild(commit);
body.appendChild(repo);
getMetadata(i, repos[i], repo);
......@@ -110,12 +133,12 @@
})
//.catch(function(error) {
// console.log(JSON.stringify(error));
//});
//});
}
// END COMMITS
</script>
<script type="text/javascript" charset="utf-8" src="pad.js"> </script>
<script type="text/javascript" charset="utf-8" src="generator/static/js/pad.js"> </script>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment