Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ci:

compile-github:
rm -rf __webdir && \
cp -R ./examples/emi-web/build __webdir && touch __webdir/.nojekyll && \
cp -R ./examples/emi-web/dist __webdir && touch __webdir/.nojekyll && \
cp -R playground/dist __webdir/playground && \
cp -R examples/in-browser-server/browser __webdir/in-browser-server

Expand Down
9 changes: 4 additions & 5 deletions examples/emi-web/.gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Dependencies
/node_modules

# Production
/build
# Build output
/dist

# Generated files
.docusaurus
.cache-loader
# Astro generated files
.astro

# Misc
.DS_Store
Expand Down
41 changes: 25 additions & 16 deletions examples/emi-web/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,50 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
This website is built with [Astro](https://astro.build/) and the
[Starlight](https://starlight.astro.build/) documentation theme.

## Installation

```bash
yarn
npm install
```

## Local Development

```bash
yarn start
npm run dev
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
Starts a local dev server at `http://localhost:4321/emi/`. Most changes are
reflected live without restarting the server.

## Build

```bash
yarn build
npm run build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

## Deployment

Using SSH:
Generates the static site into the `dist/` directory, which can be served by
any static host.

```bash
USE_SSH=true yarn deploy
npm run preview
```

Not using SSH:
Locally previews the production build.

```bash
GIT_USER=<Your GitHub username> yarn deploy
```
## Project structure

- `src/content/docs/` — documentation pages (`.md` / `.mdx`).
- `src/components/` — React components used as islands inside MDX (e.g. the
object benchmark).
- `src/styles/custom.css` — brand theming via Starlight CSS variables.
- `public/` — static assets served at the site root.
- `astro.config.mjs` — site config, including the GitHub Pages `base` (`/emi`)
and the sidebar layout.

## Deployment

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.
The site is configured for GitHub Pages under the `/emi/` base path. Build with
`npm run build` and publish the `dist/` directory (e.g. via a GitHub Actions
Pages workflow).
56 changes: 56 additions & 0 deletions examples/emi-web/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// @ts-check
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import react from "@astrojs/react";

// https://astro.build/config
export default defineConfig({
// Production URL + base path for GitHub Pages (https://torabian.github.io/emi/)
site: "https://torabian.github.io/emi",
base: "/",

integrations: [
starlight({
title: "Emi",
tagline: "Emi compiler playground and documents",
favicon: "/img/favicon.ico",
logo: {
src: "./src/assets/logo.svg",
alt: "Emi",
},
customCss: ["./src/styles/custom.css"],
social: [
{
icon: "github",
label: "GitHub",
href: "https://github.com/torabian/emi",
},
],
// "Edit this page" links point at the source file in the repo.
editLink: {
baseUrl: "https://github.com/torabian/emi/edit/main/examples/emi-web/",
},
sidebar: [
{
label: "Playground",
link: "https://torabian.github.io/emi/playground",
attrs: { target: "_blank" },
},
{ label: "Motivation", slug: "intro" },
{ label: "Getting started", slug: "installation" },
{ label: "Emi definitions", slug: "emi-module-spec" },
{ label: "Emi Actions", slug: "emi-actions" },
{ label: "Complex Types", slug: "emi-complex-types" },
{
label: "Golang Compiler",
items: [{ autogenerate: { directory: "golang" } }],
},
{
label: "Javascript Compiler",
items: [{ autogenerate: { directory: "js" } }],
},
],
}),
react(),
],
});
52 changes: 0 additions & 52 deletions examples/emi-web/docs/emi-module-spec.mdx

This file was deleted.

4 changes: 0 additions & 4 deletions examples/emi-web/docs/golang/_category_.json

This file was deleted.

4 changes: 0 additions & 4 deletions examples/emi-web/docs/js/_category_.json

This file was deleted.

119 changes: 0 additions & 119 deletions examples/emi-web/docusaurus.config.ts

This file was deleted.

Loading
Loading