Skip to content

Commit

Permalink
feat: vitepress-docs (#1617)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGreatRefrigerator authored Nov 28, 2023
2 parents 292e59c + 98b2e07 commit 5cd3d30
Show file tree
Hide file tree
Showing 57 changed files with 1,902 additions and 552 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Sample workflow for building and deploying a VitePress site to GitHub Pages
#
name: Deploy Backend Documentation to Pages

on:
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
# using the `master` branch as the default branch.
push:
branches: [master]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
# - uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: npm # or pnpm / yarn
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Install dependencies
run: npm ci # or pnpm install / yarn install / bun install
- name: Build with VitePress
run: |
npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
touch docs/.vitepress/dist/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: docs/.vitepress/dist

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ target/
logs/
elevation-cache/
cgiar_cache/
node_modules/

# jqwik
.jqwik-database
Expand All @@ -22,3 +23,7 @@ ors-api/src/main/resources/ors-config*

envs/
ors-config-repo/

# docs stuff
docs/.vitepress/dist
docs/.vitepress/cache
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RELEASING:
- add .editorconfig to streamline IDE code styling ([#1493](https://github.com/GIScience/openrouteservice/pull/1493))
- info on duration format in parameter description ([#1504](https://github.com/GIScience/openrouteservice/pull/1504))
- YML configuration ([#1506](https://github.com/GIScience/openrouteservice/pull/1506))
- new backend documentation using VitePress([#1617](https://github.com/GIScience/openrouteservice/pull/1617))

### Changed
- include transfers and fare properties only in PT responses ([#1586](https://github.com/GIScience/openrouteservice/pull/1586))
Expand Down
122 changes: 122 additions & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import {defineConfig} from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "openrouteservice backend documentation",
description: "openrouteservice backend documentation",
base: "/openrouteservice/",
head: [['link', {rel: 'icon', href: '/openrouteservice/ors_fav.png'}]],
cleanUrls: true,
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
siteTitle: false,
logo: {
light: '/openrouteservice.png',
dark: '/openrouteservice_dark.png',
alt: 'openrouteservice logo'
},
search: {
provider: 'local'
},
outline: {
level: [2, 4]
},
lastUpdated: {
text: 'Updated at',
formatOptions: {
dateStyle: 'medium',
timeStyle: 'short'
}
},
editLink: {
pattern: 'https://github.com/GIScience/openrouteservice/issues/new?labels=documentation+%3Abook%3A&template=docs.yml',
text: 'Suggest an improvement'
},
nav: [
{text: 'Homepage', link: 'https://openrouteservice.org'},
{text: 'Forum', link: 'https://ask.openrouteservice.org'},
{text: 'API Playground', link: 'https://openrouteservice.org/dev/#/api-docs'},
],
sidebar: [
{
text: 'Home', link: '/',
items: [
{text: 'Getting Started', link: '/getting-started'},
{
text: 'Installation and Usage', collapsed: true, link: '/installation/Installation-and-Usage',
items: [
{text: 'Running with Docker', link: '/installation/Running-with-Docker'},
{text: 'Building from Source', link: '/installation/Building-from-Source'},
{text: 'System Requirements', link: '/installation/System-Requirements'},
{text: 'Configuration', link: '/installation/Configuration'},
{text: 'Advanced Docker Setup', link: '/installation/Advanced-Docker-Setup'},
{text: 'Backend Documentation', link: '/installation/Backend-Documentation'}
]
},
{text: 'Data', link: '/Data'},
{
text: 'Contributing', collapsed: true, link: '/contributing/Contributing',
items: [
{text: 'Contributing Translations', link: '/contributing/Contributing-Translations'}
]
},
{
text: 'Documentation', collapsed: true, link: '/documentation/Documentation',
items: [
{text: 'Tag Filtering', link: '/documentation/Tag-Filtering'},
{
text: 'Travel Speeds',
collapsed: true,
link: '/documentation/travel-speeds/Travel-Speeds',
items: [
{text: 'Waytype Speeds', link: '/documentation/travel-speeds/Waytype-Speeds'},
{text: 'Surface Speeds', link: '/documentation/travel-speeds/Surface-Speeds'},
{text: 'Tracktype Speeds', link: '/documentation/travel-speeds/Tracktype-Speeds'},
{text: 'Country Speeds', link: '/documentation/travel-speeds/Country-Speeds'}
]
},
{text: 'Route Attributes', link: '/documentation/Route-Attributes'},
{
text: 'Routing Options',
collapsed: true,
link: '/documentation/routing-options/Routing-Options',
items: [
{text: 'Examples', link: '/documentation/routing-options/Examples'},
{text: 'Country List', link: '/documentation/routing-options/Country-List'},
]
},
{text: 'Instruction Types', link: '/documentation/Instruction-Types'},
{
text: 'Extra Info', collapsed: true, link: '/documentation/extra-info/Extra-Info',
items: [
{text: 'Steepness', link: '/documentation/extra-info/Steepness'},
{text: 'Surface', link: '/documentation/extra-info/Surface'},
{text: 'Waycategory', link: '/documentation/extra-info/Waycategory'},
{text: 'Waytype', link: '/documentation/extra-info/Waytype'},
{text: 'Trail Difficulty', link: '/documentation/extra-info/Trail-Difficulty'},
{
text: 'Road Access Restrictions',
link: '/documentation/extra-info/Road-Access-Restrictions'
}
]
},
{text: 'Geometry Decoding', link: '/documentation/Geometry-Decoding'},
{text: 'Structured Geocoding Query', link: '/documentation/Structured-Geocoding-Query'},
{text: 'Matrix Response', link: '/documentation/Matrix-Response'},
{text: 'Places Request and Response', link: '/documentation/Places-Request-and-Response'},
{text: 'Geocoding Response', link: '/documentation/Geocoding-Response'},
{text: 'Error Codes', link: '/documentation/Error-Codes'},
]
},
{text: 'FAQ', link: '/Frequently-Asked-Questions'}
]
}
],
socialLinks: [
{icon: 'github', link: 'https://github.com/GIScience/openrouteservice'}
],
footer: {
message: '<a href="https://openrouteservice.org/">openrouteservice</a> is part of <a href="https://heigit.org/">HeiGIT gGmbH</a> and Universität Heidelberg <a href="https://www.geog.uni-heidelberg.de/gis/index_en.html">GIScience</a> research group. | <a href="https://heigit.org/imprint/">Imprint</a>'
}
}
})
26 changes: 26 additions & 0 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
:root {
--vp-c-brand-1: #b5152b;
--vp-button-brand-bg: #b5152b;
--vp-c-brand-2: #b5152b;
/* values below are taken from the old Jekyll installation of the docs */
--vp-font-family-base: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
--vp-font-family-mono: "SFMono-Regular",menlo,consolas,monospace;
}

.vp-doc h1, .vp-doc h2, .vp-doc h3, .vp-doc h4, .vp-doc h5, .vp-doc h6 {
font-weight: 300;
}

/*
//$body-font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
//$root-font-size: 14px; // Base font-size for rems
//$font-size-8: 28px; //h1
//
//$body-background-color: #fbfcfd;
//$code-background-color: #f7f7f7;
//
//$body-text-color: #5c5c5c;
//$link-color: #d60039;
//$border: 1px solid !default;
//$border-color: #cfcfcf;
*/
5 changes: 5 additions & 0 deletions docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// .vitepress/theme/index.js
import DefaultTheme from 'vitepress/theme-without-fonts'
import './custom.css'

export default DefaultTheme
6 changes: 0 additions & 6 deletions docs/Data.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
---
title: Data
nav_order: 3
has_toc: false
---

# Data
openrouteservice makes use of public opensource data. To generate the best routes, a number of different datasets are used.

Expand Down
12 changes: 2 additions & 10 deletions docs/Frequently-Asked-Questions.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
---
title: FAQ
nav_order: 6
has_toc: true
---

# Frequently Asked Questions
{: .no_toc }

1. TOC
{:toc}

---

## Why is my ors reporting `Could not find point`?

Expand All @@ -31,7 +23,7 @@ There are three main reasons for this problem, listed in order of most to least
road. The maximum distance for snapping to road segments in our API is 350m.
This can be customized for local installations via the
`maximum_snapping_radius` and `location_index_resolution` config-parameter. See
[configuration](Installation/Configuration) for details.
[configuration](installation/Configuration) for details.

3. The start and enpoint are passed with correct lon,lat-order and are within
350m of a routable road. This should only happen with a local installation.
Expand All @@ -58,7 +50,7 @@ be preprocessed before the openrouteservice can start building the graphs used
for routing.

The build process in itself is [rather
resource-intensive](Installation/System-Requirements). It takes roughly two
resource-intensive](installation/System-Requirements). It takes roughly two
days for any one of the nine profiles. For the mentioned resource requirements,
this means that it will take roughly a week for all profiles to be re-built.

Expand Down
3 changes: 0 additions & 3 deletions docs/_includes/footer_custom.html

This file was deleted.

5 changes: 0 additions & 5 deletions docs/_includes/header_custom.html

This file was deleted.

2 changes: 0 additions & 2 deletions docs/_sass/color_schemes/darkors.scss

This file was deleted.

Loading

0 comments on commit 5cd3d30

Please sign in to comment.