Skip to content

Commit

Permalink
Fix tutorials docs component (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
kooyunmo authored Aug 28, 2023
1 parent bda8393 commit 655e3a9
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 124 deletions.
19 changes: 16 additions & 3 deletions docs/docs/tutorials/intro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,22 @@
sidebar_position: 1
---

import {WebDevCardsRow} from '@site/src/components/WebDevCards';
import {CardView} from '@site/src/components/CardView';

# Welcome to PeriFlow Tutorials
# 📘 Welcome to PeriFlow Tutorials

<WebDevCardsRow />
In this tutorials, we'll guide you through the process of deploying your model using either **PeriFlow Container** or **PeriFlow Cloud**.
Depending on your preferences and requirements, you can choose the option that best suits your needs.

## Deploying with PeriFlow Container

If you opt for PeriFlow Container, our serving system comes packaged as a Docker image, simplifying the process of running PeriFlow within a containerized environment.
This allows you to deploy your model with PeriFlow in your own infrastructure.

## Deploying with PeriFlow Cloud

For those who prefer a more hands-off approach, we offer PeriFlow as a managed service through PeriFlow Cloud.
With this option, we take care of all the difficulties of serving your model.
You can focus on your application while we handle the complexities of deployment and maintenance.

<CardView />
File renamed without changes.
74 changes: 74 additions & 0 deletions docs/src/components/CardView/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import React from 'react';
import Link from '@docusaurus/Link';
import styles from './styles.module.css';
import {useColorMode} from '@docusaurus/theme-common';

import cloud_img from '@site/static/img/docs/tutorials/cloud.png';
import container_img from '@site/static/img/docs/tutorials/container.png';


const CardDatas = [
{
name: 'PeriFlow Cloud',
png: cloud_img,
url: {
page: 'cloud/how_to_use_your_checkpoint',
},
description: 'Use PeriFlow as a managed cloud service.'
},
{
name: 'PeriFlow Container',
png: container_img,
url: {
page: 'container/how_to_run_periflow_container',
},
description: 'Use PeriFlow in the form of a Docker image.'
},
];

interface CardProps {
name: string;
png: string;
url: {
page: string;
};
description: string;
}

const Card: React.FC<CardProps> = props => {
const {colorMode, setColorMode} = useColorMode();

return (
<div className="col col--6 margin-bottom--lg">
<div
className={`${styles.cardContainer} ${
colorMode === 'light' ? styles.cardContainerLight : styles.cardContainerDark
}`}
>
<Link to={props.url.page} style={{textDecoration: "none"}}>
<div className={styles.cardImage}>
<img src={props.png} className={styles.featurePng}/>
</div>
<div
className={`${styles.cardBody} ${
colorMode === 'light' ? styles.cardBodyLight : styles.cardBodyDark
}`}
>
<h3>{props.name}</h3>
<p>{props.description}</p>
</div>
</Link>
</div>
</div>
);
}

export function CardView(): JSX.Element {
return (
<div className="row">
{CardDatas.map((special) => (
<Card key={special.name} {...special} />
))}
</div>
);
}
53 changes: 53 additions & 0 deletions docs/src/components/CardView/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
.featurePng {
height: 90%;
width: 90%;
display: block;
margin: 1rem auto;
border-radius: 0.5rem;
}

.cardContainer {
max-width: 40rem;
max-height: 25rem;
border-radius: 0.3rem;
display: flex;
flex-direction: column;
overflow: hidden;
}

.cardContainerLight {
background-color: #ffffff;
box-shadow: 0.1rem 0.1rem 0.1rem 0.1rem #dceafb;
}

.cardContainerLight:hover {
background-color: #dceafb;
}

.cardContainerDark {
background-color: #282a36;
box-shadow: 0.1rem 0.1rem 0.1rem 0.1rem #3e4152;
}

.cardContainerDark:hover {
background-color: #3e4152;
}

.cardBody {
color: #000000;
padding: 1rem 2rem;
}

.cardBodyLight {
color: #000000;
padding: 1rem 2rem;
}

.cardBodyDark {
color: #ffffff;
padding: 1rem 2rem;
}

.cardImage {
padding-top: 0;
}
87 changes: 0 additions & 87 deletions docs/src/components/WebDevCards/index.tsx

This file was deleted.

34 changes: 0 additions & 34 deletions docs/src/components/WebDevCards/styles.module.css

This file was deleted.

0 comments on commit 655e3a9

Please sign in to comment.