Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: extension embedding example #792

Merged
merged 2 commits into from
Jul 25, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions docs/extensions/_formats-common.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,29 @@ contributes:

In some cases format extensions will want to make use of other extensions. This is permitted, but adding extensions for use within a custom format must be done with a special command line flag to ensure they are embedded correctly.

``` {.bash filename="Terminal"}
quarto create extension format:pdf myformat
quarto add quarto-ext/fancy-text --embed myformat
mcanouil marked this conversation as resolved.
Show resolved Hide resolved
```

For example, here we want to make the [fancy-text](https://github.com/quarto-ext/fancy-text) extension (which provides special formatting for the words {{< latex >}} and {{< bibtex >}}) available for users of the [jss](https://github.com/quarto-journals/jss) custom format:

``` {.bash filename="Terminal"}
quarto add quarto-ext/fancy-text --embed quarto-journals/jss
quarto add quarto-ext/fancy-text --embed jss
```

This will produce the following output:

``` {.bash filename="Output"}
quarto-journals/jss
└── _extensions
└── jss
├── _extensions
│ └── quarto-ext
│ └── fancy-text
└── partials
```

This will add the `quarto-ext/fancy-text` extension into the `quarto-journals/jss` extension in the `_extensions` folder. By embedding an extension you make it available without creating the potential for conflict with other versions of the extension that uses might already have installed.
This will add the `quarto-ext/fancy-text` extension into the `jss` extension in the `_extensions` folder. By embedding an extension you make it available without creating the potential for conflict with other versions of the extension that uses might already have installed.

[^_formats-common-1]: This is most common in the the case of PDF based formats which have a secondary step of converting the LaTeX produced by Pandoc into a PDF. If there are files that are referenced indirectly by the LaTeX, they will need to be discoverable and should typically be copied into the same directory that contains the LaTeX input.
Loading