Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

university-assignment:0.1.0 #1460

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/preview/university-assignment/0.1.0/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# [unreleased](https://github.com/UtkarshVerma/typst-university-assignment/releases/tag/)

## Added

## Removed

## Changed

## Migration Guide from v0.1.X

---

# [v0.1.0](https://github.com/UtkarshVerma/typst-university-assignment/releases/tag/v0.1.0)

Initial Release
19 changes: 19 additions & 0 deletions packages/preview/university-assignment/0.1.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright © 2024 Utkarsh Verma

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
32 changes: 32 additions & 0 deletions packages/preview/university-assignment/0.1.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# The `university-assignment` package

A clean and simple Typst template for writing university assignments.

## Usage

To use this template, simply import it from the [Typst Universe][typ-uni].

```typ
#import "@preview/university-assignment:0.1.0": assignment

#show: assignment.with(
title: "Assignment",
authors: (
(
name: "John Doe",
email: "[email protected]",
student-no: "123/XXX",
),
),
course: "CSXXXX: Cryptography",

// NOTE: Optionally specify this for a university logo on the first page.
// university-logo: image("./images/uni-logo.svg"),
)

<Your content here>
```

For further details, please refer to the [manual](./docs/manual.pdf).

[typ-uni]: https://typst.app/universe/
Binary file not shown.
69 changes: 69 additions & 0 deletions packages/preview/university-assignment/0.1.0/src/lib.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#let assignment(
title: none,
authors: (),
university-logo: none,
course: none,
body,
) = {
set page(
paper: "a4",
margin: (top: 1in, right: 1in, bottom: 2cm, left: 1in),
header: context {
if counter(page).get().first() > 1 [
#title
#h(1fr)
#counter(page).display()
]
},
footer: context {
if counter(page).get().first() > 1 {
align(right, course)
}
},
)
set text(11pt, font: "Libertinus Serif")
set list(indent: 8pt)
show heading: set block(below: 8pt)
show raw: set text(font: "Inconsolata")

grid(
columns: (auto, 1fr),
{
emph(course)
v(-0.4em)
strong(text(2em, title))
linebreak()
v(0.5em)

for author in authors [
#text(1.1em, upper(author.name), font: "Libertinus Sans"), #link("mailto:" + author.email), #author.student-no \
]
if authors != () {
v(0.5em)
}
},
align(
right,
if university-logo != none {
box(height: 3em, university-logo)
},
),
)

set par(justify: true)

show raw.where(block: true): code => {
show raw.line: line => {
text(fill: gray)[#line.number]
h(1em)
line.body
}
code
}

show figure: align.with(center)
show figure: set text(8pt)
show figure.caption: pad.with(x: 10%)

body
}
18 changes: 18 additions & 0 deletions packages/preview/university-assignment/0.1.0/src/template/main.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#import "@preview/university-assignment:0.1.0": assignment

#show: assignment.with(
title: "Assignment 1",
course: "CSXXXX: Cryptography",
authors: (
(
name: "John Doe",
email: "[email protected]",
student-no: "XX/123",
),
),

// NOTE: Optionally specify this for a university logo on the first page.
// university-logo: image("./images/uni-logo.svg"),
)

#lorem(1000)
19 changes: 19 additions & 0 deletions packages/preview/university-assignment/0.1.0/typst.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# for a description of available keys, see https://github.com/typst/packages/?tab=readme-ov-file#package-format

[package]
name = "university-assignment"
version = "0.1.0"
entrypoint = "src/lib.typ"
authors = ["Utkarsh Verma <[email protected]>"]
license = "MIT"
description = "A clean and simple template for university assignments."
repository = "https://github.com/UtkarshVerma/typst-university-assignment"
keywords = ["university", "assignment"]
categories = ["report"]
disciplines = []
exclude = [".github", "docs", "scripts", "tests", ".typstignore", "Justfile"]

[template]
path = "src/template"
entrypoint = "main.typ"
thumbnail = "thumbnail.png"

Check failure on line 19 in packages/preview/university-assignment/0.1.0/typst.toml

View check run for this annotation

Typst package check / @preview/university-assignment:0.1.0

packages/preview/university-assignment/0.1.0/typst.toml#L19

This file does not exist.
Loading