Skip to content

Commit

Permalink
Merge branch 'add-vuepress-action-with-root-directory-as-docs-directo…
Browse files Browse the repository at this point in the history
…ry' of github.com:Ocelot-Social-Community/Ocelot-Social into 6866-remove-temp-(x.)ocelot.social-links

# Conflicts:
#	README.md
  • Loading branch information
Tirokk committed Nov 29, 2023
2 parents 5da7168 + 45ea992 commit 1d1bf91
Show file tree
Hide file tree
Showing 26 changed files with 20,001 additions and 431 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/check-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Remove old documentation files
run: rm -rf ./deployment/src/old/ # workaround until https://github.com/gaurav-nelson/github-action-markdown-link-check/pull/183 has been done
- name: Check Markdown Links
uses: gaurav-nelson/github-action-markdown-link-check@master
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'no'
# at any .md file change take the chance to check the links in all .md files
check-modified-files-only: 'no'
config-file: '.github/workflows/mlc_config.json'
base-branch: 'master'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mlc_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"retryOn429": true,
"retryCount": 2,
"fallbackRetryDelay": "30s",
"aliveStatusCodes": [200, 206],
"aliveStatusCodes": [200, 206, 303, 403],
"ignorePatterns": [
{
"pattern": "^(https:\/\/github.com\/Ocelot-Social-Community\/Ocelot-Social\/pull\/|http:\/\/localhost)"
Expand Down
11 changes: 11 additions & 0 deletions .vuepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineUserConfig } from 'vuepress'
import meta from './config/meta'
import theme from './config/theme'
import plugins from './config/plugins'

export default defineUserConfig({
pagePatterns: ['**/*.md', '!.vuepress', '!node_modules', '!backend/node_modules', '!webapp/node_modules', '!deployment/src/old'],
...meta,
theme,
plugins,
})
8 changes: 8 additions & 0 deletions .vuepress/config/meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
base: '/',
title: 'Ocelot.Social Documentation',
description: 'Ocelot.Social Documentation',
head: [
['meta', {name: 'viewport', content: 'width=device-width,initial-scale=1'}],
],
}
18 changes: 18 additions & 0 deletions .vuepress/config/plugins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { searchProPlugin } from 'vuepress-plugin-search-pro'

export default [
searchProPlugin({
indexContent: true,
autoSuggestions: true,
customFields: [
{
getter: (page) => page.frontmatter.category,
formatter: "Category: $content",
},
{
getter: (page) => page.frontmatter.tag,
formatter: "Tag: $content",
},
],
})
]
82 changes: 82 additions & 0 deletions .vuepress/config/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import path from 'path'
import fs from 'fs'
import { hopeTheme } from 'vuepress-theme-hope'

export default hopeTheme({
favicon: 'favicon.ico',
logo: '/logo.svg',
docsRepo: 'https://github.com/Ocelot-Social-Community/Ocelot-Social',
docsBranch: 'master',
docsDir: '.',
editLink: true,
lastUpdated: false,
contributors: false,
print: false,
pure: true,
displayFooter: true,
footer: 'CC BY busFaktor() e.V. & Authors',
sidebar: generateSidebar('../../SUMMARY.md'),
navbar: [
{ text: 'Home', link: '/' },
{
text: 'Github',
link: 'https://github.com/Ocelot-Social-Community/Ocelot-Social'
},
],
plugins: {
mdEnhance: {
tabs: true,
imgSize: true
}
}
})

function generateSidebar(summaryFileName) {
const summaryFile = path.resolve(__dirname, summaryFileName)

try {
return getSummaryData(summaryFile)
} catch (err) {
console.error(`Error generating sidebar from file ${summaryFileName}:`, err)
process.exit(1)
}
}

function getSummaryData(file) {
const lines = fs.readFileSync(file, 'utf8').split('\n')
const sidebarStructure = []
let currentParent = null

lines.forEach((line, i) => {
const level = line.search(/\S|$/) / 2
const match = line.match(/^\s*\*\s*\[([^\]]+)\]\(([^)]+)\)/)

if (match) {
const newEntry = { text: match[1], link: `/${match[2]}`, children: [] }
if (level === 0) {
sidebarStructure.push(newEntry)
currentParent = sidebarStructure[sidebarStructure.length - 1]
} else {
let parent = currentParent

for (let i = 1; i < level; i++) {
parent = parent.children[parent.children.length - 1]
}

parent.children.push(newEntry)
}
}
})

