Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MartenBE committed Mar 12, 2024
0 parents commit 63d9910
Show file tree
Hide file tree
Showing 15 changed files with 367 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*]
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = true
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
push:
pull_request:
# 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

jobs:
lint:
runs-on: ubuntu-latest
steps:
- run: shopt -s globstar
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v13
with:
globs: "**/*.md"

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/configure-pages@v3
- uses: actions/setup-python@v5
- run: pip install --requirement requirements.txt
- run: mkdocs build
- uses: actions/upload-pages-artifact@v3
with:
path: ./site
- id: deployment
uses: actions/deploy-pages@v2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
site/
14 changes: 14 additions & 0 deletions .markdownlint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"line-length": false,
"list-marker-space": false, // https://github.com/prettier/prettier/issues/5019
"no-alt-text": false,
"no-bare-urls": false,
"no-inline-html": false,
"no-trailing-punctuation": false,
"single-h1": {
"front_matter_title": ""
},
"ul-indent": {
"indent": 4
}
}
5 changes: 5 additions & 0 deletions .prettierrc.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
printWidth: 120,
singleQuote: false,
tabWidth: 4,
}
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# README

## Demo

You can see the slides of this repository at https://hogenttin.github.io/hogent-mkdocs/ . Play with it to see what it can do!

## Installation

