Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
3,143 additions
and
552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,6 @@ tsconfig.tsbuildinfo | |
knsv*.html | ||
local*.html | ||
stats/ | ||
|
||
**/user-avatars/* | ||
**/contributor-names.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
src/vitepress | ||
src/docs/config/setup | ||
README.* | ||
README.* | ||
src/docs/public/user-avatars/ | ||
src/docs/.vitepress/cache | ||
src/docs/.vitepress/components.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/mermaid/src/docs/.vitepress/components/Contributors.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script setup lang="ts"> | ||
import { contributors } from '../contributors'; | ||
</script> | ||
|
||
<template> | ||
<div flex="~ wrap gap2" justify-center> | ||
<a | ||
v-for="{ name, avatar } of contributors" | ||
:key="name" | ||
:href="`https://github.com/${name}`" | ||
m-0 | ||
rel="noopener noreferrer" | ||
:aria-label="`${name} on GitHub`" | ||
> | ||
<img | ||
loading="lazy" | ||
:src="avatar" | ||
width="50" | ||
height="50" | ||
rounded-full | ||
h-12 | ||
w-12 | ||
:alt="`${name}'s avatar`" | ||
/> | ||
</a> | ||
</div> | ||
</template> |
26 changes: 26 additions & 0 deletions
26
packages/mermaid/src/docs/.vitepress/components/HomePage.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<script setup lang="ts"> | ||
import { VPTeamMembers } from 'vitepress/theme'; | ||
import { teamMembers } from '../contributors'; | ||
</script> | ||
|
||
<template> | ||
<div class="content"> | ||
<div class="content-container"> | ||
<main class="main"> | ||
<div class="vp-doc" flex flex-col items-center mt-10> | ||
<h2 id="meet-the-team" op50 font-normal p="t-10 b-2">Meet The Team</h2> | ||
<div w-full p-10> | ||
<VPTeamMembers size="small" :members="teamMembers" /> | ||
</div> | ||
<h2 id="the-team" op50 font-normal pt-5 pb-2>Contributors</h2> | ||
<p text-lg max-w-200 text-center leading-7> | ||
<Contributors /> | ||
<br /> | ||
<a href="https://chat.vitest.dev" rel="noopener noreferrer">Join the community</a> and | ||
get involved! | ||
</p> | ||
</div> | ||
</main> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
import contributorUsernamesJson from './contributor-names.json'; | ||
|
||
export interface Contributor { | ||
name: string; | ||
avatar: string; | ||
} | ||
|
||
export interface SocialEntry { | ||
icon: string | { svg: string }; | ||
link: string; | ||
} | ||
|
||
export interface CoreTeam { | ||
name: string; | ||
// required to download avatars from GitHub | ||
github: string; | ||
avatar?: string; | ||
twitter?: string; | ||
mastodon?: string; | ||
sponsor?: string; | ||
website?: string; | ||
linkedIn?: string; | ||
title?: string; | ||
org?: string; | ||
desc?: string; | ||
links?: SocialEntry[]; | ||
} | ||
|
||
const contributorUsernames: string[] = contributorUsernamesJson; | ||
|
||
export const contributors = contributorUsernames.map((username) => { | ||
return { username, avatar: `/user-avatars/${username}.png` }; | ||
}); | ||
|
||
const websiteSVG = { | ||
svg: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-globe"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>', | ||
}; | ||
|
||
const createLinks = (tm: CoreTeam): CoreTeam => { | ||
tm.avatar = `/user-avatars/${tm.github}.png`; | ||
tm.links = [{ icon: 'github', link: `https://github.com/${tm.github}` }]; | ||
if (tm.mastodon) { | ||
tm.links.push({ icon: 'mastodon', link: tm.mastodon }); | ||
} | ||
if (tm.twitter) { | ||
tm.links.push({ icon: 'twitter', link: `https://twitter.com/${tm.twitter}` }); | ||
} | ||
if (tm.website) { | ||
tm.links.push({ icon: websiteSVG, link: tm.website }); | ||
} | ||
if (tm.linkedIn) { | ||
tm.links.push({ icon: 'linkedin', link: `https://www.linkedin.com/in/${tm.linkedIn}` }); | ||
} | ||
return tm; | ||
}; | ||
|
||
const knut: CoreTeam = { | ||
github: 'knsv', | ||
name: 'Knut Sveidqvist', | ||
title: 'Creator', | ||
twitter: 'knutsveidqvist', | ||
sponsor: 'https://github.com/sponsors/knsv', | ||
}; | ||
|
||
const plainTeamMembers: CoreTeam[] = [ | ||
{ | ||
github: 'NeilCuzon', | ||
name: 'Neil Cuzon', | ||
title: 'Developer', | ||
}, | ||
{ | ||
github: 'tylerlong', | ||
name: 'Tyler Liu', | ||
title: 'Developer', | ||
}, | ||
{ | ||
github: 'sidharthv96', | ||
name: 'Sidharth Vinod', | ||
title: 'Developer', | ||
twitter: 'sidv42', | ||
mastodon: 'https://techhub.social/@sidv', | ||
sponsor: 'https://github.com/sponsors/sidharthv96', | ||
linkedIn: 'sidharth-vinod', | ||
website: 'https://sidharth.dev', | ||
}, | ||
{ | ||
github: 'ashishjain0512', | ||
name: 'Ashish Jain', | ||
title: 'Developer', | ||
}, | ||
{ | ||
github: 'mmorel-35', | ||
name: 'Matthieu Morel', | ||
title: 'Developer', | ||
linkedIn: 'matthieumorel35', | ||
}, | ||
{ | ||
github: 'aloisklink', | ||
name: 'Alois Klink', | ||
title: 'Developer', | ||
linkedIn: 'aloisklink', | ||
website: 'https://aloisklink.com', | ||
}, | ||
{ | ||
github: 'pbrolin47', | ||
name: 'Per Brolin', | ||
title: 'Developer', | ||
}, | ||
{ | ||
github: 'Yash-Singh1', | ||
name: 'Yash Singh', | ||
title: 'Developer', | ||
}, | ||
{ | ||
github: 'GDFaber', | ||
name: 'Marc Faber', | ||
title: 'Developer', | ||
linkedIn: 'marc-faber', | ||
}, | ||
{ | ||
github: 'MindaugasLaganeckas', | ||
name: 'Mindaugas Laganeckas', | ||
title: 'Developer', | ||
}, | ||
{ | ||
github: 'jgreywolf', | ||
name: 'Justin Greywolf', | ||
title: 'Developer', | ||
}, | ||
{ | ||
github: 'IOrlandoni', | ||
name: 'Nacho Orlandoni', | ||
title: 'Developer', | ||
}, | ||
{ | ||
github: 'huynhicode', | ||
name: 'Steph Huynh', | ||
title: 'Developer', | ||
}, | ||
]; | ||
|
||
const teamMembers = plainTeamMembers.map((tm) => createLinks(tm)); | ||
teamMembers.sort( | ||
(a, b) => contributorUsernames.indexOf(a.github) - contributorUsernames.indexOf(b.github) | ||
); | ||
teamMembers.unshift(createLinks(knut)); | ||
|
||
export { teamMembers }; |
33 changes: 33 additions & 0 deletions
33
packages/mermaid/src/docs/.vitepress/scripts/fetch-avatars.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { mkdir, writeFile, readFile } from 'node:fs/promises'; | ||
import { existsSync } from 'node:fs'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
const pathContributors = new URL('../contributor-names.json', import.meta.url); | ||
const getAvatarPath = (name: string) => | ||
new URL(`../../public/user-avatars/${name}.png`, import.meta.url); | ||
|
||
let contributors: string[] = []; | ||
|
||
async function download(url: string, fileName: URL) { | ||
if (existsSync(fileName)) { | ||
return; | ||
} | ||
// eslint-disable-next-line no-console | ||
console.log('downloading', fileName); | ||
try { | ||
const image = await fetch(url); | ||
await writeFile(fileName, Buffer.from(await image.arrayBuffer())); | ||
} catch {} | ||
} | ||
|
||
async function fetchAvatars() { | ||
await mkdir(fileURLToPath(new URL('..', getAvatarPath('none'))), { recursive: true }); | ||
contributors = JSON.parse(await readFile(pathContributors, { encoding: 'utf-8' })); | ||
await Promise.allSettled( | ||
contributors.map((name) => | ||
download(`https://github.com/${name}.png?size=100`, getAvatarPath(name)) | ||
) | ||
); | ||
} | ||
|
||
fetchAvatars(); |
Oops, something went wrong.