marc/build.py
Marc Beninca 3177ee4d50 switch js
2023-06-30 20:27:57 +02:00

469 lines
18 KiB
Python
Executable file

#! /usr/bin/env python3
import os
import subprocess
def run(*args):
subprocess.call(args)
def link(active:str, id:str, text:str)->str:
items = ['<a']
if (active == id):
items.append(' class="active"')
items.append(f' href="#{id}">{text}</a>')
return str().join(items)
def nav(active:str=None)->str:
return f'''\
<nav>
{link(active, 'main', 'main')}
{link(active, 'cv', 'CV')}
{link(active, 'git', 'Git')}
{link(active, 'health', 'Health')}
{link(active, 'id', 'Identity')}
{link(active, 'lib', 'LinkInBio')}
{link(active, 'music', 'Music')}
{link(active, 'pubnix', 'PubNix')}
{link(active, 'thesis', 'Thesis')}
{link(active, 'vegan', 'Vegan')}
{link(active, 'others', 'others…')}
</nav>
'''
def main():
root = os.path.dirname(os.path.realpath(__file__))
link_gv = os.path.join(root, 'link.gv')
link_svg = os.path.join(root, 'link.svg')
run('dot', link_gv, '-Tsvg', '-o', link_svg)
with open(link_svg, 'br') as f:
link_text = f.read().decode('u8')
page_file = os.path.join(root, 'index.html')
page_text = f'''\
<!DOCTYPE html><html><head>
<!----------------------------------------------------------------------------->
<meta charset="UTF-8" />
<meta name="flattr:id" content="z3d26l" />
<meta name="viewport" content="initial-scale=1,width=device-width" />
<link rel="stylesheet" href="index.css" />
<script src="index.js"></script>
<title>Marc Beninca</title>
<!----------------------------------------------------------------------------->
</head><body onload="main()"><header>
<!----------------------------------------------------------------------------->
<h1><a href="#home">Marc Beninca</a></h1>
<!----------------------------------------------------------------------------->
</header><main>
<!----------------------------------------------------------------------------->
<section id="main">
{nav('main')}
<ul class="cards">
<li class="card"><a href="https://linkedin.com/in/marc-beninca">
<img src="LinkedIn.png" /><br />LinkedIn</a></li>
<li class="card"><a href="https://youtube.com/@marc.beninca">
<img src="YouTube.png" /><br />YouTube</a></li>
</ul>
</section>
<!----------------------------------------------------------------------------->
<section id="cv">
{nav('cv')}
<ul class="cards">
<li class="card"><a href="cv.en.pdf">
<img src="en.svg" /><br />English</a></li>
<li class="card"><a href="cv.fr.pdf">
<img src="fr.svg" /><br />Français</a></li>
</ul>
</section>
<!----------------------------------------------------------------------------->
<section id="git">
{nav('git')}
<ul>
<li><a href="https://git.42l.fr/marc.beninca">42l</a></li>
<li><a href="https://git.afpy.org/marc.beninca">AFPy</a></li>
<li><a href="https://forge.chapril.org/marc.beninca">Chapril</a></li>
<li><a href="https://codeberg.org/marc.beninca">CodeBerg</a></li>
<li><a href="https://git.disroot.org/marc.beninca">DisRoot</a></li>
<li><a href="https://git.envs.net/marc.beninca">Envs</a></li>
<li><a href="https://git.froggi.es/marc.beninca">Froggies</a></li>
<li><a href="https://git.fsfe.org/marc.beninca">FSFE</a></li>
<li><a href="https://gitdab.com/marc.beninca">GitDab</a></li>
<li><a href="https://gitea.com/marc.beninca">Gitea</a></li>
<li><a href="https://gitnet.fr/marc.beninca">GitNet</a></li>
<li><a href="https://git.projectsegfau.lt/marc.beninca">ProjectSegfault</a></li>
<!--<li><a href="https://silica.codes/marc.beninca">SilicaCodes</a></li>-->
<li><a href="https://tildegit.org/marc.beninca">TildeGit</a></li>
<li><a href="https://git.tildevarsh.in/marc.beninca">TildeVarsh</a></li>
</ul>
<hr />
<ul>
<li><a href="https://gitee.com/marc_beninca">Gitee</a></li>
<li><a href="https://notabug.org/marc.beninca">NotABug</a></li>
<li><a href="https://pagure.io/user/marc-beninca">Pagure</a></li>
<li><a href="https://rocketgit.com/marc.beninca">RocketGit</a></li>
<li><a href="https://sr.ht/~marc_beninca/rwx.work/sources">SourceHut</a></li>
</ul>
<hr />
<ul>
<li>Gforge</li>
</ul>
</section>
<!----------------------------------------------------------------------------->
<section id="health">
{nav('health')}
<ul>
<li><a href="https://www.youtube.com/@chubbyemu/videos">Chubby Emu</a></li>
<li><a href="https://www.youtube.com/@DrEricBergDC/videos">Eric Berg</a></li>
<li><a href="https://www.youtube.com/@drekberg/videos">Sten Ekberg</a></li>
<li><a href="https://www.youtube.com/@drjasonfung/videos">Jason Fung</a></li>
</ul>
<ul>
<li><a href="https://www.youtube.com/@KianaDocherty/videos">Kiana Docherty</a></li>
<li><a href="https://www.youtube.com/@ThomasDeLauerOfficial/videos">Thomas DeLauer</a></li>
</ul>
<hr />
<ul>
<li><a href="https://www.youtube.com/@ivredevie/videos">Ivre de vie</a></li>
</ul>
</section>
<!----------------------------------------------------------------------------->
<section id="id">
{nav('id')}
<img src="marc.jpeg" />
<table>
<tr><th colspan="2">OpenPGP</th></tr>
<tr><td colspan="2"><a href="https://marc.beninca.link/pgp.asc">marc.beninca.link</a></td></tr>
<tr><td colspan="2"><a href="https://meta.sr.ht/~marc_beninca.pgp">meta.sr.ht</a></td></tr>
<tr><td colspan="2"><a href="https://keys.openpgp.org/search?q=marc@beninca.link">keys.openpgp.org</a></td></tr>
<tr>
<th><a href="https://keybase.io/marc_beninca">Key<br>Base</a></th>
<th><a href="https://keyoxide.org/marc@beninca.link">Key<br>Oxide</a></th>
<th><a href="https://liberapay.com/marc.beninca">Libera<br>Pay</a></th>
<th><a href="https://patreon.com/marc_beninca">Patreon</a></th>
<th><a href="https://tipeee.com/marc-beninca">Tip<br>eee</a></th>
</tr>
<tr>
<td><a href="https://keybase.io/marc_beninca/sigchain#27f9b7d24922016cc0eec421bc438be43625bc3a279e937b0e8d0c02c84f2aee0f">CC / BTC</a></td>
<td colspan="2"><a href="https://mastodon.cloud/@marc_beninca">Mastodon</a></td>
<td colspan="2"><a href="https://discord.gg/v6p7CtZ4Zh">Discord</a></td>
</tr><tr>
<td><a href="https://keybase.io/marc_beninca/sigchain#db059a1ab2a2916feb763535ae0aec75e5401f1eac8452d09b7bc3ad24512c670f">CC / ZEC</a></td>
<td colspan="2"><a href="https://gitlab.com/marc.beninca">GitLab</a></td>
<td><a href="https://youtube.com/@marc.beninca">YouTube</a></td>
</tr><tr>
<td><a href="https://dmoj.ca/user/marc_beninca">DMOJ</a></td>
<td colspan="2"><a href="https://poa.st/@marc_beninca">Pleroma</a></td>
<td><a href="https://facebook.com/marc.beninca.page">FaceBook</a></td>
</tr><tr>
<td><a href="https://galactictalk.org/u/marc_beninca">GalacticTalk</a></td>
<td><a href="https://pixelfed.social/marc.beninca">PixelFed</a></td>
<td><a href="https://openstreetmap.org/user/Marc Beninca">OpenStreetMap</a></td>
<td><a href="https://instagram.com/marc.beninca">Instagram</a></td>
</tr><tr>
<td colspan="2"><a href="https://reddit.com/user/marc_beninca">Reddit</a></td>
<td><a href="https://twitch.tv/marc_beninca">Twitch</a></td>
<td><a href="https://vimeo.com/marcbeninca">Vimeo</a></td>
</tr><tr>
<td colspan="4"><a href="https://twitter.com/marc_beninca">Twitter</a></td>
</tr><tr>
<td colspan="2"><a href="https://news.ycombinator.com/user?id=marc_beninca">HackerNews</a></td>
<td><a href="https://bitbucket.org/marc_beninca">BitBucket</a></td>
</tr><tr>
<td colspan="2"><a href="https://lobste.rs/u/marc_beninca">Lobsters</a></td>
<td><a href="https://linuxfr.org/users/marc-beninca">LinuxFR</a></td>
</tr><tr>
<td colspan="3"><a href="https://github.com/marc-beninca">GitHub</a></td>
</tr>
<tr><th colspan="2">DNS</th></tr>
<tr><td colspan="2"><a href="https://beninca.link">beninca.link</a></td></tr>
<tr><td colspan="2"><a href="https://computing.land">computing.land</a></td></tr>
<tr><td colspan="2">marc-beninca.fr</td></tr>
<tr><td colspan="2"><a href="https://rwx.work">rwx.work</a></td></tr>
<tr><td colspan="2"><a href="https://tilde.link">tilde.link</a></td></tr>
<tr><th /><th>GitLab</th></tr>
<tr><td /><td><a href="https://salsa.debian.org/marc.beninca">Debian</a></td></tr>
<tr><td /><td><a href="https://framagit.org/marc.beninca">FramaGit</a></td></tr>
<tr><td /><td><a href="https://lab.frogg.it/marc.beninca">FrogGit</a></td></tr>
<tr><td /><td><a href="https://gitgud.io/marc.beninca">GitGud</a></td></tr>
<tr><td /><td><a href="https://git.insomnia247.nl/marc.beninca">Insomnia</a></td></tr>
<tr><th /><th>Gitea</th></tr>
<tr><td /><td><a href="https://git.42l.fr/marc.beninca">42l</a></td></tr>
<tr><td /><td><a href="https://git.afpy.org/marc.beninca">AFPy</a></td></tr>
<tr><td /><td><a href="https://forge.chapril.org/marc.beninca">Chapril</a></td></tr>
<tr><td /><td><a href="https://codeberg.org/marc.beninca">CodeBerg</a></td></tr>
<tr><td /><td><a href="https://git.disroot.org/marc.beninca">DisRoot</a></td></tr>
<tr><td /><td><a href="https://git.envs.net/marc.beninca">Envs</a></td></tr>
<tr><td /><td><a href="https://git.froggi.es/marc.beninca">Froggies</a></td></tr>
<tr><td /><td><a href="https://git.fsfe.org/marc.beninca">FSFE</a></td></tr>
<tr><td /><td><a href="https://gitdab.com/marc.beninca">GitDab</a></td></tr>
<tr><td /><td><a href="https://gitea.com/marc.beninca">Gitea</a></td></tr>
<tr><td /><td><a href="https://git.projectsegfau.lt/marc.beninca">ProjectSegfault</a></td></tr>
<!--<tr><td /><td><a href="https://silica.codes/marc.beninca">SilicaCodes</a></td></tr>-->
<tr><td /><td><a href="https://tildegit.org/marc.beninca">TildeGit</a></td></tr>
<tr><td /><td><a href="https://git.tildevarsh.in/marc.beninca">TildeVarsh</a></td></tr>
<tr><th /><th><a href="https://stackexchange.com/users/27893631">StackExchange</a></th></tr>
<tr><td /><td><a href="https://meta.stackexchange.com/users/1332957">Meta</a></td></tr>
<tr><td /><td><a href="https://serverfault.com/users/1007137">ServerFault</a></td></tr>
<tr><td /><td><a href="https://stackoverflow.com/users/21299988">StackOverflow</a></td></tr>
<tr><td /><td><a href="https://tex.stackexchange.com/users/291075">TeX</a></td></tr>
<tr><td /><td><a href="https://unix.stackexchange.com/users/562508">Unix</a></td></tr>
</table>
</section>
<!----------------------------------------------------------------------------->
<section id="lib">
{nav('lib')}
<ul>
<li><a href="https://marc-beninca.8b.io">8bio</a></li>
<li><a href="https://allmylinks.com/marc-beninca">AllMyLinks</a></li>
<li><a href="https://beacons.ai/marc.beninca">Beacons</a></li>
<li><a href="https://bioin.link/marc.beninca">BioInLink</a></li>
<li><a href="https://marc_beninca.bio.link">Bio.Link</a></li>
<li><a href="https://biolinky.co/marcbeninca">BioLinky</a></li>
<li><a href="https://marc_beninca.c8ke.com">C8ke</a></li>
<li><a href="https://campsite.bio/marc.beninca">CampSite</a></li>
<li><a href="https://marc-beninca.carrd.co">Carrd</a></li>
<li><a href="https://direct.me/marc_beninca">DirectMe</a></li>
<li><a href="https://everlink.tools/marc.beninca">EverLink</a></li>
<li><a href="https://feedlink.io/marcbeninca">FeedLink</a></li>
<li><a href="https://flow.page/marc.beninca">FlowPage</a></li>
<li><a href="https://heylink.me/marc.beninca">HeyLinkMe</a></li>
<li><a href="https://hy.page/marcbeninca">HyPage</a></li>
<li><a href="https://ichi.gg/marc.beninca">Ichi.GG</a></li>
<li><a href="https://linkfly.to/marc-beninca">LinkFly</a></li>
<li><a href="https://instabio.cc/marc-beninca">LinkInBio</a></li>
<li><a href="https://linkpluto.com/marc-beninca">LinkPluto</a></li>
<li><a href="https://linkpop.com/marc-beninca">LinkPop</a></li>
<li><a href="https://linkr.bio/marc.beninca">Linkr.Bio</a></li>
<li><a href="https://linksight.me/marc_beninca">LinkSight</a></li>
<li><a href="https://linktr.ee/marc.beninca">LinkTree</a></li>
<li><a href="https://lnk.bio/marc.beninca">Lnk.Bio</a></li>
<li><a href="https://lu.ma/marc.beninca">Luma</a></li>
<li><a href="https://nano.site/marc.beninca">NanoSite</a></li>
<li><a href="https://marcbeninca.podia.com">Podia</a></li>
<li><a href="https://solo.to/marc.beninca">SoloTo</a></li>
<li><a href="https://marc-beninca.start.page">StartPage</a></li>
<li><a href="https://tap.bio/marc.beninca">Tap.Bio</a></li>
<li><a href="https://marc-beninca.taplink.ws">TapLink</a></li>
<li><a href="https://url.bio/marc_beninca">URL.Bio</a></li>
<li><a href="https://wlo.link/@marc_beninca">Willow</a></li>
<li><a href="https://withkoji.com/@marc.beninca">WithKoji</a></li>
<li><a href="https://zaap.bio/marc.beninca">Zaap</a></li>
</ul>
</section>
<!----------------------------------------------------------------------------->
<section id="music">
{nav('music')}
<ul>
<li><a href="https://www.youtube.com/@Daniellabjarnhof/videos">Daniella Bjarnhof</a></li>
<li><a href="https://www.youtube.com/@DJGroove/videos">DJ Groove</a></li>
<li><a href="https://www.youtube.com/@flavourtrip/videos">Flavour Trip</a></li>
<li><a href="https://www.youtube.com/@garsimusic/videos">Garsi</a></li>
<li><a href="https://www.youtube.com/@jabig/videos">Ja Big</a></li>
<li><a href="https://www.youtube.com/@johnny_m/videos">Johnny M (GR)</a></li>
<li><a href="https://www.youtube.com/@johnnymgrchannelc3145/videos">Johnny M (GR) (Channel C')</a></li>
<li><a href="https://www.youtube.com/@djmissmonique/videos">Miss Monique</a></li>
<li><a href="https://www.youtube.com/@DJRaphaelPPRV/videos">Raphael</a></li>
</ul>
<hr />
<ul>
<li><a href="http://radio.garden/visit/pessac">Garden</a></li>
</ul>
</section>
<!----------------------------------------------------------------------------->
<section id="pubnix">
{nav('pubnix')}
<ul>
<!--<li><a href="https://aussies.space/~mspe">aussies.space</a></li>-->
<li><a href="https://mspe.u.blinkenshell.org">blinkenshell.org</a></li>
<li><a href="https://ctrl-c.club/~mspe">ctrl-c.club</a></li>
<li><a href="https://mspe.dimension.sh">dimension.sh</a></li>
<li><a href="https://mspe.envs.net">envs.net</a></li>
<li><a href="https://freeshell.de/~mspe">freeshell.de</a></li>
<li><a href="https://heathens.club/~mspe">heathens.club</a></li>
<li><a href="https://mspe.insomnia247.nl">insomnia247.nl</a></li>
<li><a href="https://mspe.p.projectsegfau.lt">projectsegfau.lt</a></li>
<li><a href="https://sites.pubnix.pink/~mspe">pubnix.pink</a></li>
<li><a href="https://rawtext.club/~mspe">rawtext.club</a></li>
<li><a href="https://mspe.remotes.club">remotes.club</a></li>
<li><a href="https://rw.rs/~mspe">rw.rs</a></li>
<li><a href="https://squiggle.city/~mspe">squiggle.city</a></li>
<!--<li><a href="https://thunix.net/~mspe">thunix.net</a></li>-->
<li><a href="https://tilde.32bit.cafe/~mspe">tilde.32bit.cafe</a></li>
<li><a href="https://mspe.tilde.cafe">tilde.cafe</a></li>
<li><a href="https://tilde.club/~mspe">tilde.club</a></li>
<li><a href="https://tilde.fun/~mspe">tilde.fun</a></li>
<li><a href="https://tilde.green/~mspe">tilde.green</a></li>
<li><a href="https://tilde.guru/~mspe">tilde.guru</a></li>
<li><a href="https://mspe.tilde.institute">tilde.institute</a></li>
<li><a href="https://tilde.pink/~mspe">tilde.pink</a></li>
<li><a href="https://mspe.tilde.team">tilde.team</a></li>
<li><a href="https://tilde.town/~mspe">tilde.town</a></li>
<li><a href="https://mspe.tildevarsh.in">tildevarsh.in</a></li>
<li><a href="https://trash.town/~mspe">trash.town</a></li>
<li><a href="https://mspe.vern.cc">vern.cc</a></li>
</ul>
<hr />
<ul>
<li><a href="https://mspe.fr.tild3.org">fr.tild3.org</a></li>
<li><a href="https://mspe.hextilde.xyz">hextilde.xyz</a></li>
</ul>
</section>
<!----------------------------------------------------------------------------->
<section id="thesis">
{nav('thesis')}
<ul>
<li><a href="https://cnam.marc.beninca.link">CNAM</a></li>
</ul>
</section>
<!----------------------------------------------------------------------------->
<section id="vegan">
{nav('vegan')}
<ul>
<li><a href="https://www.youtube.com/@CheapLazyVegan/videos">Cheap Lazy Vegan</a></li>
<li><a href="https://www.youtube.com/@gazoakleychef/videos">Gaz Oakley</a></li>
<li><a href="https://www.youtube.com/@MerleONeal/videos">Merle O'Neal</a></li>
<li><a href="https://www.youtube.com/@peacefulcuisine/videos">Peaceful Cuisine</a></li>
<li><a href="https://www.youtube.com/@PickUpLimes/videos">Pick Up Limes</a></li>
<li><a href="https://www.youtube.com/@RainbowPlantLife/videos">Rainbow Plant Life</a></li>
<li><a href="https://www.youtube.com/@TheKoreanVegan/videos">The Korean Vegan</a></li>
<li><a href="https://www.youtube.com/@Thevietvegan/videos">The Viet Vegan</a></li>
<li><a href="https://www.youtube.com/@YEUNGMANCOOKING/videos">Yeung Man Cooking</a></li>
</ul>
<ul>
<li><a href="https://www.youtube.com/@SauceStache/videos">Sauce Stache</a></li>
<li><a href="https://www.youtube.com/@TheeBurgerDude/videos">Thee Burger Dude</a></li>
</ul>
<hr />
<ul>
<li><a href="https://www.youtube.com/@doucefrugalite/videos">Douce frugalité</a></li>
<li><a href="https://www.youtube.com/@Evalespetitsplats/videos">Eva les petits plats</a></li>
<li><a href="https://www.youtube.com/@LapetiteOkara/videos">La petite Okara</a></li>
<li><a href="https://www.youtube.com/@MarieSweetandSour/videos">Marie Sweet and Sour</a></li>
<li><a href="https://www.youtube.com/@SebastienKardinal/videos">Sébastien Kardinal</a></li>
</ul>
</section>
<!----------------------------------------------------------------------------->
<section id="others">
{nav('others')}
<ul>
<li><a href="https://bsky.app/profile/marc-beninca.bsky.social">Blue Sky</a></li>
<li><a href="https://buymeacoffee.com/marc.beninca">Buy Me A Coffee</a></li>
<li><a href="https://cohost.org/marc-beninca">CoHost</a></li>
<li><a href="https://dev.to/marc_beninca">Dev</a></li>
<li><a href="https://diaspora-fr.org/people/00f4f8e04b11013b46b20025900e4586">Diaspora</a></li>
<li><a href="https://flattr.com/@marc.beninca">Flattr</a></li>
<li><a href="https://giftapp.com/marc_beninca">GiftApp</a></li>
<li><a href="https://hashnode.com/@marc-beninca">HashNode</a></li>
<li><a href="https://medium.com/@marc-beninca">Medium</a></li>
<li><a href="https://marc-beninca.micro.blog/about">MicroBlog</a></li>
<li><a href="https://minds.com/marc_beninca">Minds</a></li>
<li><a href="https://odysee.com/@marc.beninca">Odysee</a></li>
<li><a href="https://paypal.me/MarcBeninca">PayPal</a></li>
<li><a href="https://peertube.iriseden.eu/a/marc_beninca">PeerTube</a></li>
<li><a href="https://pinterest.com/marc_beninca">Pinterest</a></li>
<li><a href="https://marcbeninca.podia.com">Podia</a></li>
<li><a href="https://app.revolt.chat/invite/01FREKCG3P2P0YMAHQSCPSW4GD">Revolt</a></li>
<li><a href="https://tiktok.com/@marc.beninca">TikTok</a></li>
<li><a href="https://twtxt.net/user/marc_beninca">YarnSocial</a></li>
</ul>
<hr />
<ul>
<li><a href="https://dlive.tv/marc.beninca">Dlive</a></li>
<li><a href="https://kick.com/marc_beninca">Kick</a></li>
</ul>
<hr />
<ul>
<li><a href="">KissBank</a></li>
</ul>
</section>
<!----------------------------------------------------------------------------->
</main></body></html>
'''
# {link_text}
with open(page_file, 'bw') as f:
f.write(page_text.encode('u8'))
if __name__ == '__main__':
main()