Skip to content

Commit

Permalink
docs: use cross links
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin committed Dec 14, 2023
1 parent 066189c commit 9491ec3
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 18 deletions.
1 change: 1 addition & 0 deletions github-pages/docs/book.typ
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@
// re-export page template
#import "/contrib/typst/gh-pages.typ": project
#let book-page = project
#let cross-link = cross-link
6 changes: 3 additions & 3 deletions github-pages/docs/cli/init.typ
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#import "/github-pages/docs/book.typ": book-page
#import "/github-pages/docs/book.typ": book-page, cross-link

#show: book-page.with(title: "CLI Init Command")

= The init command

The `init` command will try to initialize your book to build your book successfully by default. It is hence including all of the #link("https://myriad-dreamin.github.io/typst-book/cli/build.html")[options] from `build` command.
The `init` command will try to initialize your book to build your book successfully by default. It is hence including all of the #cross-link("/cli/build.typ")[options] from `build` command.

For instance, Initialize a book to the directory `my-book`:

Expand All @@ -29,7 +29,7 @@ typst-book build my-book/ # memoryized dest-dir

== Things to note

The harder way, by creating the book without `init` command, your `book.typ` should at least provides a `book-meta`, as #link("https://myriad-dreamin.github.io/typst-book/guide/get-started.html")[Get Started] shown.
The harder way, by creating the book without `init` command, your `book.typ` should at least provides a `book-meta`, as #cross-link("/guide/get-started.typ")[Get Started] shown.

```typ
#import "@preview/book:0.2.2": *
Expand Down
16 changes: 8 additions & 8 deletions github-pages/docs/cli/main.typ
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#import "/github-pages/docs/book.typ": book-page
#import "/github-pages/docs/book.typ": book-page, cross-link

#show: book-page.with(title: "Command Line Tool")

= Command Line Tool

// todo: cross link
The `typst-book` command-line tool is used to create and build books.
After you have #link("https://myriad-dreamin.github.io/typst-book/guide/installation.html")[installed] `typst-book`, you can run the `typst-book help` command in your terminal to view the available commands.
After you have #cross-link("/guide/installation.typ")[installed] `typst-book`, you can run the `typst-book help` command in your terminal to view the available commands.

This following sections provide in-depth information on the different commands available.

// todo: cross link
- #link("https://myriad-dreamin.github.io/typst-book/cli/init.html")[`typst-book init <directory>`]Creates a new book with minimal boilerplate to start with.
- #link("https://myriad-dreamin.github.io/typst-book/cli/build.html")[`typst-book build`]Renders the book.
- #link("https://myriad-dreamin.github.io/typst-book/cli/serve.html")[`typst-book serve`]Runs a web server to view the book, and rebuilds on changes.
- #link("https://myriad-dreamin.github.io/typst-book/cli/clean.html")[`typst-book clean`]Deletes the rendered output.
- #link("https://myriad-dreamin.github.io/typst-book/cli/completions.html")[`typst-book completions`]Support for shell auto-completion.
- #cross-link("/cli/init.typ")[`typst-book init <directory>`]Creates a new book with minimal boilerplate to start with.
- #cross-link("/cli/build.typ")[`typst-book build`]Renders the book.
- #cross-link("/cli/serve.typ")[`typst-book serve`]Runs a web server to view the book, and rebuilds on changes.
- #cross-link("/cli/clean.typ")[`typst-book clean`]Deletes the rendered output.
- #cross-link("/cli/completions.typ")[`typst-book completions`]Support for shell auto-completion.

= Note about the missing `watch` command

We suggest you to use #link("https://github.com/Enter-tainer/typst-preview")[Typst Preview plugin] for preview feature. For more details, please see #link("https://myriad-dreamin.github.io/typst-book/guide/get-started.html")[Get Started] chapter.
We suggest you to use #link("https://github.com/Enter-tainer/typst-preview")[Typst Preview plugin] for preview feature. For more details, please see #cross-link("/guide/get-started.typ")[Get Started] chapter.
4 changes: 2 additions & 2 deletions github-pages/docs/cli/serve.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "/github-pages/docs/book.typ": book-page
#import "/github-pages/docs/book.typ": book-page, cross-link

#show: book-page.with(title: "CLI Serve Command")

Expand Down Expand Up @@ -30,7 +30,7 @@ typst-book serve path/to/book

== Build options

The `serve` command will build your book once before serving the content. It is hence including all of the #link("https://myriad-dreamin.github.io/typst-book/cli/build.html")[options] from `build` command.
The `serve` command will build your book once before serving the content. It is hence including all of the #cross-link("/cli/build.typ")[options] from `build` command.

== Server options

Expand Down
6 changes: 3 additions & 3 deletions github-pages/docs/format/book.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "/github-pages/docs/book.typ": book-page
#import "/github-pages/docs/book.typ": book-page, cross-link

#show: book-page.with(title: "book.typ")

Expand Down Expand Up @@ -41,7 +41,7 @@ In this example, you specify following fields for the book project:
- authors #type-hint("array<string>") (optional): Specify the author(s) of the book.
- summary #type-hint("content") (required): Summarize of the book.

See #link("https://myriad-dreamin.github.io/typst-book/format/book-meta.html")[Book Metadata] for more details.
See #cross-link("/format/book-meta.typ")[Book Metadata] for more details.

== build-meta

Expand All @@ -55,4 +55,4 @@ Specify build metadata of the book project. For example:

When you set `build-meta.dest-dir` to `../dist`, `typst-book` will output the generated content to `parent/to/book.typ/../../dist` or `parent/dist`.

See #link("https://myriad-dreamin.github.io/typst-book/format/build-meta.html")[Build Metadata] for more details.
See #cross-link("/format/build-meta.typ")[Build Metadata] for more details.
6 changes: 4 additions & 2 deletions github-pages/docs/format/theme.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "/github-pages/docs/book.typ": book-page
#import "/github-pages/docs/book.typ": book-page, cross-link, cross-link-path-label

#show: book-page.with(title: "Theme")

Expand All @@ -12,7 +12,9 @@ Currently we have no much design on theme's html part. But you can still configu

== Things to note

Your `book.typ` should at least provides a `book-meta`, as #link("https://myriad-dreamin.github.io/typst-book/guide/get-started.html")[Get Started] shown.
#let t = cross-link("/guide/get-started.typ")[Get Started]

Your `book.typ` should at least provides a `book-meta`, as #t shown.

```typ
#import "@preview/book:0.2.2": *
Expand Down

0 comments on commit 9491ec3

Please sign in to comment.