Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added initial documentation structure #40

Merged
merged 7 commits into from
Apr 15, 2024
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
56 changes: 56 additions & 0 deletions .github/workflows/doc-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Depoly docs to GitHub Pages
on:
push:
branches:
- main
paths:
- 'docs/**'
permissions:
contents: write
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:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name : Install dependencies
run: pip install mkdocs-material

- name: Build docs site
run: mkdocs build --verbose
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Binary file added docs/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/illustration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
14 changes: 14 additions & 0 deletions docs/getting-started/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Configuration

## Application configuration settings

### API end point
In order for PxWeb to display your statistics, you need to configure the URL to the root of PxWebApi 2.0

### Language settings
Is that fetched from the API?

### TODO other settings


## Application configuration settings
2 changes: 2 additions & 0 deletions docs/getting-started/contribute/add-translations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Add translations
Help us out adding translations to PxWeb.
2 changes: 2 additions & 0 deletions docs/getting-started/contribute/help-us-write-the-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Help us write the docs
With good documentation ...
4 changes: 4 additions & 0 deletions docs/getting-started/contribute/report-a-bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Report a bug
TODO: Add link to GitHub issues.

TODO: Security issues should be reported with GitHub ...
20 changes: 20 additions & 0 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Getting started
>Looking for existing PxWeb, PxWeb 2023 v1? Then head away to the official repository at [https://github.com/statisticssweden/PxWeb](https://github.com/statisticssweden/PxWeb)

## Installation
This version is still under development so there are no packaged version yet.
But you could always install it from source.

### Install from source
Make usre that you have NodeJS installed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo:

Suggested change
Make usre that you have NodeJS installed.
Make sure that you have NodeJS installed.


1. Clone the reposiory `git clone https://github.com/PxTools/PxWeb2.git`
2. Install dependencies `npm install`
3. Build the PxWeb with `npm run build`
4. Host the result of the builds on a web server of your choice

### Install from binaries
_TODO: Describe how to download from GitHub Releases the latest version._

### Install docker image
_TODO: Describe how to run the docker image._
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
template: home.html
title: Material for MkDocs
---

PxWeb

103 changes: 103 additions & 0 deletions docs/overrides/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<!--
Copyright (c) 2016-2024 Martin Donath <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
-->

{% extends "main.html" %}

<!-- Render hero under tabs -->
{% block tabs %}
{{ super() }}

<!-- Additional styles for landing page -->
<style>

/* Application header should be static for the landing page */
.md-header {
position: initial;
}

/* Remove spacing, as we cannot hide it completely */
.md-main__inner {
margin: 0;
}

/* Hide main content for now */
.md-content {
display: none;
}

/* Hide table of contents */
@media screen and (min-width: 60em) {
.md-sidebar--secondary {
display: none;
}
}

/* Hide navigation */
@media screen and (min-width: 76.25em) {
.md-sidebar--primary {
display: none;
}
}
</style>

<!-- Hero for landing page -->
<section class="mdx-container">
<div class="md-grid md-typeset">
<div class="mdx-hero">

<!-- Hero image -->
<!-- <div class="mdx-hero__image">
<img
src="assets/images/illustration.png"
alt=""
width="1659"
height="1200"
draggable="false"
>
</div> -->

<!-- Hero content -->
<div class="mdx-hero__content">
<h1>Make your statistics available quickly and easily</h1>
<p>{{ config.site_description }} Within minutes you will be able to display your tables to your users</p>
<a
href="{{ page.next_page.url | url }}"
title="{{ page.next_page.title | e }}"
class="md-button md-button--primary"
>
Quick start
</a>
</div>
</div>
</div>

<div class="md-grid md-typeset">
<h1></h1>
</div>
</section>
{% endblock %}

<!-- Content -->
{% block content %}{% endblock %}

<!-- Application footer -->
{% block footer %}{% endblock %}
56 changes: 56 additions & 0 deletions docs/overrides/partials/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{#-
This file was automatically generated - do not edit
-#}
<footer class="md-footer">
{% if "navigation.footer" in features %}
{% if page.previous_page or page.next_page %}
{% if page.meta and page.meta.hide %}
{% set hidden = "hidden" if "footer" in page.meta.hide %}
{% endif %}
<nav class="md-footer__inner md-grid" aria-label="{{ lang.t('footer') }}" {{ hidden }}>
{% if page.previous_page %}
{% set direction = lang.t("footer.previous") %}
<a href="{{ page.previous_page.url | url }}" class="md-footer__link md-footer__link--prev" aria-label="{{ direction }}: {{ page.previous_page.title | e }}">
<div class="md-footer__button md-icon">
{% set icon = config.theme.icon.previous or "material/arrow-left" %}
{% include ".icons/" ~ icon ~ ".svg" %}
</div>
<div class="md-footer__title">
<span class="md-footer__direction">
{{ direction }}
</span>
<div class="md-ellipsis">
{{ page.previous_page.title }}
</div>
</div>
</a>
{% endif %}
{% if page.next_page %}
{% set direction = lang.t("footer.next") %}
<a href="{{ page.next_page.url | url }}" class="md-footer__link md-footer__link--next" aria-label="{{ direction }}: {{ page.next_page.title | e }}">
<div class="md-footer__title">
<span class="md-footer__direction">
{{ direction }}
</span>
<div class="md-ellipsis">
{{ page.next_page.title }}
</div>
</div>
<div class="md-footer__button md-icon">
{% set icon = config.theme.icon.next or "material/arrow-right" %}
{% include ".icons/" ~ icon ~ ".svg" %}
</div>
</a>
{% endif %}
</nav>
{% endif %}
{% endif %}
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
{% include "partials/copyright.html" %}
{% if config.extra.social %}
{% include "partials/social.html" %}
{% endif %}
</div>
</div>
</footer>
77 changes: 77 additions & 0 deletions docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
.mdx-container {
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1123 258'><path d='M1124,2c0,0 0,256 0,256l-1125,0l0,-48c0,0 16,5 55,5c116,0 197,-92 325,-92c121,0 114,46 254,46c140,0 214,-167 572,-166Z' style='fill: hsla(0, 0%, 100%, 1)' /></svg>")
no-repeat bottom,
linear-gradient(
to bottom,
var(--md-primary-fg-color),
#a63fd9 99%,
var(--md-default-bg-color) 99%
);
padding-top: 1rem;
}
[data-md-color-scheme="slate"] .mdx-container {
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1123 258'><path d='M1124,2c0,0 0,256 0,256l-1125,0l0,-48c0,0 16,5 55,5c116,0 197,-92 325,-92c121,0 114,46 254,46c140,0 214,-167 572,-166Z' style='fill: hsla(230, 15%, 14%, 1)' /></svg>")
no-repeat bottom,
linear-gradient(
to bottom,
var(--md-primary-fg-color),
#363949 99%,
var(--md-default-bg-color) 99%
);
}
.mdx-hero {
color: var(--md-primary-bg-color);
margin: 0 0.8rem;
}
.mdx-hero h1 {
color: currentcolor;
font-weight: 700;
margin-bottom: 1rem;
}
@media screen and (max-width: 29.984375em) {
.mdx-hero h1 {
font-size: 1.4rem;
}
}
.mdx-hero__content {
padding-bottom: 6rem;
}
@media screen and (min-width: 60em) {
.mdx-hero {
align-items: stretch;
display: flex;
}
.mdx-hero__content {
margin-top: 3.5rem;
max-width: 19rem;
padding-bottom: 14vw;
}
.mdx-hero__image {
order: 1;
transform: translateX(4rem);
width: 38rem;
}
}
@media screen and (min-width: 76.25em) {
.mdx-hero__image {
transform: translateX(8rem);
}
}
.mdx-hero .md-button {
color: var(--md-primary-bg-color);
margin-right: 0.5rem;
margin-top: 0.5rem;
}
.mdx-hero .md-button:focus,
.mdx-hero .md-button:hover {
background-color: var(--md-accent-fg-color);
border-color: var(--md-accent-fg-color);
color: var(--md-accent-bg-color);
}
.mdx-hero .md-button--primary {
background-color: var(--md-primary-bg-color);
border-color: var(--md-primary-bg-color);
color: #894da8;
}


Loading
Loading