-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scaffolded website using Docusaurus.
- Loading branch information
0 parents
commit 64c62ac
Showing
18 changed files
with
8,172 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Editor configuration | ||
/.vscode | ||
/.idea | ||
|
||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
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,9 @@ | ||
{ | ||
"line-length": false, | ||
"single-h1": { | ||
"level": 1, | ||
// Allow a separate "title" property in the front matter | ||
// The "title" property is used for the HTML page title | ||
"front_matter_title": "" | ||
} | ||
} |
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,44 @@ | ||
<!-- markdownlint-disable-file header-increment --> | ||
# Source Academy Documentation | ||
|
||
> Centralised documentation for Source Academy. | ||
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. | ||
|
||
### Installation | ||
|
||
```bash | ||
yarn | ||
``` | ||
|
||
### Local Development | ||
|
||
```bash | ||
yarn start | ||
``` | ||
|
||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
### Build | ||
|
||
```bash | ||
yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
### Deployment | ||
|
||
Using SSH: | ||
|
||
```bash | ||
USE_SSH=true yarn deploy | ||
``` | ||
|
||
Not using SSH: | ||
|
||
```bash | ||
GIT_USER=<Your GitHub username> yarn deploy | ||
``` | ||
|
||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
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,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
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,16 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Start Here | ||
|
||
This document shows you how to navigate this site. | ||
|
||
## Documentation Structure | ||
|
||
:::info | ||
|
||
<!-- TODO: --> | ||
_**Coming Soon!**_ | ||
|
||
::: |
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,158 @@ | ||
// @ts-check | ||
// Note: type annotations allow type checking and IDEs autocompletion | ||
|
||
const lightCodeTheme = require("prism-react-renderer/themes/github"); | ||
const darkCodeTheme = require("prism-react-renderer/themes/dracula"); | ||
|
||
/** @type {import('@docusaurus/types').Config} */ | ||
const config = { | ||
title: "Source Academy Documentation", | ||
tagline: "Documentation for Source Academy", | ||
favicon: "img/sourcepower.ico", | ||
|
||
// Set the production url of your site here | ||
url: "https://docs2.sourceacademy.org", | ||
// Set the /<baseUrl>/ pathname under which your site is served | ||
// For GitHub pages deployment, it is often '/<projectName>/' | ||
baseUrl: "/", | ||
|
||
// GitHub pages deployment config. | ||
// If you aren't using GitHub pages, you don't need these. | ||
organizationName: "source-academy", // Usually your GitHub org/user name. | ||
projectName: "documentation", // Usually your repo name. | ||
|
||
onBrokenLinks: "throw", | ||
onBrokenMarkdownLinks: "warn", | ||
|
||
// Even if you don't use internalization, you can use this field to set useful | ||
// metadata like html lang. For example, if your site is Chinese, you may want | ||
// to replace "en" with "zh-Hans". | ||
i18n: { | ||
defaultLocale: "en", | ||
locales: ["en"], | ||
}, | ||
|
||
presets: [ | ||
[ | ||
"classic", | ||
/** @type {import('@docusaurus/preset-classic').Options} */ | ||
({ | ||
docs: { | ||
sidebarPath: require.resolve("./sidebars.js"), | ||
// Please change this to your repo. | ||
// Remove this to remove the "edit this page" links. | ||
editUrl: "https://github.com/source-academy/documentation/", | ||
}, | ||
blog: false, | ||
// blog: { | ||
// showReadingTime: true, | ||
// // Please change this to your repo. | ||
// // Remove this to remove the "edit this page" links. | ||
// editUrl: "https://github.com/source-academy/documentation/", | ||
// }, | ||
theme: { | ||
customCss: require.resolve("./src/css/custom.css"), | ||
}, | ||
}), | ||
], | ||
], | ||
|
||
themeConfig: | ||
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */ | ||
({ | ||
// Replace with your project's social card | ||
image: undefined, | ||
navbar: { | ||
title: "Source Academy Documentation", | ||
logo: { | ||
alt: "Source Academy Logo", | ||
src: "img/sourcepower.ico", | ||
}, | ||
items: [ | ||
{ | ||
type: "docSidebar", | ||
sidebarId: "docs", | ||
position: "left", | ||
label: "Docs", | ||
}, | ||
{ | ||
to: "/about", | ||
position: "left", | ||
label: "About", | ||
}, | ||
{ | ||
href: "https://github.com/source-academy", | ||
label: "GitHub", | ||
position: "right", | ||
}, | ||
], | ||
}, | ||
footer: { | ||
style: "dark", | ||
links: [ | ||
{ | ||
title: "Main Docs", | ||
items: [ | ||
{ | ||
label: "General", | ||
href: "https://about.sourceacademy.org", | ||
}, | ||
{ | ||
label: "Modules", | ||
href: "https://source-academy.github.io/modules/documentation/", | ||
}, | ||
{ | ||
label: "js-slang", | ||
href: "https://docs.sourceacademy.org", | ||
}, | ||
], | ||
}, | ||
{ | ||
title: "Other Docs", | ||
items: [ | ||
// Taken from https://github.com/source-academy/js-slang/blob/master/scripts/jsdoc.sh | ||
"Auxiliary", | ||
"Misc", | ||
"Math", | ||
"Lists", | ||
"Streams", | ||
"Arrays", | ||
"Pairmutators", | ||
"Concurrency", | ||
"Non-det", | ||
"MCE", | ||
"Runes", | ||
"Curves", | ||
"Sounds", | ||
"Binarytrees", | ||
"PixNFlix", | ||
"Game", | ||
"EV3", | ||
["External Libraries", "External libraries"], | ||
].map((item) => ({ | ||
label: Array.isArray(item) ? item[0] : item, | ||
href: `https://docs.sourceacademy.org/${ | ||
Array.isArray(item) ? item[1] : item.toUpperCase() | ||
}/`, | ||
})), | ||
}, | ||
{ | ||
title: "Community", | ||
items: [ | ||
{ | ||
label: "GitHub", | ||
href: "https://github.com/source-academy", | ||
}, | ||
], | ||
}, | ||
], | ||
copyright: `Copyright © ${new Date().getFullYear()} Source Academy. Built with Docusaurus.`, | ||
}, | ||
prism: { | ||
theme: lightCodeTheme, | ||
darkTheme: darkCodeTheme, | ||
}, | ||
}), | ||
}; | ||
|
||
module.exports = config; |
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,46 @@ | ||
{ | ||
"name": "documentation", | ||
"version": "0.0.0", | ||
"private": true, | ||
"scripts": { | ||
"docusaurus": "docusaurus", | ||
"start": "docusaurus start", | ||
"build": "docusaurus build", | ||
"swizzle": "docusaurus swizzle", | ||
"deploy": "docusaurus deploy", | ||
"clear": "docusaurus clear", | ||
"serve": "docusaurus serve", | ||
"write-translations": "docusaurus write-translations", | ||
"write-heading-ids": "docusaurus write-heading-ids", | ||
"typecheck": "tsc" | ||
}, | ||
"dependencies": { | ||
"@docusaurus/core": "2.4.1", | ||
"@docusaurus/preset-classic": "2.4.1", | ||
"@mdx-js/react": "^1.6.22", | ||
"clsx": "^1.2.1", | ||
"prism-react-renderer": "^1.3.5", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2" | ||
}, | ||
"devDependencies": { | ||
"@docusaurus/module-type-aliases": "2.4.1", | ||
"@tsconfig/docusaurus": "^1.0.5", | ||
"typescript": "^4.7.4" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.5%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"engines": { | ||
"node": ">=16.14" | ||
} | ||
} |
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 @@ | ||
/** | ||
* Creating a sidebar enables you to: | ||
- create an ordered group of docs | ||
- render a sidebar for each doc of that group | ||
- provide next/previous navigation | ||
The sidebars can be generated from the filesystem, or explicitly defined here. | ||
Create as many sidebars as you want. | ||
*/ | ||
|
||
// @ts-check | ||
|
||
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ | ||
const sidebars = { | ||
// By default, Docusaurus generates a sidebar from the docs folder structure | ||
docs: [{ type: "autogenerated", dirName: "." }], | ||
|
||
// But you can create a sidebar manually | ||
/* | ||
tutorialSidebar: [ | ||
'intro', | ||
'hello', | ||
{ | ||
type: 'category', | ||
label: 'Tutorial', | ||
items: ['tutorial-basics/create-a-document'], | ||
}, | ||
], | ||
*/ | ||
}; | ||
|
||
module.exports = sidebars; |
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,49 @@ | ||
import clsx from "clsx"; | ||
import React from "react"; | ||
import styles from "./styles.module.css"; | ||
|
||
type FeatureItem = { | ||
title: string; | ||
// TODO: Remove if not needed. Left here as example. | ||
// Svg: React.ComponentType<React.ComponentProps<'svg'>>; | ||
description: JSX.Element; | ||
}; | ||
|
||
const FeatureList: FeatureItem[] = [ | ||
{ | ||
title: "This site is under construction!", | ||
// TODO: Remove if not needed. Left here as example. | ||
// Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, | ||
description: ( | ||
<> | ||
For the full list of currently available documentation, please refer to | ||
the external links found in the footer of this website. | ||
</> | ||
), | ||
}, | ||
]; | ||
|
||
function Feature({ title, description }: FeatureItem) { | ||
return ( | ||
<div className={clsx("col col--12")}> | ||
<div className="text--center padding-horiz--md"> | ||
<h3>{title}</h3> | ||
<p>{description}</p> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default function HomepageFeatures(): JSX.Element { | ||
return ( | ||
<section className={styles.features}> | ||
<div className="container"> | ||
<div className="row"> | ||
{FeatureList.map((props, idx) => ( | ||
<Feature key={idx} {...props} /> | ||
))} | ||
</div> | ||
</div> | ||
</section> | ||
); | ||
} |
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,6 @@ | ||
.features { | ||
display: flex; | ||
align-items: center; | ||
padding: 2rem 0; | ||
width: 100%; | ||
} |
Oops, something went wrong.