Skip to content

Commit

Permalink
Major feature push (#24)
Browse files Browse the repository at this point in the history
* New README.md

* Created minimal examples for tests and to be included in README

* New pipeline to automatically generate all images for docs

* Created LaTeX Beamer comparison slides, which will be included in README

* Added Fira Fonts as default font

* Set Helvetica Font as backup font

* Created Option to use default font

* Modified caption setup to not include `Figure`

* Added Option to disable footer
  • Loading branch information
kai-tub authored May 25, 2020
1 parent b283cb1 commit 1fd5471
Show file tree
Hide file tree
Showing 29 changed files with 647 additions and 309 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
paths:
- "**.tex"
- "**.yml"
branches: [ master ]
pull_request:
paths:
- "**.tex"
- "**.yml"
branches: [ master ]


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
name: Build all files
runs-on: ubuntu-latest
container:
image: xucheng/texlive-small:latest
defaults:
run:
shell: sh
steps:
- name: Set up repo
uses: actions/checkout@v2
- name: Install missing packages
run: |
tlmgr install silence appendixnumberbeamer fira fontaxes mwe
- name: Build minimal examples
working-directory: minimal_examples/
run: |
ln -s ../*.sty ./
ln -s ../logos ./
latexmk -pdf -file-line-error -interaction=nonstopmode *.tex
- name: Build compare examples
working-directory: compare_examples/
run: |
ln -s ../*.sty ./
ln -s ../logos ./
latexmk -pdf -file-line-error -interaction=nonstopmode *example*.tex
- name: Build demo document
run: |
latexmk -pdf -file-line-error -interaction=nonstopmode demo.tex
- name: PDFs to PNGs
uses: docker://frapsoft/fish:latest
with:
args: fish ./.github/workflows/convert_pdf_to_png.fish
if: github.event_name == 'push'
- name: Sync docs
uses: kai-tub/external-repo-sync-action@v1
with:
source-directory: "./"
include-patterns: "demo.pdf *.png"
exclude-patterns: "*.tmp.png logos"
commit-message: "Updating LaTeX documentation files"
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
if: github.event_name == 'push'
37 changes: 37 additions & 0 deletions .github/workflows/convert_pdf_to_png.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/fish

function convert_minimal_examples
set files (find ./minimal_examples -type d -path '*/.git' -prune -o -name '*.pdf' -print)
for file_ in $files
echo "$file_"
set target (string replace '.pdf' '.png' "$file_")
convert -density 500 "$file_"[0] "$target"
end
end

function convert_compare_examples
set files (find ./compare_examples -type d -path '*/.git' -prune -o -name '*example*.pdf' -print)

for file_ in $files
echo "$file_"
set convert_target (string replace -r '(.*)\.pdf' '$1-%02d.tmp.png' "$file_")
set montage_source (string replace -r '(.*)\.pdf' '$1-*.png' "$file_")
set montage_target (string replace -r '(.*)\.pdf' '$1.tmp.png' "$file_")
convert -density 300 "$file_" "$convert_target"
montage "$montage_source" -geometry +10+10 -tile 1x -background gray -colorspace RGB "$montage_target"
# maybe next to each other
end
montage ./compare_examples/pureminimalistic_example_dark.tmp.png ./compare_examples/defaultbeamer_example.tmp.png -geometry +2+2 -tile 2x -background gray ./compare_examples/comparison_dark.png
montage ./compare_examples/pureminimalistic_example_light.tmp.png ./compare_examples/defaultbeamer_example.tmp.png -geometry +2+2 -tile 2x -background gray ./compare_examples/comparison_light.png
end

function convert_demo
convert -density 300 demo.pdf demo-%02d.tmp.png
montage demo-*.png -geometry +10+10 -tile 4x -background gray demo.png
end

apk add --no-cache imagemagick

convert_demo
convert_minimal_examples
convert_compare_examples
8 changes: 0 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ jobs:
asset_path: ./pureminimalistic.tar.gz
asset_name: pureminimalistic.tar.gz
asset_content_type: application/tar.gz
# Then this action has to first download the pdf
# - name: Upload pdf
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.release.outputs.upload_url }}
# asset_path: ./demo.pdf
# asset_name: demo.pdf
# asset_content_type: application/pdf
- name: Action tagger
uses: Actions-R-Us/actions-tagger@latest
with:
Expand Down
83 changes: 0 additions & 83 deletions .github/workflows/tests.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,5 @@ TSWLatexianTemp*
*.tar.gz
*.zip
tmp/
latex-beamer-pure-minimalistic.wiki/
latex-beamer-pure-minimalistic.wiki/
__latexindent_temp.tex
19 changes: 12 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ If you find a typo in the documentation, do not hesitate to submit a GitHub pull
go ahead and implement it.

## PR guide
If you implemented a new feature, which uses a new option argument, you are likely required to change the tests.
Don't worry it is very easy to integrate the test. Simply open the [generate_all_options.py](tests/generate_all_options.py) and
add the new option with a descriptive name to the `OPTIONS` dictionary. What will happen in your PR now is that the
[template document](tests/template.tex) will be compiled once with all options. This ensures that there are no other
If you implemented a new feature, you should add a new minimal example
in the [minimal_examples](./minimal_examples/) folder.
Then the [demo.tex](demo.tex) file should be modified to explain
how the option should be used and what the effect is.

In the PR all minimal examples will be compiled automatically.
This ensures that there are no other
breaking changes to other options. To speed up the tests, a minimal `texlive` distribution is used. If your changes
require new packages, they have to be added to the [workflow file](.github/workflows/main.yml).
(This may change in the future)
require new packages, they have to be added to the
[build file](.github/workflows/build.yml).

If anything is unclear, feel free to start the PR and mention the part that is hard to understand. I am happy to help. :)

If everything is OK, and all the tests are passing for the PR, I will reproduce and inspect the new feature locally,
Expand All @@ -31,4 +35,5 @@ If you are not familiar with creating a Pull Requeest, here are some guides:

Afterwards you will be added to the list of contributers.

Thanks for your hard work and for sticking around until the end of the guide! :tada::tada::tada:
Thanks for your hard work and for sticking around until
the end of the guide! :tada::tada::tada:
Loading

0 comments on commit 1fd5471

Please sign in to comment.