-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Reformat template and remove mermaid * Update conversion and build to remove env and mermaid * Update build file * Add missing drafts * Modified build script name * Move drafts and include book-creation script * Include RFC-0033 first draft * Update readme * Include releases to the build process * remove obsolete github action configuration files * Add comments to book build scripts * Simplify RFC-0000 * Correctly format RFC-0001 * Updated RFC Tree * Remove file links from RFC tree * Change status from published to release to conform to RFC-0003 * Simplify RFC workflow in RFC-0003 * Unify uses of "markdown" * Update emphasized formatting in RFC-0003 * Remove Openreview.net from RFC-0004 * Remove obsolete footnotes * Update release scripts * Remove obsolete footnote * fix build script * Use release version for book conversion * Commit missing changes * Change dockerfiles base * Modify python in dockerfiles * Fix title extraction for book build script * Add "Release" to release "date" * Add timestamp to pdf book * Fix RFC-0001 * Replace draft RFC-0033 with template text * Fix RFC book conversion script to not damage tables * Change subtitle and authors of the RFC book * Add book preface * Preface changes
- Loading branch information
Showing
49 changed files
with
3,344 additions
and
2,141 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Compile and attach artifact to release on release publication | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Create version number | ||
run: echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | ||
|
||
- name: Build the Docker image that creates the PDF | ||
run: docker build $GITHUB_WORKSPACE/build -f $GITHUB_WORKSPACE/build/Dockerfile.book -t time-machine-project/publish_book | ||
|
||
- name: Create the output directory | ||
run: mkdir -p out | ||
|
||
- name: Create the PDF | ||
run: docker run -e VERSION=${{ env.VERSION }} -v $GITHUB_WORKSPACE/files:/opt/input -v $GITHUB_WORKSPACE/out:/opt/output time-machine-project/publish_book | ||
|
||
- name: Upload the artifacts | ||
uses: alexellis/upload-assets@0.2.2 | ||
with: | ||
asset_paths: '["./out/*.pdf"]' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM pandoc/latex:2.16 | ||
|
||
RUN apk update && apk upgrade && apk add --no-cache \ | ||
bash \ | ||
dos2unix \ | ||
git \ | ||
python3 \ | ||
py3-pip \ | ||
nss \ | ||
freetype \ | ||
freetype-dev \ | ||
harfbuzz \ | ||
ca-certificates \ | ||
ttf-freefont | ||
|
||
COPY ./convert_book.sh /opt/script/ | ||
|
||
RUN dos2unix /opt/script/convert_book.sh | ||
|
||
RUN chmod +x /opt/script/convert_book.sh | ||
|
||
ENTRYPOINT ["/opt/script/convert_book.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM pandoc/latex:2.16 | ||
|
||
RUN apk update && apk upgrade && apk add --no-cache \ | ||
bash \ | ||
dos2unix \ | ||
git \ | ||
python3 \ | ||
py3-pip \ | ||
nss \ | ||
freetype \ | ||
freetype-dev \ | ||
harfbuzz \ | ||
ca-certificates \ | ||
ttf-freefont | ||
|
||
COPY ./convert_single.sh /opt/script/ | ||
|
||
RUN dos2unix /opt/script/convert_single.sh | ||
|
||
RUN chmod +x /opt/script/convert_single.sh | ||
|
||
ENTRYPOINT ["/opt/script/convert_single.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/bin/bash | ||
|
||
# Initialize variables | ||
inpath=$1 | ||
outpath=$2 | ||
version=$3 | ||
if [ -z "$inpath" ]; then | ||
inpath=/opt/input | ||
fi | ||
if [ -z "$outpath" ]; then | ||
outpath=/opt/output | ||
fi | ||
if [ -z "$version" ]; then | ||
version=${VERSION:=custom-build} | ||
fi | ||
pdfpath="$outpath"/RFC-Book_"$version".pdf | ||
tmppath="$outpath"/tmp | ||
mkdir -p "$tmppath" | ||
|
||
# Copy all markdown files into a single folder so relative | ||
# links to files still work in the final markdown | ||
cd "$inpath" || exit | ||
shopt -s globstar | ||
for i in **/*.md; do | ||
cp -r "$(dirname "$i")"/* "$tmppath" | ||
done | ||
|
||
cd "$tmppath" || exit | ||
|
||
# Create basic markdown content with yaml header | ||
read -r -d '' text <<EOM | ||
--- | ||
title: Time Machine Requests for Comments | ||
subtitle: Rules, Recommendations and Core Architectural Choices for Time Machine | ||
author: | ||
- Time Machine Organisation and the RFC writers | ||
documentclass: scrreprt | ||
classoption: | ||
- oneside | ||
output: pdf_document | ||
--- | ||
EOM | ||
|
||
text="$text"$'\n'$(cat preface.md)$'\n' | ||
|
||
# Transform individual markdown files sorted by their name, excluding the template | ||
for md in $(find . -type f -name "*.md" -not -name "RFC-template.md" -not -name "preface.md" | sort | xargs -n 1 basename); do | ||
# Extract metadata | ||
suffix= | ||
if [[ $(find $inpath -type f -name "$(basename "$md")") == *"draft"* ]]; then | ||
suffix=" [Draft]" | ||
fi | ||
title=$(grep '^title: ".*"' "$md" | sed -e 's/^title: "\(.*\)"/\1/') | ||
number=$(basename "$md" .md) | ||
authors=$(sed -n '/^author:/,/^\w/{/^author:/!{/^\w/!p}}' "$md" | sed "s/^ - //g" | paste -s -d"," - | sed 's/,/, /g') | ||
# Transform existing headings to be one level lower | ||
sed -i 's/^#####/######/g' "$md" | ||
sed -i 's/^####/#####/g' "$md" | ||
sed -i 's/^###/####/g' "$md" | ||
sed -i 's/^##/###/g' "$md" | ||
sed -i 's/^#/##/g' "$md" | ||
# Remove yaml block | ||
sed -i '/^---/,/^\---/{/^---/!{/^\---/!d}}' "$md" | ||
sed -i '/^---/d' "$md" | ||
# Insert rfc title heading and authors | ||
sed -i "1s/^/# $number: $title$suffix\n\n$authors\n\n/" "$md" | ||
# append content to joined markdown content | ||
text=$'\n'${text}$'\n'"\newpage"$(cat "$md")$'\n\n' | ||
done | ||
|
||
# Build pdf | ||
pandoc -s -M date="Release $version - $(date "+%B %e, %Y")" --toc -f markdown -o "$pdfpath" <(echo "$text") | ||
|
||
# Remove temporary files | ||
cd .. | ||
rm -Rf tmp |
Oops, something went wrong.