Skip to content

Commit

Permalink
Website for Theia Trace Extension documentation
Browse files Browse the repository at this point in the history
Adds a website in the "doc" folder to hold the documentation for Theia
Trace Extension.

Website built with [Svelte Kit](https://kit.svelte.dev).

This PR replaces #776, which accomplishes the same goal but uses
GatsbyJS. The proposal to replace Gatsby with Svelte aims at reducing
the code base and adopting more modern solutions for the problem of
rendering static documentation sites.

Signed-off-by: Rodrigo Pinto (rodrigo.pinto@calian.ca)
  • Loading branch information
Rodrigoplp-work committed Dec 21, 2022
1 parent 0e40ac1 commit bf2a264
Show file tree
Hide file tree
Showing 15 changed files with 1,331 additions and 0 deletions.
13 changes: 13 additions & 0 deletions doc/web-doc/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
15 changes: 15 additions & 0 deletions doc/web-doc/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
root: true,
extends: ['eslint:recommended', 'prettier'],
plugins: ['svelte3'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
},
env: {
browser: true,
es2017: true,
node: true
}
};
10 changes: 10 additions & 0 deletions doc/web-doc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
13 changes: 13 additions & 0 deletions doc/web-doc/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
9 changes: 9 additions & 0 deletions doc/web-doc/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
37 changes: 37 additions & 0 deletions doc/web-doc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Documentation framework for Theia Trace Extension

## Installation

Requirements: NodeJS version 16 or above.

```bash
cd doc/web-doc
yarn
```

Run site

```bash
yarn dev

# or start the server and open the app in a new browser tab
yarn dev --open
```

The site will be running at `http://localhost:5173`.

## Code style

Run Prettier from the root.

Check code style:

yarn lint

Fix code style:

yarn format

## Development

Website created with [SvelteKit](https://kit.svelte.dev)
24 changes: 24 additions & 0 deletions doc/web-doc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "web-doc",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write ."
},
"devDependencies": {
"@sveltejs/adapter-auto": "^1.0.0",
"@sveltejs/kit": "^1.0.0",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-svelte3": "^4.0.0",
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.8.1",
"svelte": "^3.54.0",
"vite": "^4.0.0"
},
"type": "module"
}
12 changes: 12 additions & 0 deletions doc/web-doc/src/app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
72 changes: 72 additions & 0 deletions doc/web-doc/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<script>
import Header from '$lib/components/Header.svelte';
import Sidebar from '$lib/components/Sidebar.svelte';
</script>

<div class="app">
<Header />

<main>
<div class="content">
<Sidebar />
<div class="inner-page">
<slot />
</div>
</div>
</main>

<footer>
<p>
<a href="https://github.com/eclipse-cdt-cloud/theia-trace-extension">Theia Trace Extension</a>
</p>
</footer>
</div>

<style>
.app {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.content {
flex: 1;
display: flex;
flex-direction: row;
}
main {
flex: 1;
display: flex;
flex-direction: column;
padding: 1rem;
width: 100%;
max-width: 64rem;
margin: 0 auto;
box-sizing: border-box;
}
.inner-page {
flex: 1;
display: flex;
flex-direction: column;
}
footer {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 12px;
}
footer a {
font-weight: bold;
}
@media (min-width: 480px) {
footer {
padding: 12px 0;
}
}
</style>
18 changes: 18 additions & 0 deletions doc/web-doc/src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script>
import tteImage from '$lib/images/theia-trace-extension-0.0.3.png';
</script>

<div class="content">
<h1>Welcome to Theia Trace Extension</h1>
<img src={tteImage} alt="Trace Compass" />
</div>

<style>
.content {
text-align: center;
}
img {
width: 40em;
}
</style>
10 changes: 10 additions & 0 deletions doc/web-doc/src/routes/about/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<svelte:head>
<title>About</title>
<meta name="description" content="About this app" />
</svelte:head>

<div class="text-column">
<h1>About Theia Trace Extension</h1>

<p>About Theia Trace Extension</p>
</div>
Binary file added doc/web-doc/static/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions doc/web-doc/svelte.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import adapter from '@sveltejs/adapter-auto';

/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
adapter: adapter()
}
};

export default config;
8 changes: 8 additions & 0 deletions doc/web-doc/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { sveltekit } from '@sveltejs/kit/vite';

/** @type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit()]
};

export default config;
Loading

0 comments on commit bf2a264

Please sign in to comment.