Skip to content

Commit

Permalink
Add PDF Build Script
Browse files Browse the repository at this point in the history
  • Loading branch information
ShapeLayer committed Mar 14, 2024
1 parent 6963107 commit cc72fd2
Show file tree
Hide file tree
Showing 17 changed files with 251 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
latest_release="$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/jgm/pandoc/releases/latest | cut -d'/' -f8)"
download_link="https://github.com/jgm/pandoc/releases/download/$latest_release/pandoc-$latest_release-1-amd64.deb"
downloaded_filename="$(basename $download_link)"
echo "Latest Release Found: $latest_release"
echo "Downloading: $downloaded_filename"
wget $download_link
sudo dpkg -i $downloaded_filename
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build document

on:
push:
branches:
- main
workflow_dispatch:

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install requirements
run: |
wget https://github.com/jgm/pandoc/releases/download/3.1.12.2/pandoc-3.1.12.2-1-amd64.deb
sudo dpkg -i pandoc-3.1.12.2-1-amd64.deb
mkdir ~/.fonts
cp ./typst/fonts/*.otf ~/.fonts/
- uses: typst-community/setup-typst@v3
- name: Build using pandoc and typst
run: |
sh ./build.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-pdf
path: main.pdf
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.deb
.DS_Store
typst/README.typ
*.pdf
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pandoc --from=markdown --to=typst -o typst/README.typ README.md
typst compile typst/main.typ ./main.pdf
11 changes: 11 additions & 0 deletions typst/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ./typst

Typst sources are built by [`/build.sh`](../build.sh)

## Change Name of Lead Manager

Adjust parameter `leadManager` in showing `_layout` at [`./main.typ`](./main.typ)

## Requirements
- typst
- pandoc
Binary file added typst/fonts/NotoSerifKR-Black.otf
Binary file not shown.
Binary file added typst/fonts/NotoSerifKR-Bold.otf
Binary file not shown.
Binary file added typst/fonts/NotoSerifKR-ExtraLight.otf
Binary file not shown.
Binary file added typst/fonts/NotoSerifKR-Light.otf
Binary file not shown.
Binary file added typst/fonts/NotoSerifKR-Medium.otf
Binary file not shown.
93 changes: 93 additions & 0 deletions typst/fonts/NotoSerifKR-OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2012 Google Inc. All Rights Reserved.

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file added typst/fonts/NotoSerifKR-Regular.otf
Binary file not shown.
Binary file added typst/fonts/NotoSerifKR-SemiBold.otf
Binary file not shown.
7 changes: 7 additions & 0 deletions typst/fonts/RIDIBatang-OFL
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
https://ridicorp.com/ridibatang/

라이선스 안내
리디바탕 글꼴은 개인 및 기업 사용자를 포함한 모든 사용자에게 무료로 제공되며 자유롭게 수정하고 재배포하실 수 있습니다. 단, 글꼴 자체를 유료로 판매하는 것은 금지하며, 리디바탕 글꼴은 본 저작권 안내와 라이선스 전문을 포함해서 다른 소프트웨어와 번들하거나 재배포 또는 판매가 가능합니다. 라이선스 전문을 포함하기 어려울 경우, 리디바탕 글꼴의 출처 표기를 권장합니다. 예) 이 페이지는 리디주식회사에서 제공한 리디바탕 글꼴이 사용되어 있습니다.

This Font Software is licensed under the SIL Open Font License, Version 1.1.
리디바탕의 저작권은 리디주식회사가 소유하고 있습니다.
Binary file added typst/fonts/RIDIBatang.otf
Binary file not shown.
12 changes: 12 additions & 0 deletions typst/main.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#import "template.typ": *

#show: _layout.with(
title: "종교에 관한 서약서",
authors: (
"전남대학교 게임개발동아리 PIMM",
),
leadManager: "박종현"
)

#include "README.typ"

83 changes: 83 additions & 0 deletions typst/template.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#let _layout(title: "", authors: (), leadManager: "", body) = {
set document(author: authors, title: title)
set page("a4", margin: (top: 3em, bottom: 2em, left: 4em, right: 4em), /*numbering: "1",*/ number-align: center)
set text(font: (
"Noto Serif CJK KR",
"Noto Serif KR",
"RIDIBatang"
), lang: "ko")
set heading(numbering: (..nums) => {
let level = nums.pos().len()
let pattern = if level > 1 {
"1.1.1."
}
if pattern != none {
numbering(pattern, ..(nums.pos().slice(1, level)))
}
})
set enum(numbering: "a.1.", indent: 10pt)
set text(size: 9.7pt)

align(center)[
#block(text(weight: 700, 1.75em, title))
]

pad(
top: 0.3em,
bottom: 0.3em,
x: 2em,
grid(
columns: (1fr,) * calc.min(3, authors.len()),
gutter: 1em,
..authors.map(author => align(center, strong(author))),
),
)

set par(justify: true)

body


v(20pt)

set align(center)
text(1em)[
20
#underline[ㅤㅤ]
#underline[ㅤㅤ]
#underline[ㅤㅤ]
]

set align(left)

grid(
columns: (1.5fr, 1fr, 1fr),
gutter: 1em,
align(right)[
서명자의 종교: #underline()[ㅤㅤㅤㅤㅤㅤㅤㅤㅤ]
],
[],
[],
align(right)[
전남대학교 게임개발동아리 PIMM
],
align(left)[
대표자, #leadManager
],
align(left)[
(인)
],
align(right)[
전남대학교 게임개발동아리 PIMM
],
align(left)[
서명자, #underline[ㅤㅤㅤㅤ]
],
align(left)[
(인)
]
)
}

0 comments on commit cc72fd2

Please sign in to comment.