From 1ca978fa54671520ecdb8af5614d6cfd8d7f75c6 Mon Sep 17 00:00:00 2001
From: Micha <60135572+mic-men@users.noreply.github.com>
Date: Tue, 29 Aug 2023 16:50:56 +0200
Subject: [PATCH] Initial commit
---
.github/workflows/initialize-repo.yml | 31 ++++++++++++++++++++
.github/workflows/publish-documents.yml | 39 +++++++++++++++++++++++++
.init-repo.sh | 10 +++++++
LICENSE | 21 +++++++++++++
README.md | 36 +++++++++++++++++++++++
chapter01.md | 17 +++++++++++
chapter02.md | 15 ++++++++++
chapter03.md | 7 +++++
chapter04.md | 7 +++++
config.yml | 12 ++++++++
metadata.yml | 21 +++++++++++++
11 files changed, 216 insertions(+)
create mode 100644 .github/workflows/initialize-repo.yml
create mode 100644 .github/workflows/publish-documents.yml
create mode 100755 .init-repo.sh
create mode 100644 LICENSE
create mode 100644 README.md
create mode 100644 chapter01.md
create mode 100644 chapter02.md
create mode 100644 chapter03.md
create mode 100644 chapter04.md
create mode 100644 config.yml
create mode 100644 metadata.yml
diff --git a/.github/workflows/initialize-repo.yml b/.github/workflows/initialize-repo.yml
new file mode 100644
index 0000000..e740c73
--- /dev/null
+++ b/.github/workflows/initialize-repo.yml
@@ -0,0 +1,31 @@
+name: Initialize repo from template
+on: [push]
+jobs:
+ init:
+ name: Reinitialize repository
+ runs-on: ubuntu-latest
+ permissions:
+ # Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
+ contents: write
+ steps:
+ - name: Exit for template repository
+ shell: bash
+ run: |
+ curl --silent -X GET \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/json" \
+ $GITHUB_API_URL/repos/$GITHUB_REPOSITORY \
+ | jq --exit-status '.is_template == false'
+
+ - uses: actions/checkout@v2
+
+ - name: Initialize
+ shell: bash
+ run: ./.init-repo.sh
+ env:
+ REPO_NAME: ${{ github.event.repository.name }}
+
+ - name: Commit changes
+ uses: stefanzweifel/git-auto-commit-action@v4
+ with:
+ commit_message: "Initialized repo"
diff --git a/.github/workflows/publish-documents.yml b/.github/workflows/publish-documents.yml
new file mode 100644
index 0000000..b70d4fc
--- /dev/null
+++ b/.github/workflows/publish-documents.yml
@@ -0,0 +1,39 @@
+name: Publish documents
+on: [push]
+
+env:
+ OUTPUT_FILENAME: "document"
+ USER_AGENT: "$GITHUB_REPOSITORY ($GITHUB_SERVER_URL/$GITHUB_REPOSITORY)"
+
+jobs:
+ prepare-and-build-documents:
+ runs-on: ubuntu-latest
+ container:
+ image: registry.gitlab.com/tibhannover/oer/markdown-pandoc-processor
+ steps:
+ - uses: actions/checkout@v3
+ - run: |
+ /build/process.sh
+ ls -l
+ mkdir .public
+ cp -r * .public
+ mv .public public
+ - uses: actions/upload-pages-artifact@v1
+ with:
+ path: ./public
+
+ # Deployment job
+ deploy:
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
+ permissions:
+ pages: write
+ id-token: write
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ runs-on: ubuntu-latest
+ needs: prepare-and-build-documents
+ steps:
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v2
diff --git a/.init-repo.sh b/.init-repo.sh
new file mode 100755
index 0000000..37b7eae
--- /dev/null
+++ b/.init-repo.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# adjust links in readme file
+sed -i "s,tibhannover.github.io/markdown-documents-template,${GITHUB_REPOSITORY_OWNER}.github.io/$REPO_NAME,g" README.md
+cat README.md
+
+# cleanup init-filees
+rm .init-repo.sh
+rm .github/workflows/initialize-repo.yml
+rm LICENSE
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..526439b
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 Technische Informationsbibliothek (TIB)
+
+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 NONINFRINGEMENT. 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.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..d19e535
--- /dev/null
+++ b/README.md
@@ -0,0 +1,36 @@
+# Template for OER
+
+This is a template for open and freely licensed texts that delivers appealing, and depending on the template, multimedia results. It additionally automates a lot of laborious work during creation. This template can be used for courses or modules as well as for all sorts of texts, including student research papers or theses.
+
+* generates metadata in HTML headers for OER repositories and Google search
+* automatically creates license notices for Wikimedia images with machine-readable notices according to CC REL
+* inserts license notice in generated documents
+
+With every save (commit) the documents are generated and available via:
+
+* [landing page](https://tibhannover.github.io/markdown-documents-template/)
+
+or directly
+* [Ebook](https://tibhannover.github.io/markdown-documents-template/document.epub)
+* [PDF](https://tibhannover.github.io/markdown-documents-template/document.pdf)
+* [HTML](https://tibhannover.github.io/markdown-documents-template/document.html)
+
+# Use this template
+
+1. Create a new repository based on this template
+ * click the green button `Use this template` or click [here](https://github.com/TIBHannover/markdown-documents-template/generate)
+ * enter a name for the new repository and click on `Create repository from template`
+1. In [settings -> pages](../../settings/pages): choose `GitHub Actions` as Source
+1. Adjust [metadata.yml](../../edit/main/metadata.yml)
+ * edit manually or
+ * create metadata with [generator](https://oersi.gitlab.io/metadata-form/metadata-generator.html) and copy/paste content into metadata.yml
+1. Output files will be generated automatically and available after aprox. 1 min
+1. Create your content in Markdown files (default chapterXX.md)
+1. You can overwrite this _README.md_ as you like
+
+# Configuration
+
+See https://gitlab.com/TIBHannover/oer/markdown-pandoc-processor#options
+
+# License notice
+This template for OER courses is released under MIT. The content of the document is subject to the respective license as indicated at the end of the generated files or in the metadata.yml.
diff --git a/chapter01.md b/chapter01.md
new file mode 100644
index 0000000..e5bc41b
--- /dev/null
+++ b/chapter01.md
@@ -0,0 +1,17 @@
+# Pythagorean theorem
+
+## Representation
+
+![Representation of the Pythagorean Theorem](https://upload.wikimedia.org/wikipedia/commons/d/d1/01-Rechtwinkliges_Dreieck-Pythagoras.svg)
+
+![Tree at the lake](https://upload.wikimedia.org/wikipedia/commons/c/c1/Regnitz-Baum-1012073.jpg)
+
+![Petri net](https://upload.wikimedia.org/wikipedia/commons/0/08/PetriNetzVentil.png)
+
+## The formula
+
+```math
+a^2 + b^2 = c^2
+```
+
+see [chapter 4](chapter04.md#assignment)
diff --git a/chapter02.md b/chapter02.md
new file mode 100644
index 0000000..0e48af3
--- /dev/null
+++ b/chapter02.md
@@ -0,0 +1,15 @@
+# Example video (test)
+
+a) Placeholder with link to Youtube
+
+[![Entwicklungsumgebung mit Groovy/Git testen](https://img.youtube.com/vi/fbZOii_l7M4/maxresdefault.jpg)](https://youtu.be/fbZOii_l7M4)
+
+b) AV-Portal player embedded
+
+
+
+c) Youtube embedded
+
+
diff --git a/chapter03.md b/chapter03.md
new file mode 100644
index 0000000..f831e63
--- /dev/null
+++ b/chapter03.md
@@ -0,0 +1,7 @@
+# H5P Test
+
+
+
+...
+
+
diff --git a/chapter04.md b/chapter04.md
new file mode 100644
index 0000000..f2f2b5c
--- /dev/null
+++ b/chapter04.md
@@ -0,0 +1,7 @@
+# Application
+
+* Example
+
+# Assignment
+
+* Example assignment with solution
\ No newline at end of file
diff --git a/config.yml b/config.yml
new file mode 100644
index 0000000..f37dedf
--- /dev/null
+++ b/config.yml
@@ -0,0 +1,12 @@
+output:
+ - format: asciidoc
+ - format: epub
+ - format: html
+ - format: pdf
+generate_landingpage: true
+# content_files: # uncomment this to set the order of the documents (default alphabetical)
+# - chapter01.md
+# - chapter02.md
+# - chapter03.md
+# - chapter04.md
+generate_reuse_note: true
diff --git a/metadata.yml b/metadata.yml
new file mode 100644
index 0000000..9769b67
--- /dev/null
+++ b/metadata.yml
@@ -0,0 +1,21 @@
+---
+name: "My OER Course"
+creator:
+ - givenName: "Max"
+ familyName: "Mustermann"
+ - givenName: "Maxi"
+ familyName: "Mustermann"
+publisher:
+ givenName: "Max"
+ familyName: "Mustermann"
+keywords:
+ - "Geometry"
+ - "Pythagoras"
+ - "Mathematics"
+description: "Draft for a course"
+inLanguage: "en"
+version: 1.0
+license: "https://creativecommons.org/publicdomain/zero/1.0/"
+thumbnailUrl: http://placehold.it/100x100
+learningResourceType: "Course"
+creativeWorkStatus: "Draft" # Incomplete, Draft, Published