Skip to content

Commit

Permalink
Merge pull request #74 from DILCISBoard/rel/2.2.0
Browse files Browse the repository at this point in the history
REL: v2.2.0
  • Loading branch information
carlwilson authored May 17, 2024
2 parents b926e28 + 3835ef6 commit 8f826c5
Show file tree
Hide file tree
Showing 45 changed files with 1,323 additions and 692 deletions.
22 changes: 4 additions & 18 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,33 +65,19 @@ jobs:
RELEASE_DATE: ${{ steps.cut_release_date.outputs.substring }}
RELEASE_VERSION: ${{ steps.cut_release_version.outputs.substring }}
with:
templates: "specification/metadata.md"
templates: "metadata.yaml"
- name: Build the spec-publisher project & produce site artifacts
run: |
cd spec-publisher
mvn clean package
java -jar target/mets-profile-proc.jar ../profile/E-ARK-DIP.xml
- name: Run Docker job for site publication
run: |
docker run --rm -v "$PWD:/source" --entrypoint /source/create-site.sh eark4all/spec-pdf-publisher
ls -alh ./docs
- name: Build the spec-publisher project & produce PDF artifacts
run: |
git clone --branch feat/pdf-publication https://github.com/DILCISBoard/spec-publisher.git pdf-publisher
cd pdf-publisher
mvn clean package
java -jar target/mets-profile-proc.jar ../profile/E-ARK-DIP.xml
./create_site.sh
- name: Run Docker job for PDF publication
run: |
docker run --rm -v "$PWD:/source" --entrypoint /source/create-pdf.sh eark4all/spec-pdf-publisher
ls -alh ./docs
ls -alh ./docs/pdf
docker run --rm -v "$PWD:/source" --entrypoint /source/create_pdf.sh eark4all/spec-pdf-publisher
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build with Jekyll docker box
run: |
mkdir _site
docker run --rm -v "$PWD"/docs:/usr/src/app -v "$PWD"/_site:/_site starefossen/github-pages jekyll build -d /_site
docker run --rm -v "$PWD"/site:/usr/src/app -v "$PWD"/_site:/_site starefossen/github-pages jekyll build -d /_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v1

Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Site publication file
docs/
site/
Gemfile.lock
**/_site

Expand All @@ -14,3 +12,4 @@ Gemfile.lock
.vagrant*
.venv
vendor
.vscode
3 changes: 0 additions & 3 deletions Gemfile

This file was deleted.

396 changes: 396 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions PDF.md

This file was deleted.

20 changes: 0 additions & 20 deletions SITE.md

This file was deleted.

3 changes: 0 additions & 3 deletions SITE_BASE.md

This file was deleted.

19 changes: 12 additions & 7 deletions archive/index.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
---
title: Archived Versions of the DIP Specification
---
Archived Versions of the DIP Specification
=============================================
# Archived Versions of the DIP Specification

Latest
------
[PDF Version 2.1.0](/pdf/eark-dip.pdf) 15-10-2021
## Latest

[PDF Version 2.2.0](/pdf/eark-dip.pdf) 15-10-2021

## Archived Versions

### 2.1.x

- [PDF Version 2.1.0](v2_1/eark-dip-v2-1-0.pdf) 25-10-2021

Archived Versions
-----------------
### 2.0.x

- [PDF Version 2.0.4](v2_0/eark-dip-v2-0-4.pdf) 12-06-2020
- [PDF Version 2.0.2](v2_0/eark-dip-v2-0-2.pdf) 28-10-2019
- [PDF Version 2.0.1](v2_0/eark-dip-v2-0-1.pdf) 09-09-2019
- [PDF Version 2.0.0](v2_0/eark-dip-v2-0-0.pdf) 31-05-2019

### 1.x

- [PDF Final v1](v1/E-ARK Final Dip Specification (2017).pdf) 13-03-2017
- [PDF Draft v1](v1/E-ARK DIP Draft Specification (2015).pdf) 24-04-2015
Binary file added archive/v2_1/eark-dip-v2-1-0.pdf
Binary file not shown.
89 changes: 0 additions & 89 deletions create-site.sh

