Create documents, resumes, or presentations from a collection of Svelte files. No configuration needed, and exports to a very portable PDF file.
> [!IMPORTANT]
> This is an experimental project and more of a toy than something ready for production use. You shouldn't use this for anything (too) serious.
## Usage
### Getting started
Install `svelte-document` from `npm` as a global package, then invoke it in any directory containing `.svelte` pages that you want formatted into a PDF. A file called `document.pdf` will be generated in the current working directory.
```sh
# Install the package globally
npm install -g svelte-document
# Invoke the command
svelte-document
```
### Page semantics and ordering
To order your pages is to simply number them: `1.svelte`, `2.svelte`, `3.svelte`, and so on. The order which your filesystem presents the files do not impact the order in the document. You can also title your page by inserting any contents after a space character, like so: `5 How to Install Linux.svelte`.
You can also use periods in your number to create subsections if needed, such as in `5.1 Troubleshooting.svelte`.
Folders are not parsed, so you can use them to store components and assets, and files starting with `+` are ignored, save for `+layout.svelte` (explained later).
### Page metadata in components
You can export the following Svelte variables in a `` block and they will be automatically filled in by the tool:
| Variable name | Description |
| ------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `page_name` | The name of the page provided after the page index in your file name. If there is no name, this value will be empty (`""`). |
| `page_path` | The full path to the current page component. |
| `page_index` | The page index from the file name. This is a string. |
| `page_count` | The number of the page, starting from 1. This is an integer. |
### Importing assets
#### Images
You can import images directly like so:
```svelte
```
#### Fonts
Fonts can also be imported. The file name of the font can be used in `font-family` styling, like so:
```svelte