Skip to content

Commit

Permalink
Migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
SmithPeder committed Feb 16, 2021
1 parent 9b8057f commit ac0d022
Show file tree
Hide file tree
Showing 42 changed files with 309 additions and 498 deletions.
26 changes: 26 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
kind: pipeline
type: docker
name: default

steps:
- name: build
image: abakus/statuttbuilder:latest
commands:
- ./generate.sh
when:
event:
- pull_request

- name: push
image: appleboy/drone-git-push
settings:
remote_name: origin
branch: testdrone
local_ref: testdrone
force: false
commit: true
commit_message: "DroneCI new build"
when:
event:
- pull_request
9 changes: 2 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
gh-pages/index.html
gh-pages/fond/index.html
gh-pages/_site
logs/

## Core latex/pdflatex auxiliary files:
*.aux
*.lof
Expand All @@ -15,7 +10,6 @@ logs/
*.fot
*.cb
*.cb2
*.pdf

## Intermediate documents:
*.dvi
Expand All @@ -25,7 +19,6 @@ logs/
*.ps
report.pdf
svg-inkscape/
*.pdf

## Bibliography auxiliary files (bibtex/biblatex/biber):
*.bbl
Expand Down Expand Up @@ -224,4 +217,6 @@ TSWLatexianTemp*
# expex forward references with \gathertags
*-tags.tex

.DS_Store

.now
1 change: 0 additions & 1 deletion .latexmkrc

This file was deleted.

16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:18.04

RUN apt-get update

RUN apt-get install -y --no-install-recommends \
texlive \
texlive-latex-base \
texlive-font-utils \
texlive-lang-european \
pandoc \
ghostscript

WORKDIR /statutter
#
#COPY ./generate.sh /
#
#CMD /generate.sh
39 changes: 0 additions & 39 deletions Makefile

This file was deleted.

67 changes: 24 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,30 @@
# Abakus' statutter [![Build Status](https://travis-ci.org/abakus-ntnu/statutter.svg?branch=master)](https://travis-ci.org/abakus-ntnu/statutter)
Her finner du LaTeX-kildekoden til statuttene til Abakus Linjeforening.
Send gjerne endringsforslag via pull-requests, les mer om reglene for
statuttendringer i [CONTRIBUTING.md](CONTRIBUTING.md).

## Bygging av PDF
### Installering av pdfTeX
pdfTeX kreves for å bygge statuttene. Det kan installeres på følgende måte:

macOS (krever [Homebrew](https://brew.sh/)):
```bash
brew cask install mactex
```
# Abakus' statutter

Ubuntu:
```bash
sudo apt-get install texlive texlive-font-utils texlive-lang-european latexmk
```
Her finner du LaTeX-kildekoden til statuttene til Abakus Linjeforening. Send gjerne endringsforslag via pull-requests, les mer om reglene for statuttendringer i [CONTRIBUTING.md](CONTRIBUTING.md).

### Kompilere PDF
```bash
make
```
## Organisering

## Nettside
### Publisering
[GitHub Pages](https://pages.github.com/) brukes til å hoste
[statutter.abakus.no](https://statutter.abakus.no). Opplastning av siste versjon
skjer automatisk av [Travis](https://travis-ci.org/abakus-ntnu/statutter) når
commits blir pushet til master.

### Lokal utvikling
#### Avhengigheter
macOS (krever [Homebrew](https://brew.sh/)):
```bash
brew install pandoc
```
`statutter` mappen inneholder kildekoden til statuttene.

Ubuntu:
```bash
sudo apt-get install pandoc
```
`static` mappen inneholder filer som blir brukt under generering av nettsiden.

`public` mappen inneholder alt av output som docker containeren genererer. Denne mappen blir entrypoint for nettsiden, og det er disse html og css filene som brukere ser.

## Bygging av statutter

Alle statuttene bygges ved hjelp av et `docker` image som har all programvare som trengs, samt et generering script som bruker denne programvaren. Scriptet bygger både `pdf` og `html` versjon av statuttene.

### Kjør bilde ved hjelp av følgende kommando

Den mounter de tre volumene `statutter, static og public` som blir brukt av bildet når den bygger statutter.

I tillegg kan du sende inn `ASSEMBLY_DATE` som en variabel, og den genererte pdf filen som blir arkivert får dette navnet.

#### Bygging
```bash
make jekyll
cd gh-pages
bundle exec jekyll serve
```sh
$ docker run --rm \
-v `pwd`/statutter:/statutter/ \
-v `pwd`/static:/static/ \
-v `pwd`/public:/public/ \
-e ASSEMBLY_DATE=01.januar.1970 \
abakus/statuttbuilder:latest
```
8 changes: 0 additions & 8 deletions abakus-statutter/innhold.tex

This file was deleted.

33 changes: 33 additions & 0 deletions generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
TIMESTAMP=`eval date +%d.%B.%Y`

# Convert abakus LaTeX to html
pandoc -f latex -o public/index.html \
--include-in-header=static/head.html \
--include-before-body=static/abakus.html \
--include-after-body=static/end.html \
statutter/abakus-statutter/innhold.tex

# Move other static files to the public folder
cp static/main.css static/abakule.jpg public/

# Convert abakus LaTeX to PDF
pdflatex -halt-on-error statutter/abakus-statutter.tex
pdflatex -halt-on-error statutter/abakus-statutter.tex
pdflatex -pdf -halt-on-error -output-dir="./public" statutter/abakus-statutter.tex

# Store a copy of the pdf in the archive
mkdir -p public/archive/
cp public/*.pdf public/archive/$TIMESTAMP.pdf

# Clean up the Statutter directory, as it used to genereate fles
rm -f ./statutter/*.log \
./statutter/*.aux \
./statutter/*.out \
./statutter/*.toc \
./statutter/*.pdf # The result PDF is moved to /public by pdflatex

# Clean up the public directory, as it's used to genereate fles
rm -f ./public/*.log \
./public/*.aux \
./public/*.out \
./public/*.toc \
1 change: 0 additions & 1 deletion gh-pages/CNAME

This file was deleted.

2 changes: 0 additions & 2 deletions gh-pages/Gemfile

This file was deleted.

Loading

0 comments on commit ac0d022

Please sign in to comment.