Skip to content

Commit

Permalink
[docs] tidy up user guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Mc-Zen committed Nov 26, 2024
1 parent 3c55c26 commit 476408d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
stroke: rgb("#239DAE") + 1pt,
radius: 3pt,
{
block(align(right, text(raw(filename))), width: 100%, inset: 5pt)
block(align(right, text(raw(filename, lang: "cmd"))), width: 100%, inset: 5pt)
v(1pt, weak: true)
move(dx: -1pt, line(length: 100% + 2pt, stroke: 1pt + rgb("#239DAE")))
v(1pt, weak: true)
Expand Down
14 changes: 4 additions & 10 deletions docs/tidy-guide.typ
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#import "/src/tidy.typ"

#let version = toml("/typst.toml").package.version
#let import-statement = "#import \"@preview/tidy:" + version + "\""
#show "tidy:0.0.0": "tidy:" + version


Expand All @@ -24,7 +23,7 @@

= Introduction

You can easily feed *tidy* your in-code documented source files and get beautiful documentation of all your functions and variables printed out. // Enjoy features like type annotations, links to other documented definitions and arbitrary formatting within function and parameter descriptions. Let's get started.
You can easily feed *tidy* your in-code documented source files and get beautiful documentation of all your functions and variables printed out.
The main features are:
- Type annotations,
- seamless cross references,
Expand All @@ -38,7 +37,6 @@ First, we import *tidy*.

We now assume we have a Typst module called `repeater.typ`, containing a definition for a function named `repeat()`.

// *Example of some documented source code:*

#let example-code = read("/examples/repeater.typ")
#file-code("repeater.typ", raw(block: true, lang: "typ", example-code))
Expand Down Expand Up @@ -142,7 +140,6 @@ In the output, the preview of the code examples is shown next to it.
), breakable: true)
}
// #pagebreak()
Expand Down Expand Up @@ -339,12 +336,7 @@ As a demonstration, calling #raw(lang: "typ", "#tidy.help(\"parse-module\")") pr
)

}
/*
The feature that will make using *your* package attractive.
Without leaving the editor

The usage and ease of access for typst packages is about to be revolutionized!
*/

This feature supports:
- function and variable definitions,
Expand All @@ -359,8 +351,10 @@ This feature supports:
If you have already documented your code, adding such a help function will require only little further effort in implementation. In your root library file, add some code of the following kind:
#raw(block: true, lang: "typ", ```
#let help(..args) = {
```.text + "\n " + import-statement.slice(1) + "\n" +
```.text +
```
import "@preview/tidy:0.0.0"
let namespace = (
".": read.with("/src/my-package.typ")
)
Expand Down

0 comments on commit 476408d

Please sign in to comment.