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

chatter:0.1.0 #1398

Merged
merged 11 commits into from
Dec 16, 2024
19 changes: 19 additions & 0 deletions packages/preview/chatter/0.1.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
MIT License

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.
31 changes: 31 additions & 0 deletions packages/preview/chatter/0.1.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Chatter
Typst Dialogue template designed for print. `Chatter` Aims to be an ergonomic
abstraction to the `typst` terms list function so that you can focus on
writing. For the best experience use variables for your characters:

### Use
This will all be created for you with with `typst init`.
```typ
#import "lib.typ" : *;
SylvanFranklin marked this conversation as resolved.
Show resolved Hide resolved

#let H = "Howard Moon"
#let T = "Tony Harrison"

#log()[
#say(H)[But It's a jazz Funk classic]
#say(T)[This is an outrage]
...
]
```

> [!TIP]
> Vim macros and custom snippets can make this even faster if you have the
> expertise so set them up.

![](thumbnail.jpg)

# Install
You can copy and paste over the template, or:
```sh
typst init @preview/chatter:0.1.0
```
Binary file added packages/preview/chatter/0.1.0/example.pdf
Binary file not shown.
Binary file added packages/preview/chatter/0.1.0/lib.pdf
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please delete this file?

Binary file not shown.
31 changes: 31 additions & 0 deletions packages/preview/chatter/0.1.0/lib.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#let conf(title: none, doc) = {
set page(
header: [
#align(
right + horizon,
[#title])
],
)
set text(
font: "PT Mono",
size: 12pt,
)
doc
}

#let character = (name) => [
#upper(name.slice(0, 3)).
]

#let log(number_lines: 5, body) = {

Check warning on line 20 in packages/preview/chatter/0.1.0/lib.typ

View check run for this annotation

Typst package check / @preview/chatter:0.1.0

packages/preview/chatter/0.1.0/lib.typ#L20

This argument seems to be part of public function. It is recommended to use kebab-case names.
set terms(separator: h(2em), hanging-indent: 5em, spacing: 1em)
set par.line(
numbering: i => if calc.rem(i, number_lines) == 0 {i},
SylvanFranklin marked this conversation as resolved.
Show resolved Hide resolved
number-margin: right,
)
block(stroke: (left: 4pt), inset: 1em)[
#body
]
}

#let say = (name, saying) => [/ #character(name): #saying]
Binary file added packages/preview/chatter/0.1.0/main.pdf
Binary file not shown.
28 changes: 28 additions & 0 deletions packages/preview/chatter/0.1.0/template/main.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#import "../lib.typ" : *; #show: doc => conf(title: [My assignment \ name], doc)

Check failure on line 1 in packages/preview/chatter/0.1.0/template/main.typ

View check run for this annotation

Typst package check / @preview/chatter:0.1.0

packages/preview/chatter/0.1.0/template/main.typ#L1

The following error was reported by the Typst compiler: failed to load file (access denied)

Check warning on line 1 in packages/preview/chatter/0.1.0/template/main.typ

View check run for this annotation

Typst package check / @preview/chatter:0.1.0

packages/preview/chatter/0.1.0/template/main.typ#L1

This import should use the package specification, not a relative path.
SylvanFranklin marked this conversation as resolved.
Show resolved Hide resolved

#let a = "Sam"
#let d = "Dog"

#log(number_lines: 3)[
SylvanFranklin marked this conversation as resolved.
Show resolved Hide resolved
Exercitation est dolore irure velit labore id. Eiusmod sit voluptate dolor
aliqua exercitation ex sint laborum qui duis qui velit. Ipsum sint pariatur
do fugiat excepteur et enim ipsum aliqua exercitation occaecat. Lorem est

#say(a)[Magna elit laboris tempor velit tempor irure aliqua. If you give me
a star on github that would legit make my day]

#say(a)[Magna elit laboris tempor velit tempor irure aliqua. Total giberish
incoming: blaoieanasrotie aens tua oarsteoka u aoskt oasotekaarsotqkusk
akeskt aoaosetkaole saoisetakk]

_(Magna elit laboris tempor velit tempor irure aliqua.)_

#say(d)[Could a brotha cop a bone sam? Kinda weird that I just switched from
lorem ipsum to a fragment of a story, but you're reading it so who's really
to blame?]

#say(a)[Magna elit laboris tempor velit tempor irure aliqua. Total giberish
incoming: blaoieanasrotie aens tua oarsteoka u aoskt oasotekaarsotqkusk
akeskt aoaosetkaole saoisetakk]

]
Binary file added packages/preview/chatter/0.1.0/thumbnail.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/preview/chatter/0.1.0/thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions packages/preview/chatter/0.1.0/typst.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "chatter"
version = "0.1.0"
entrypoint = "lib.typ"
authors = ["Sylvan Franklin"]
license = "MIT-0"
repository = "https://github.com/sylvanfranklin/chatter"
categories = ["layout"]
keywords = ["Homework", "English", "Translation", "Dialog", "Conversation"]
exclude = ["*.pdf", "*.jpg", "*.png"]
description = "Write dialog between any number of characters quickly and cleanly. Great for translations or short assignments"

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