Skip to content

Commit

Permalink
Reorganise the repo (#129)
Browse files Browse the repository at this point in the history
* move source files to src/

* fix manual and remove package dir
  • Loading branch information
fenjalien authored Aug 14, 2023
1 parent a7ac25f commit 1dd907a
Show file tree
Hide file tree
Showing 47 changed files with 77 additions and 106 deletions.
Binary file modified manual.pdf
Binary file not shown.
14 changes: 7 additions & 7 deletions manual.typ
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#import "lib.typ"
#import "styles.typ"
#import "src/lib.typ"
#import "src/styles.typ"
#import "@preview/tidy:0.1.0"
#import lib: *

Expand Down Expand Up @@ -247,7 +247,7 @@ circle((0.5, -2.5), radius: 0.5, fill: green)
```

== Elements
#let draw-module = tidy.parse-module(read("draw.typ"), name: "Draw")
#let draw-module = tidy.parse-module(read("src/draw.typ"), name: "Draw")

#show-module-fn(draw-module, "line")
```example
Expand Down Expand Up @@ -746,7 +746,7 @@ for-each-anchor("my-rect", (name) => {
= Libraries

== Tree
#let tree-module = tidy.parse-module(read("tree.typ"), name: "Tree")
#let tree-module = tidy.parse-module(read("src/tree.typ"), name: "Tree")

With the tree library, CeTZ provides a simple tree layout algorithm.

Expand Down Expand Up @@ -784,7 +784,7 @@ current node, all following items are direct children of that node.
The node itselfes can be of type `content` or `dictionary` with a key `content`.

== Plot
#let plot-module = tidy.parse-module(read("lib/plot.typ"), name: "Plot")
#let plot-module = tidy.parse-module(read("src/lib/plot.typ"), name: "Plot")

The library `plot` of CeTZ allows plotting 2D data as linechart.

Expand Down Expand Up @@ -856,7 +856,7 @@ Axis names to be used for styling:
#raw(repr(axes.default-style-schoolbook))

== Chart
#let chart-module = tidy.parse-module(read("lib/chart.typ"), name: "Chart")
#let chart-module = tidy.parse-module(read("src/lib/chart.typ"), name: "Chart")

With the `chart` library it is easy to draw charts.

Expand Down Expand Up @@ -937,7 +937,7 @@ styled the same way, see @plot.style.
#raw(repr(chart.columnchart-default-style))

== Palette <palette>
#let palette-module = tidy.parse-module(read("lib/palette.typ"), name: "Palette")
#let palette-module = tidy.parse-module(read("src/lib/palette.typ"), name: "Palette")

A palette is a function that returns a style for an index.
The palette library provides some predefined palettes.
Expand Down
33 changes: 3 additions & 30 deletions scripts/package
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,11 @@ PKG_PREFIX="cetz"

# List of all files that get packaged
files=(
canvas.typ
cmd.typ
draw.typ
util.typ
path-util.typ
vector.typ
matrix.typ
bezier.typ
intersection.typ
coordinate.typ
styles.typ
tree.typ
lib/axes.typ
lib/plot.typ
lib/chart.typ
lib/palette.typ
lib.typ
src/
gallery/
typst.toml
LICENSE
README.md
gallery/3d-chart.typ
gallery/3d-chart.png
gallery/pie-chart.typ
gallery/pie-chart.png
gallery/karls-picture.typ
gallery/karls-picture.png
gallery/plot.typ
gallery/plot.png
gallery/barchart.typ
gallery/barchart.png
gallery/tree.typ
gallery/tree.png
manual.typ
manual.pdf
)
Expand Down Expand Up @@ -83,7 +56,7 @@ TMP="$(mktemp -d)"

for f in "${files[@]}"; do
mkdir -p "$TMP/$(dirname "$f")" 2>/dev/null
cp "$SOURCE/$f" "$TMP/$f"
cp "$SOURCE/$f" "$TMP/$f" -r
done

TARGET="${TARGET:?}/${PKG_PREFIX:?}/${VERSION:?}"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/anchor-on-path/test.typ
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#set page(width: auto, height: auto)
#import "../../canvas.typ": *
#import "../../src/lib.typ": *

#box(stroke: 2pt + red, canvas({
import "../../draw.typ": *
import draw: *

let place-along = (path) => {
let name = "obj"
Expand Down
2 changes: 1 addition & 1 deletion tests/arc/test.typ
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#set page(width: auto, height: auto)
#import "../../lib.typ": *
#import "../../src/lib.typ": *

#box(stroke: 2pt + red, canvas(length: 1cm, {
import draw: *
Expand Down
4 changes: 2 additions & 2 deletions tests/arrows/test.typ
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#set page(width: auto, height: auto)
#import "../../canvas.typ": *
#import "../../src/lib.typ": *

#box(stroke: 2pt + red, canvas({
import "../../draw.typ": *
import draw: *

let next(mark) = {
line((), (rel: (1, 0)), mark: mark)
Expand Down
8 changes: 4 additions & 4 deletions tests/axes/test.typ
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#set page(width: auto, height: auto)
#import "../../lib.typ": *
#import "../../src/lib.typ": *

// Schoolbook Axis Styling
#box(stroke: 2pt + red, canvas({
import "../../draw.typ": *
import draw: *

set-style(axes: (stroke: blue))
set-style(axes: (padding: .75))
Expand All @@ -18,7 +18,7 @@

// Scientific Axis Styling
#box(stroke: 2pt + red, canvas({
import "../../draw.typ": *
import draw: *

set-style(axes: (stroke: blue))
set-style(axes: (left: (tick: (stroke: green + 2pt))))
Expand All @@ -37,7 +37,7 @@

// Custom Tick Format
#box(stroke: 2pt + red, canvas({
import "../../draw.typ": *
import draw: *

axes.scientific(size: (6, 1),
bottom: axes.axis(min: -2*calc.pi, max: 2*calc.pi, ticks: (
Expand Down
6 changes: 3 additions & 3 deletions tests/bezier-through/test.typ
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#set page(width: auto, height: auto)
#import "../../canvas.typ": *
#import "../../src/lib.typ": *

#block(stroke: 2pt + red, canvas(length: .5cm, {
import "../../draw.typ": *
import draw: *

let curve-through(a, b, c) = {
group(name: "g", {
Expand All @@ -22,7 +22,7 @@
}))

#block(stroke: 2pt + red, canvas(length: .5cm, {
import "../../draw.typ": *
import draw: *

merge-path(close: true, {
bezier-through((-1, 0), (-calc.cos(45deg), calc.sin(45deg)), (0, 1))
Expand Down
4 changes: 2 additions & 2 deletions tests/bounds/test.typ
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#set page(width: auto, height: auto)
#import "../../canvas.typ": *
#import "../../src/canvas.typ": *

#box(stroke: 2pt + red, canvas({
import "../../draw.typ": *
import draw: *

group(name: "g", {
rotate(37deg)
Expand Down
3 changes: 1 addition & 2 deletions tests/chart/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#set page(width: auto, height: auto)
#import "../../lib.typ"
#import lib: *
#import "../../src/lib.typ": *

#let data0 = (
([1], 1),
Expand Down
4 changes: 2 additions & 2 deletions tests/circle-through/test.typ
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#set page(width: auto, height: auto)
#import "../../canvas.typ": *
#import "../../src/lib.typ": *

#box(stroke: 2pt + red, canvas(length: .5cm, {
import "../../draw.typ": *
import draw: *

let (a, b, c) = ((0,0), (2,-.5), (1,1))
line(a, b, c, close: true, stroke: gray)
Expand Down
4 changes: 2 additions & 2 deletions tests/circle/test.typ
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#set page(width: auto, height: auto)
#import "../../canvas.typ": *
#import "../../src/lib.typ": *

#box(stroke: 2pt + red, canvas(length: .5cm, {
import "../../draw.typ": *
import draw: *

set-style(radius: (4, .5), stroke: none)
for r in range(0, 6) {
Expand Down
4 changes: 2 additions & 2 deletions tests/cube/test.typ
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#set page(width: auto, height: auto)
#import "../../canvas.typ": *
#import "../../src/lib.typ": *

#box(stroke: 2pt + red, canvas({
import "../../draw.typ": *
import draw: *

line((0, 0, 1), (1, 0, 1), (1, 1, 1), (0, 1, 1), close: true)
line((0, 0, 1), (0, 0, 0))
Expand Down
4 changes: 2 additions & 2 deletions tests/grid/test.typ
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#set page(width: auto, height: auto)
#import "../../canvas.typ": *
#import "../../src/lib.typ": *

#box(stroke: 2pt + red, canvas({
import "../../draw.typ": *
import draw: *

grid((0,0), (1,1), step: .1)

Expand Down
4 changes: 2 additions & 2 deletions tests/image/test.typ
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#set page(width: auto, height: auto)
#import "../../canvas.typ": *
#import "../../src/lib.typ": *

#box(stroke: 2pt + red, canvas({
import "../../draw.typ": *
import draw: *

content((0,0), image("image.png", width: 2cm),
anchor: "top-left", name: "i")
Expand Down
2 changes: 1 addition & 1 deletion tests/intersection/test.typ
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#set page(width: auto, height: auto)
#import "../../lib.typ": *
#import "../../src/lib.typ": *

#let test(body) = canvas(length: 1cm, {
import draw: *
Expand Down
4 changes: 2 additions & 2 deletions tests/local-anchor/test.typ
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#set page(width: auto, height: auto)
#import "../../canvas.typ": *
#import "../../src/lib.typ": *

#box(stroke: 2pt + red, canvas({
import "../../draw.typ": *
import draw: *

circle((0,0), radius: 0.5)
arc((0, 1), start: -90deg, stop: 90deg, name: "c", anchor: "start")
Expand Down
4 changes: 2 additions & 2 deletions tests/marks/test.typ
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#set page(width: auto, height: auto)
#import "../../canvas.typ": *
#import "../../src/lib.typ": *

#box(stroke: 2pt + red, canvas({
import "../../draw.typ": *
import draw: *

place-marks(line((0, 0), (1, 0)),
fill: green,
Expand Down
4 changes: 2 additions & 2 deletions tests/merge/test.typ
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#set page(width: auto, height: auto)
#import "../../canvas.typ": *
#import "../../src/lib.typ": *

#box(stroke: 2pt + red, canvas({
import "../../draw.typ": *
import draw: *

// Merge lines
fill(red)
Expand Down
Loading

0 comments on commit 1dd907a

Please sign in to comment.