1. Install [python](https://www.python.org/downloads/) .
2. (optional) Create a [Python environment](https://docs.python.org/3/library/venv.html). E.g. for Linux:

```console
python -m venv venv
source ./venv/bin/activate
```

3. Install the dependencies:

```console
pip install -r requirements.txt
```

## Basic usage

Edit, add or delete your markdown files in the [docs](./docs/) directory.

### Creating slides (debugging)

You can start up a live preview:

```console
mkdocs serve
```

## Advanced

**You don't really need this** if you want to keep things simple, but it's here if you want an example.

### Automatic deployment

This repo automatically builds the website and pushes them to https://hogenttin.github.io/hogent-mkdocs/ whenever a commit is pushed to the `main` branch. This is done using using [GitHub actions](https://docs.github.com/en/actions) . You can find the workflow in the [.github](./.github) folder.

### Formatting

A [prettier](https://prettier.io/docs/en/) config has been added in [.prettierrc.json5](./.prettierrc.json5) .

### Linting

A [markdownlint](https://github.com/DavidAnson/markdownlint) config has been added in [.markdownlint.jsonc](./.markdownlint.jsonc) .

## Configuration

### Theme

If you want another theme, you can change edit the `theme.css` header tag in [index.html](./docs/index.html) to point to another CSS file. You can also use an existing link like https://hogenttin.github.io/hogent-docsify/theme.css . Using this specific URL will always keep your theme up to date with the one on this repo.

### [MkDocs](https://www.mkdocs.org/) options

You can add them to [mkdocs.yml](./mkdocs.yml) .
140 changes: 140 additions & 0 deletions docs/examples/h1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# Basic examples

## Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

## More titles

### Some more titles

#### And some more titles

## Unordered lists

- Lorem ipsum dolor sit amet,
- consectetur adipiscing elit,
- sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

## Unordered lists with different indentation

- aaa
- bbb
- ccc
- ddd
- eee
- fff
- ggg
- hhh

## Ordered lists

1. Lorem ipsum dolor sit amet,
2. consectetur adipiscing elit,
3. sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

## Mixed lists with different indentation

1. aaa
- bbb
1. ccc
- ddd
1. eee
- fff
2. ggg
- hhh
2. iii

## Ordered lists (the easy way)

If you are in a lazy mood, you can let markdown calculate the numbers. Just use `1.` for all list entries, instead of `1.`, `2.`, `3.`, ... (see the source code in the markdown file).

1. Lorem ipsum dolor sit amet,
1. consectetur adipiscing elit,
1. sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

_Tip: Editors with markdown support often fix these numbers automatically._

## Direct downloads

Donwload the following [test file](./test.txt).

## Source code

Some pretty code:

```java
public void test() {
String words = "Hello world!";
int[] numbers = {0, 1, 42, 1337};

System.out.println(words);

// Print each number in the array
for (int n : numbers) {
System.out.println(n);
}

System.out.println("Well this is a very long line of code, I wonder how it will wrap? Do you know? I am very curious ... . Well, let's find out, shall we!");
}
```

Some text here.

## Inline source code

Variables `iso`, `iso_size` and `destination` belong to function `copy_iso_to_usb()`.

## Citation

Some pretty quote:

> The problem with quotes found on the internet is, that they are often not true.
> ~ Abraham Lincoln.
<!-- Note the 2 spaces behind `not true.` to force a newline: https://www.markdownguide.org/basic-syntax/#line-breaks -->

Some text here.

## Links, bold, italic, strikethrough

[Link to website](https://www.hogent.be) .

You can also just type the URL: https://www.hogent.be .

Text in **bold**.

_Italic_ text.

This text has been ~~stricken~~.

## Math

You can use [LaTeX / MathJax](https://www.mathjax.org/) math notations:

$$
S_n(x)=\sum_{k=1}^n \frac{\sin(kx)}{k} \gt 0\quad (n\geq 1,\quad 0 \lt x \lt \pi)
$$

## Tables

| Left-aligned | Middle-aligned | Right-aligned | Auto |
| :----------- | :------------: | ------------: | ---- |
| aaa | bbb | ccc | ddd |
| 000 | 111 | 222 | 333 |

_Tip: Editors with markdown support often auto align markdown tables so they also look pretty in the source code. Saves you a lot of spaces to type!_

## Images

Some pretty image:

![](./img/hello.webp)

Some text here.

### GIF's

![Rotating molecule](./img/molecule.gif)
72 changes: 72 additions & 0 deletions docs/examples/h2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Advanced examples

## Video

Some pretty video:

<iframe
width="560"
height="560"
src="https://www.youtube.com/embed/sGF6bOi1NfA?si=YtSJFaGVxvQMmrNZ"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen>
</iframe>

Some text here.

## Website

Anything that allows you to embed a website, you can use too:

<iframe
src="https://www.google.com/maps/embed?pb=!1m28!1m12!1m3!1d5018.051311095338!2d3.700269598821751!3d51.03414688375593!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!4m13!3e6!4m5!1s0x47c373dfecba42a1%3A0x967548ec6ae567f6!2sGent%20Sint%20Pieters%20Station%2C%20Koningin%20Maria%20Hendrikaplein%2C%20Ghent!3m2!1d51.036234!2d3.7108572!4m5!1s0x47c373d974e7039b%3A0x2b5e1bf81b807f8c!2sHOGENT%20campus%20Schoonmeersen%2C%20Valentin%20Vaerwyckweg%201%2C%209000%20Gent!3m2!1d51.0330995!2d3.7030491999999997!5e0!3m2!1sen!2sbe!4v1697794155393!5m2!1sen!2sbe"
width="560"
height="560"
referrerpolicy="no-referrer-when-downgrade">
</iframe>

You can scroll, zoom in/out, ... .

## Graphs

You can use [Mermaid](https://mermaid.js.org/intro/) to create diagrams from text:

```mermaid
graph TD
A[Enter Chart Definition] --> B(Preview)
B --> C{decide}
C --> D[Keep]
C --> E[Edit Definition]
E --> B
D --> F[Save Image and Code]
F --> B
```

You can Also use [PlantUML](https://plantuml.com/news) to create diagrams from text:

```plantuml
@startuml
participant Participant as Foo
actor Actor as Foo1
boundary Boundary as Foo2
control Control as Foo3
entity Entity as Foo4
database Database as Foo5
collections Collections as Foo6
queue Queue as Foo7
Foo -> Foo1 : To actor
Foo -> Foo2 : To boundary
Foo -> Foo3 : To control
Foo -> Foo4 : To entity
Foo -> Foo5 : To database
Foo -> Foo6 : To collections
Foo -> Foo7: To queue
@enduml
```

## Checkboxes

- [ ] Unchecked
- [x] Checked
Binary file added docs/examples/img/hello.webp
Binary file not shown.
Binary file added docs/examples/img/molecule.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/examples/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello world!
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# MkDocs proof of concept for HOGENT

Hello world!
6 changes: 6 additions & 0 deletions docs/links.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Links

- https://github.com/HoGentTIN/hogent-mkdocs
- https://www.mkdocs.org
- https://www.mkdocs.org/user-guide/choosing-your-theme/#readthedocs
- https://yakworks.github.io/docmark/extensions/pymdown/
18 changes: 18 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
site_name: hogent-mkdocs
site_url: https://hogent.be
nav:
- Home: ./index.md
- Basic examples: ./examples/h1.md
- Advanced examples: ./examples/h2.md
- Links: ./links.md
theme:
name: readthedocs
logo: https://www.hogent.be/sites/hogent/assets/Image/logo-1.jpg
markdown_extensions:
- pymdownx.arithmatex:
generic: true
- pymdownx.magiclink
- pymdownx.tasklist
- pymdownx.tilde
extra_javascript:
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mkdocs
pymdown-extensions

0 comments on commit 63d9910

Please sign in to comment.