Skip to content

Commit ab3cee4

Browse files
committed
Correct capitalization of Typst and Go
1 parent c3876b3 commit ab3cee4

File tree

9 files changed

+22
-22
lines changed

9 files changed

+22
-22
lines changed

cli.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ import (
1515
// TODO: Add docker support to CLI, by calling docker run instead
1616

1717
type CLI struct {
18-
ExecutablePath string // The typst executable path can be overridden here. Otherwise the default path will be used.
18+
ExecutablePath string // The Typst executable path can be overridden here. Otherwise the default path will be used.
1919
}
2020

21-
// TODO: Add method for querying the typst version resulting in a semver object
21+
// TODO: Add method for querying the Typst version resulting in a semver object
2222

23-
// VersionString returns the version string as returned by typst.
23+
// VersionString returns the version string as returned by Typst.
2424
func (c CLI) VersionString() (string, error) {
2525
// Get path of executable.
2626
execPath := ExecutablePath
@@ -46,7 +46,7 @@ func (c CLI) VersionString() (string, error) {
4646
return output.String(), nil
4747
}
4848

49-
// Compile takes a typst document from input, and renders it into the output writer.
49+
// Compile takes a Typst document from input, and renders it into the output writer.
5050
// The options parameter is optional.
5151
func (c CLI) Compile(input io.Reader, output io.Writer, options *CLIOptions) error {
5252
args := []string{"c"}
@@ -80,10 +80,10 @@ func (c CLI) Compile(input io.Reader, output io.Writer, options *CLIOptions) err
8080
return nil
8181
}
8282

83-
// CompileWithVariables takes a typst document from input, and renders it into the output writer.
83+
// CompileWithVariables takes a Typst document from input, and renders it into the output writer.
8484
// The options parameter is optional.
8585
//
86-
// Additionally this will inject the given map of variables into the global scope of the typst document.
86+
// Additionally this will inject the given map of variables into the global scope of the Typst document.
8787
//
8888
// Deprecated: You should use InjectValues in combination with the normal Compile method instead.
8989
func (c CLI) CompileWithVariables(input io.Reader, output io.Writer, options *CLIOptions, variables map[string]any) error {

cli_unix.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2024 David Vogel
1+
// Copyright (c) 2024-2025 David Vogel
22
//
33
// This software is released under the MIT License.
44
// https://opensource.org/licenses/MIT
@@ -7,5 +7,5 @@
77

88
package typst
99

10-
// The path to the typst executable.
10+
// The path to the Typst executable.
1111
var ExecutablePath = "typst"

cli_windows.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2024 David Vogel
1+
// Copyright (c) 2024-2025 David Vogel
22
//
33
// This software is released under the MIT License.
44
// https://opensource.org/licenses/MIT
@@ -7,9 +7,9 @@
77

88
package typst
99

10-
// The path to the typst executable.
10+
// The path to the Typst executable.
1111
// We assume the executable is in the current working directory.
1212
//var ExecutablePath = "." + string(filepath.Separator) + filepath.Join("typst.exe")
1313

14-
// The path to the typst executable.
14+
// The path to the Typst executable.
1515
var ExecutablePath = "typst.exe"

errors.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ import (
1414
// ErrorDetails contains the details of a typst.Error.
1515
type ErrorDetails struct {
1616
Message string // The parsed error message.
17-
Path string // Path of the typst file where the error is located in. Zero value means that there is no further information.
17+
Path string // Path of the Typst file where the error is located in. Zero value means that there is no further information.
1818
Line int // Line number of the error. Zero value means that there is no further information.
1919
Column int // Column of the error. Zero value means that there is no further information.
2020
}
2121

22-
// Error represents a typst error.
23-
// This can contain multiple sub-errors or sub-warnings.
22+
// Error represents an error as returned by Typst.
23+
// This can contain multiple sub-errors or sub-warnings which are listed in the field Details.
2424
type Error struct {
2525
Inner error
2626

identifier.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2024 David Vogel
1+
// Copyright (c) 2024-2025 David Vogel
22
//
33
// This software is released under the MIT License.
44
// https://opensource.org/licenses/MIT
@@ -11,7 +11,7 @@ import (
1111
"github.com/smasher164/xid"
1212
)
1313

14-
// CleanIdentifier will return the input cleaned up in a way so that it can safely be used as a typst identifier.
14+
// CleanIdentifier will return the input cleaned up in a way so that it can safely be used as a Typst identifier.
1515
// This function will replace all illegal characters, which means collisions are possible in some cases.
1616
//
1717
// See https://github.com/typst/typst/blob/76c24ee6e35715cd14bb892d7b6b8d775c680bf7/crates/typst-syntax/src/lexer.rs#L932 for details.

image.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"strconv"
1414
)
1515

16-
// Image can be used to encode any image.Image into a typst image.
16+
// Image can be used to encode any image.Image into a Typst image.
1717
//
1818
// For this, just wrap any image.Image with this type before passing it to MarshalValue or a ValueEncoder.
1919
type Image struct{ image.Image }

util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
)
1414

1515
// InjectValues will write the given key-value pairs as Typst markup into output.
16-
// This can be used to inject Go values into typst documents.
16+
// This can be used to inject Go values into Typst documents.
1717
//
1818
// Every key in values needs to be a valid identifier, otherwise this function will return an error.
1919
// Every value in values will be marshaled according to ValueEncoder into equivalent Typst markup.

value-encoder.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"time"
1919
)
2020

21-
// MarshalValue takes any go type and returns a typst markup representation as a byte slice.
21+
// MarshalValue takes any Go type and returns a Typst markup representation as a byte slice.
2222
func MarshalValue(v any) ([]byte, error) {
2323
var buf bytes.Buffer
2424

@@ -372,7 +372,7 @@ func (e *ValueEncoder) EncodeByteSlice(bb []byte) error {
372372
return err
373373
}
374374

375-
// TODO: Encode byte slice via base64 or similar and use a typst package to convert it into the corresponding bytes type
375+
// TODO: Encode byte slice via base64 or similar and use a Typst package to convert it into the corresponding bytes type
376376

377377
for i, b := range bb {
378378
if i > 0 {

value-encoder_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func TestValueEncoder(t *testing.T) {
184184
err := vEnc.Encode(tt.params)
185185
switch {
186186
case err != nil && !tt.wantErr:
187-
t.Fatalf("Failed to encode typst values: %v", err)
187+
t.Fatalf("Failed to encode Typst values: %v", err)
188188
case err == nil && tt.wantErr:
189189
t.Fatalf("Expected error, but got none")
190190
}
@@ -199,7 +199,7 @@ func TestValueEncoder(t *testing.T) {
199199
input := strings.NewReader("#" + result.String())
200200
var output bytes.Buffer
201201
if err := typstCLI.Compile(input, &output, nil); err != nil {
202-
t.Errorf("Failed to compile generated typst markup: %v", err)
202+
t.Errorf("Failed to compile generated Typst markup: %v", err)
203203
}
204204
}
205205
})

0 commit comments

Comments
 (0)