-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
584 additions
and
957 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,8 @@ __pycache__/ | |
|
||
# Output | ||
/examples/*.pdf | ||
/tests/references/*.pdf | ||
/tests/references/*.pdf | ||
|
||
# Misc | ||
/*.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#import "../src/tidy.typ": * | ||
#set text(font: "Arial") | ||
|
||
#set page(width: 300pt, height: auto, margin: 0em) | ||
|
||
#show heading: set text(size: 1.5em) | ||
#show heading.where(level: 4): set text(size: .7em) | ||
|
||
#let example-code = read("../examples/my-module.typ") | ||
|
||
#block(fill: luma(255), inset: 20pt, | ||
{ | ||
set text(size: .8em) | ||
let example-code-doc = parse-module(example-code) | ||
show-module(example-code-doc) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
/// Draw a sine function with n periods into a rectangle of given size | ||
/// This function does something. It always returns true. | ||
/// | ||
/// *Example:* | ||
/// | ||
/// my-module.draw-sine(1cm, 0.5cm, 2) | ||
/// We can have *markdown* and | ||
/// even $m^a t_h$ here. A list? No problem: | ||
/// - Item one | ||
/// - Item two | ||
/// | ||
/// - height (length): Width of bounding rectangle. | ||
/// - width (length): Height of bounding rectangle. | ||
/// - periods (integer, float): Number of periods to draw. | ||
/// -> content | ||
#let draw-sine(width, height, periods) = box(width: width, height: height, { | ||
let prev-point = (0pt, height / 2) | ||
let res = 100 | ||
for i in range(1, res) { | ||
let x = i / res * width | ||
let y = (1 - calc.sin(i / res * 2 * 3.1415926 * periods)) * height / 2 | ||
place(line(start: prev-point, end: (x, y))) | ||
prev-point = (x, y) | ||
} | ||
}) | ||
/// | ||
/// - param1 (string): This is param1. | ||
/// - param2 (content, length): This is param2. | ||
/// Yes, it really is. | ||
/// - ..options (any): Optional options. | ||
/// -> boolean, none | ||
#let something(param1, param2: 3pt, ..options) = { return true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// Draw a sine function with n periods into a rectangle of given size | ||
/// | ||
/// *Example:* | ||
/// | ||
/// my-module.draw-sine(1cm, 0.5cm, 2) | ||
/// | ||
/// - height (length): Width of bounding rectangle. | ||
/// - width (length): Height of bounding rectangle. | ||
/// - periods (integer, float): Number of periods to draw. | ||
/// -> content | ||
#let draw-sine(width, height, periods) = box(width: width, height: height, { | ||
let prev-point = (0pt, height / 2) | ||
let res = 100 | ||
for i in range(1, res) { | ||
let x = i / res * width | ||
let y = (1 - calc.sin(i / res * 2 * 3.1415926 * periods)) * height / 2 | ||
place(line(start: prev-point, end: (x, y))) | ||
prev-point = (x, y) | ||
} | ||
}) |