This file was deleted.

64 changes: 30 additions & 34 deletions create-pdf.sh → create_pdf.sh
Original file line number Diff line number Diff line change
@@ -1,54 +1,50 @@
#!/usr/bin/env bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPT_DIR" || exit
echo "Generating specification PDF from markdown"

cd "./specification/postface/" || exit
bash "$SCRIPT_DIR/spec-publisher/utils/create-venv.sh"
cp -rf "$SCRIPT_DIR/spec-publisher/pandoc/img" "$SCRIPT_DIR/spec-publisher/res/md/figs" "$SCRIPT_DIR/doc/pdf/"
cp -rf "$SCRIPT_DIR/specification/media" "$SCRIPT_DIR/doc/pdf/"

bash "$SCRIPT_DIR/spec-publisher/scripts/create-venv.sh"
command -v markdown-pp >/dev/null 2>&1 || {
tmpdir=$(dirname $"(mktemp -u)")
source "$tmpdir/.venv-markdown/bin/activate"
}
echo " - MARKDOWN-PP: Processing postface markdown"
markdown-pp postface.md -o "$SCRIPT_DIR/docs/postface.md" -e tableofcontents
cd "$SCRIPT_DIR/specification/postface/" || exit
markdown-pp postface.md -o "$SCRIPT_DIR/doc/pdf/postface.md" -e tableofcontents

cd "$SCRIPT_DIR/docs" || exit
cd "$SCRIPT_DIR/doc/pdf" || exit

# PDF Destinaton
echo " - PANDOC: Generating Preface from markdown"
pandoc --from gfm \
--to latex \
--metadata-file "../spec-publisher/pandoc/metadata.yaml" \
"../spec-publisher/res/md/common-intro.md" \
-o ./preface.tex
echo " - PANDOC: Finished"
--metadata-file "$SCRIPT_DIR/spec-publisher/pandoc/metadata.yaml" \
"./preface.md" \
-o "./preface.tex"
sed -i 's%section{%section*{%' ./preface.tex

echo " - PANDOC: Generating Postface from markdown"
pandoc --from gfm \
pandoc --from markdown \
--to latex \
--metadata-file "../spec-publisher/pandoc/metadata.yaml" \
"$SCRIPT_DIR/docs/postface.md" \
--metadata-file "$SCRIPT_DIR/spec-publisher/pandoc/metadata.yaml" \
"./postface.md" \
-o ./postface.tex
sed -i 's%section{%section*{%' ./postface.tex
rm "$SCRIPT_DIR/docs/postface.md"

if [ ! -d "$SCRIPT_DIR/docs/pdf" ]
then
mkdir -p "$SCRIPT_DIR/docs/pdf/"
fi

cd "$SCRIPT_DIR" || exit

echo " - MARKDOWN-PP: Preparing PDF markdown"
command -v markdown-pp >/dev/null 2>&1 || {
tmpdir=$(dirname $"(mktemp -u)")
source "$tmpdir/.venv-markdown/bin/activate"
}
markdown-pp PDF.md -o docs/eark-dip-pdf.md -e tableofcontents
cd "$SCRIPT_DIR/doc/pdf" || exit
markdown-pp PDF.md -o eark-dip-pdf.md -e tableofcontents
sed -i 's%fig_2_csip_scope.svg%fig_2_csip_scope.png%' eark-dip-pdf.md

cp -Rf specification/media docs/
cp -Rf spec-publisher/res/md/figs docs/

cd docs || exit
if [ -d "$SCRIPT_DIR/site/pdf" ]
then
echo " - Removing old site PDF directory"
rm -rf "$SCRIPT_DIR/site/pdf"
fi
mkdir "$SCRIPT_DIR/site/pdf"

