Skip to content

Commit 69445a2

Browse files
committed
Added Getting Started and Installation instructions in README.md
1 parent 08c3ea7 commit 69445a2

File tree

11 files changed

+84
-575
lines changed

11 files changed

+84
-575
lines changed

.typstignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
# - `*` in patterns works, but also matches directory separators: `*.typ` _will_ match `src/x.typ`
88
# .git and .typstignore are excluded automatically
99

10+
.DS_Store
1011
.github
1112
scripts
1213
tests
1314
Justfile
1415
# PDF manuals should be included so that they can be linked, but not their sources
1516
docs/*
1617
!docs/*.pdf
17-
.DS_Store

Justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ default:
99
# generate manual
1010
doc:
1111
typst compile docs/manual.typ docs/manual.pdf
12-
typst compile docs/thumbnail.typ thumbnail-light.svg
13-
typst compile --input theme=dark docs/thumbnail.typ thumbnail-dark.svg
12+
# typst compile docs/thumbnail.typ thumbnail-light.svg
13+
# typst compile --input theme=dark docs/thumbnail.typ thumbnail-dark.svg
1414

1515
# run test suite
1616
test *args:

README.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Enables CSS colors to be used by their names within a Typst document.
1111
- [x] Check and/or replace `LICENSE` by something that suits your needs
1212
- [x] Fill out `typst.toml`
1313
- See also the [typst/packages README](https://github.com/typst/packages/?tab=readme-ov-file#package-format)
14-
- [ ] Adapt Repository URLs in `CHANGELOG.md`
14+
- [x] Adapt Repository URLs in `CHANGELOG.md`
1515
- Consider only committing that file with your first release, or removing the "Initial Release" part in the beginning
1616
- [ ] Adapt or deactivate the release workflow in `.github/workflows/release.yml`
1717
- to deactivate it, delete that file or remove/comment out lines 2-4 (`on:` and following)
@@ -21,8 +21,8 @@ Enables CSS colors to be used by their names within a Typst document.
2121
- [ ] on this repo, create a secret `REGISTRY_TOKEN` (at `https://github.com/[user]/[repo]/settings/secrets/actions`) that contains the so created token
2222

2323
if configured correctly, whenever you create a tag `v...`, your package will be pushed onto a branch on the `REGISTRY_REPO`, from which you can then create a pull request against [typst/packages](https://github.com/typst/packages/)
24-
- [ ] remove/replace the example test case
25-
- [ ] (add your actual code, docs and tests)
24+
- [x] remove/replace the example test case
25+
- [x] (add your actual code, docs and tests)
2626
- [ ] remove this section from the README
2727

2828
## Getting Started
@@ -32,23 +32,38 @@ These instructions will get you a copy of the project up and running on the typs
3232
```typ
3333
#import "@preview/css-colors:0.1.0": *
3434
35-
#rect(fill: css("darkorchid"))
35+
Normal text may be #text(fill: css("crimson"))[colored so.]
36+
37+
#rect(width: 100%, height: auto, fill: css("darkorchid"))
3638
```
3739

3840
<picture>
3941
<source media="(prefers-color-scheme: dark)" srcset="./thumbnail-dark.svg">
4042
<img src="./thumbnail-light.svg">
4143
</picture>
4244

43-
### Installation
45+
## Installation
4446

45-
A step by step guide that will tell you how to get the development environment up and running. This should explain how to clone the repo and where to (maybe a link to the typst documentation on it), along with any pre-requisite software and installation steps.
47+
Set up your development environment by following these steps:
4648

47-
```
48-
$ First step
49-
$ Another step
50-
$ Final step
51-
```
49+
1. **Typst**
50+
Install Typst (version 0.13.0 or higher) using the [official installation instructions](https://github.com/typst/typst?tab=readme-ov-file#installation).
51+
52+
53+
1. **Just**
54+
Install [Just](https://just.systems/man/en/introduction.html) using a package manager or by downloading a pre-built binary. For more information, refer to the [available packages](https://just.systems/man/en/packages.html).
55+
56+
1. **tytanic**
57+
Install [tytanic](https://tingerrr.github.io/tytanic/index.html) by following the [quickstart installation guide](https://tingerrr.github.io/tytanic/quickstart/install.html).
58+
59+
1. **Clone the Repository**
60+
Clone the project repository to your local machine:
61+
62+
```bash
63+
git clone https://github.com/kleinbottle/css-colors.git
64+
```
65+
66+
Once you've completed these steps, your development environment will be ready.
5267
5368
## Usage
5469

docs/manual.pdf

2.71 KB
Binary file not shown.

docs/manual.typ

Lines changed: 55 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ You may also view them in a browser by clicking on this #link("https://htmlprevi
110110

111111
The CSS Colors Module provides a function `css` defined as:
112112

113-
```
113+
```typ
114114
css(
115115
str color-name
116116
) -> color
@@ -136,52 +136,52 @@ The following examples demonstrate the usage of the `css` function in various ca
136136

137137
+ Coloring text.
138138

139-
```
140-
#import "@preview/css-colors:0.1.0": *
139+
```typ
140+
#import "@preview/css-colors:0.1.0": *
141141
142-
Normal text may be #text(fill: css("crimson"))[colored so.]
143-
```
142+
Normal text may be #text(fill: css("crimson"))[colored so.]
143+
```
144144

145145
Normal text may be #text(fill: css("crimson"))[colored so.]
146146

147147
+ A rectangle may be colored with `fill`.
148148

149-
```
150-
#import "@preview/css-colors:0.1.0": *
149+
```typ
150+
#import "@preview/css-colors:0.1.0": *
151151
152-
#rect(width: 100%, height: auto, fill: css("darkorchid"))
153-
```
152+
#rect(width: 100%, height: auto, fill: css("darkorchid"))
153+
```
154154

155155
#rect(width: 100%, height: auto, fill: css("darkorchid"))
156156

157157
+ CSS colors may be specified in either lowercase or CamelCase.
158158

159-
```
160-
#import "@preview/css-colors:0.1.0": *
159+
```typ
160+
#import "@preview/css-colors:0.1.0": *
161161
162-
(a) saddlebrown: #box(width: 30mm, height: 1em, fill: css("saddlebrown"))
162+
(a) saddlebrown: #box(width: 30mm, height: 1em, fill: css("saddlebrown"))
163163
164-
(b) SaddleBrown: #box(width: 30mm, height: 1em, fill: css("SaddleBrown"))
165-
```
164+
(b) SaddleBrown: #box(width: 30mm, height: 1em, fill: css("SaddleBrown"))
165+
```
166166

167167
(a) saddlebrown: #box(width: 30mm, height: 1em, fill: css("saddlebrown"))
168168

169169
(b) SaddleBrown: #box(width: 30mm, height: 1em, fill: css("SaddleBrown"))
170170

171171
+ The maroon color in Typst differs from the Maroon color defined in CSS, as evidenced by their distinct hex codes. To emphasize this distinction, the CSS `Maroon` is intentionally capitalized with an initial uppercase letter.
172172

173-
```
174-
#import "@preview/css-colors:0.1.0": *
173+
```typ
174+
#import "@preview/css-colors:0.1.0": *
175175
176-
#grid(
177-
columns: 3,
178-
rows: 2,
179-
row-gutter: 10pt,
180-
column-gutter: 10pt,
181-
[Typst maroon], [#color.maroon.to-hex()], [#box(width: 30mm, height: 1em, fill: maroon)],
182-
[CSS maroon], [#css("Maroon").to-hex()], [#box(width: 30mm, height: 1em, fill: css("Maroon"))]
183-
)
184-
```
176+
#grid(
177+
columns: 3,
178+
rows: 2,
179+
row-gutter: 10pt,
180+
column-gutter: 10pt,
181+
[Typst maroon], [#color.maroon.to-hex()], [#box(width: 30mm, height: 1em, fill: maroon)],
182+
[CSS maroon], [#css("Maroon").to-hex()], [#box(width: 30mm, height: 1em, fill: css("Maroon"))]
183+
)
184+
```
185185

186186
#grid(
187187
columns: 3,
@@ -194,18 +194,18 @@ The following examples demonstrate the usage of the `css` function in various ca
194194

195195
+ CSS colors may also be used in the context of drawing and data visualization.
196196

197+
```typ
198+
#import "@preview/css-colors:0.1.0": *
199+
200+
#align(center)[
201+
#polygon.regular(
202+
fill: css("darkgoldenrod").lighten(60%),
203+
stroke: (paint: css("darkgoldenrod"), thickness: 4pt, cap: "round"),
204+
size: 80mm,
205+
vertices: 6,
206+
)
207+
]
197208
```
198-
#import "@preview/css-colors:0.1.0": *
199-
200-
#align(center)[
201-
#polygon.regular(
202-
fill: css("darkgoldenrod").lighten(60%),
203-
stroke: (paint: css("darkgoldenrod"), thickness: 4pt, cap: "round"),
204-
size: 80mm,
205-
vertices: 6,
206-
)
207-
]
208-
```
209209

210210
#align(center)[
211211
#polygon.regular(
@@ -219,19 +219,23 @@ The following examples demonstrate the usage of the `css` function in various ca
219219
+ CSS colors may be used to underline text with a line of default thickness. The
220220
thickness of the underline may be changed manually if desired.
221221

222-
```
223-
#import "@preview/css-colors:0.1.0": *
222+
```typ
223+
#import "@preview/css-colors:0.1.0": *
224224
225-
This is #underline(stroke: css("teal"))[important.]
225+
This is #underline(stroke: css("teal"))[important.]
226226
227-
This is #underline(stroke: (paint: css("teal"), thickness: 2pt))[important.]
228-
```
227+
This is #underline(stroke: (paint: css("teal"), thickness: 2pt))[important.]
228+
```
229229

230230
This is #underline(stroke: css("teal"))[important.]
231231

232232
This is #underline(stroke: (paint: css("teal"), thickness: 2pt))[important.]
233233

234-
== Appendix
234+
#bibliography("manual.yml", title: "References", style: "ieee")
235+
236+
#pagebreak()
237+
238+
= Appendix 1
235239

236240
#figure(
237241
align(center)[
@@ -251,6 +255,10 @@ The following examples demonstrate the usage of the `css` function in various ca
251255
], caption: [CSS colors sharing the same hex value],
252256
) <css-colors-sharing-hex-value>
253257

258+
#pagebreak()
259+
260+
= Appendix 2
261+
254262
#figure(
255263
align(center)[
256264
#table(
@@ -270,6 +278,10 @@ The following examples demonstrate the usage of the `css` function in various ca
270278
], caption: [Comparison of Typst and CSS colors],
271279
) <comparison-typst-css-colors>
272280

281+
#pagebreak()
282+
283+
= Appendix 3
284+
273285
#figure(align(center)[
274286
#table(
275287
inset: 10pt,
@@ -383,4 +395,4 @@ The following examples demonstrate the usage of the `css` function in various ca
383395
], caption: [Available CSS colors],
384396
) <available-css-colors>
385397

386-
#bibliography("manual.yml", title: "References", style: "ieee")
398+
#pagebreak()

docs/typst-predefined-sixteen-colors.txt

Lines changed: 0 additions & 18 deletions
This file was deleted.

scripts/Pipfile

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)