sidebarStructure.forEach(removeEmptyArrays)
return sidebarStructure
}

function removeEmptyArrays(item) {
if (item.children && item.children.length === 0) {
delete item.children;
} else if (item.children) {
item.children.forEach(removeEmptyArrays);
}
}

Binary file added .vuepress/public/favicon.ico
Binary file not shown.
65 changes: 65 additions & 0 deletions .vuepress/public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Thank you so much for thinking of contributing to the <!-- [ -->ocelot.social<!-

## Getting Set Up

Instructions for how to install all the necessary software and some code guidelines can be found in our main [Readme](/README.md) or in our [documentation](/SUMMARY.md).
Instructions for how to install all the necessary software and some code guidelines can be found in our main [Readme](https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/master/README.md) or in our [documentation](https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/master/SUMMARY.md).

To get you started we recommend that you join forces with a regular contributor. Please join [our Discord instance](https://discord.gg/AJSX9DCSUA) to chat with developers or just get in touch directly on an issue on either [Github](https://github.com/Ocelot-Social-Community/Ocelot-Social/issues) or [Zenhub](https://app.zenhub.com/workspaces/ocelotsocial-5fb21ff922cb410015dd6535/board?filterLogic=any&repos=301151089):

Expand Down Expand Up @@ -36,7 +36,7 @@ Every pull request needs to:

## Contribution Flow For Open Source Contributors

See [contributing in main README.md](/README.md#contributing)
See [contributing in main README.md](https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/master/README.md#contributing)

## The Team

Expand All @@ -48,6 +48,9 @@ You can talk to our core team on [Discord](https://discord.gg/AJSX9DCSUA). And o
* Moriz (@Mogge)
* Wolle (@Tirokk)
* Alex (@ogerly)
* Hannes (@elweyn5803)
* Mathias (@mahula)
* Markus (@maeckes#1133)

<!-- * Robert (@roschaefer)
* Matt (@mattwr18)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status Test](https://github.com/Ocelot-Social-Community/Ocelot-Social/actions/workflows/test.yml/badge.svg)](https://github.com/Ocelot-Social-Community/Ocelot-Social/actions)
[![Build Status Publish](https://github.com/Ocelot-Social-Community/Ocelot-Social/actions/workflows/publish.yml/badge.svg)](https://github.com/Ocelot-Social-Community/Ocelot-Social/actions)
[![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/LICENSE.md)
[![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/master/LICENSE.md)
[![Discord Channel](https://img.shields.io/discord/489522408076738561.svg)](https://discord.gg/AJSX9DCSUA)
[![Open Source Helpers](https://www.codetriage.com/ocelot-social-community/ocelot-social/badges/users.svg)](https://www.codetriage.com/ocelot-social-community/ocelot-social)

Expand All @@ -11,7 +11,7 @@
<!-- markdownlint-disable MD033 -->
<p align="center">
<!-- <a href="https://ocelot.social" target="_blank"> -->
<img src="webapp/static/img/custom/logo-squared.svg" alt="ocelot.social" width="40%" height="40%">
<img src="https://raw.githubusercontent.com/Ocelot-Social-Community/Ocelot-Social/master/webapp/static/img/custom/logo-squared.svg" alt="ocelot.social" width="40%" height="40%">
<!-- </a> -->
</p>
<!-- markdownlint-enable MD033 -->
Expand Down Expand Up @@ -75,7 +75,7 @@ If you're wondering how you could help, there are plenty of ways, e.g.:
- Promote it on your social networks.
- Tell your friends about it by word-of-mouth.
- Write a press article on ocelot.social or contact the editorial office of your local news page or radio station.
- Take a [good first issue](https://github.com/Ocelot-Social-Community/Ocelot-Social/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) or issues that need help. Make sure to read [CONTRIBUTING.md](/CONTRIBUTING.md) first though.
- Take a [good first issue](https://github.com/Ocelot-Social-Community/Ocelot-Social/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) or issues that need help. Make sure to read [CONTRIBUTING.md](./CONTRIBUTING.md) first though.
- Testing and [reporting](https://github.com/Ocelot-Social-Community/Ocelot-Social/issues/new/choose) bugs.
- Translating: Please [contact us](#contact).
- Reviewing and testing pull requests.
Expand Down Expand Up @@ -251,7 +251,7 @@ $ yarn locales --fix
$ yarn test
```

Check out our [contribution guideline](./CONTRIBUTING.md), too!
Check out our [contribution guideline](https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/master/CONTRIBUTING.md), too!

#### Developer Chat

Expand Down Expand Up @@ -305,7 +305,7 @@ Locale Icons made by [Freepik](http://www.freepik.com/) from [www.flaticon.com](
Browser compatibility testing with [BrowserStack](https://www.browserstack.com/).

<!-- markdownlint-disable MD033 -->
<img alt="BrowserStack Logo" src=".gitbook/assets/browserstack-logo.svg" width="256">
<img alt="BrowserStack Logo" src="https://raw.githubusercontent.com/Ocelot-Social-Community/Ocelot-Social/master/.gitbook/assets/browserstack-logo.svg" width="256">
<!-- markdownlint-enable MD033 -->

### License
Expand Down
2 changes: 1 addition & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Table of contents

* [Introduction](README.md)
* [Edit this Documentation](edit-this-documentation.md)
* [Neo4J](neo4j/README.md)
* [Backend](backend/README.md)
* [GraphQL](backend/graphql.md)
Expand All @@ -19,4 +18,5 @@
* [Contributing](CONTRIBUTING.md)
* [Feature Specification](cypress/features.md)
* [Code of Conduct](CODE_OF_CONDUCT.md)
* [Documentation](documentation.md)
* [License](LICENSE.md)
41 changes: 16 additions & 25 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ More details about our GraphQL playground and how to use it with ocelot.social c

Database indexes and constraints need to be created and upgraded when the database and the backend are running:

{% tabs %}
{% tab title="Docker" %}
::: tabs
@tab:active Docker

```bash
# in main folder while docker-compose is running
Expand All @@ -102,8 +102,7 @@ $ docker compose exec backend /bin/sh -c "yarn prod:migrate init"
$ docker exec backend yarn run db:migrate up
```

{% endtab %}
{% tab title="Without Docker" %}
@tab Without Docker

```bash
# in folder backend/ while database is running
Expand All @@ -116,16 +115,15 @@ yarn run db:migrate init
yarn run db:migrate up
```

{% endtab %}
{% endtabs %}
:::

#### Seed Database

If you want your backend to return anything else than an empty response, you
need to seed your database:

{% tabs %}
{% tab title="Docker" %}
::: tabs
@tab:active Docker

In another terminal run:

Expand All @@ -147,8 +145,7 @@ $ docker exec backend yarn run db:migrate init
$ docker exec backend yarn run db:migrate up
```

{% endtab %}
{% tab title="Without Docker" %}
@tab Without Docker

Run:

Expand All @@ -164,16 +161,15 @@ To reset the database run:
$ yarn run db:reset
```

{% endtab %}
{% endtabs %}
:::

### Data migrations

Although Neo4J is schema-less,you might find yourself in a situation in which
you have to migrate your data e.g. because your data modeling has changed.

{% tabs %}
{% tab title="Docker" %}
::: tabs
@tab:active Docker

Generate a data migration file:

Expand All @@ -190,8 +186,7 @@ To run the migration:
$ docker exec backend yarn run db:migrate up
```

{% endtab %}
{% tab title="Without Docker" %}
@tab Without Docker

Generate a data migration file:

Expand All @@ -208,16 +203,15 @@ To run the migration:
$ yarn run db:migrate up
```

{% endtab %}
{% endtabs %}
:::

## Testing

**Beware**: We have no multiple database setup at the moment. We clean the
database after each test, running the tests will wipe out all your data!

{% tabs %}
{% tab title="Docker" %}
::: tabs
@tab:active Docker

Run the unit tests:

Expand All @@ -226,9 +220,7 @@ Run the unit tests:
$ docker exec backend yarn run test
```

{% endtab %}

{% tab title="Without Docker" %}
@tab Without Docker

Run the unit tests:

Expand All @@ -237,5 +229,4 @@ Run the unit tests:
$ yarn run test
```

{% endtab %}
{% endtabs %}
:::
Loading

0 comments on commit 1d1bf91

Please sign in to comment.