###
# Pandoc options:
Expand All @@ -60,19 +56,19 @@ cd docs || exit
# --include-before-body "../spec-publisher/res/md/common-intro.md" \
# --include-after-body "../specification/postface/postface.md" \
# --number-sections \ # Generate Heading Numbers
# eark-sip-pdf.md \ # Input Markdown file
# eark-dip-pdf.md \ # Input Markdown file
# -o ./pdf/eark-dip.pdf # PDF Destinaton
echo " - PANDOC: Generating PDF document from markdown"
pandoc --from markdown \
--template "../spec-publisher/pandoc/templates/eisvogel.latex" \
--template "$SCRIPT_DIR/spec-publisher/pandoc/templates/eisvogel.latex" \
--listings \
--table-of-contents \
--metadata-file "../spec-publisher/pandoc/metadata.yaml" \
--metadata-file "$SCRIPT_DIR/spec-publisher/pandoc/metadata.yaml" \
--bibliography "$SCRIPT_DIR/pandoc/bibliography.bib" \
--filter pandoc-citeproc eark-dip-pdf.md \
--include-before-body "./preface.tex" \
--include-after-body "./postface.tex" \
--number-sections \
eark-dip-pdf.md \
-o "./pdf/eark-dip.pdf"
-o "$SCRIPT_DIR/site/pdf/eark-dip.pdf"
echo "PANDOC: Finished"
rm "$SCRIPT_DIR/docs/preface.tex" "$SCRIPT_DIR/docs/postface.tex" "$SCRIPT_DIR/docs/eark-dip-pdf.md"
cd "$SCRIPT_DIR" || exit
41 changes: 41 additions & 0 deletions create_site.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
echo "Generating GitHub pages site from markdown"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPT_DIR" || exit

echo " - Cleaning up site directory and copying spec-publisher site..."
git clean -f specification/


if [ -d _site ]
then
echo " - Removing old _site directory contents"
rm -rf _site/*
fi

echo " - copying files to site directory..."
# Copy spec-publisher artifacts to the site
cp -rf spec-publisher/site/* spec-publisher/res/md/figs site/
# Copy remaining project collaterel to the site
cp -rf profile archive examples specification/media site/

echo " - spec-publisher: generating requirement tables, appendices, etc."
mvn package -f spec-publisher/pom.xml
java -jar ./spec-publisher/target/mets-profile-processor-0.1.0-SNAPSHOT.jar -f ./specification.yaml -o doc/site profile/E-ARK-DIP-v2-2-0.xml

echo " - MARKDOWN-PP: generating site page with TOC..."
cd doc/site || exit
bash "$SCRIPT_DIR/spec-publisher/scripts/create-venv.sh"
command -v markdown-pp >/dev/null 2>&1 || {
tmpdir=$(dirname "$(mktemp -u)")
source "$tmpdir/.venv-markdown/bin/activate"
}
markdown-pp body.md -o body_toc.md

echo " - MARKDOWN-PP: Processing postface markdown"
cd "$SCRIPT_DIR/specification/postface/" || exit
markdown-pp postface.md -o "$SCRIPT_DIR/doc/site/postface.md" -e tableofcontents

echo " - MARKDOWN-PP: generating final site index markdown in site/index.md"
cd "$SCRIPT_DIR/doc/site" || exit
markdown-pp SITE.md -o ../../site/index.md
5 changes: 5 additions & 0 deletions doc/pdf/PDF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
!INCLUDE "../../metadata.yaml"
---

!INCLUDE "body.md"
19 changes: 19 additions & 0 deletions doc/site/SITE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
!INCLUDE "../../metadata.yaml"
---

# {{ page.subtitle }}

!INCLUDE "preface.md"

# {{ page.title }}

## {{ page.subtitle }}

Version: {{ page.version }}

Date: {{ page.date }}

!INCLUDE "body_toc.md"

!INCLUDE "postface.md"
2 changes: 0 additions & 2 deletions specification/metadata.md → metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
title: E-ARK DIP
subtitle: Specification for Dissemination Information Packages
abstract: |
Expand All @@ -11,4 +10,3 @@ abstract: |
management of the preservation of digital content.
version: ${RELEASE_VERSION}
date: ${RELEASE_DATE}
---
File renamed without changes.
Loading

0 comments on commit 8f826c5

Please sign in to comment.