Skip to content

Commit

Permalink
feat: Add support for presentation formats (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcanouil authored May 4, 2024
1 parent db50ed3 commit c69a768
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ jobs:
shell: bash
run: |
echo -e "project:\n output-dir: _site" > _quarto.yml
quarto render example.qmd
for format in html typst pdf docx revealjs beamer pptx; do
quarto render --to ${format}
done
- uses: actions/configure-pages@v5

Expand Down
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/.luarc.json
/.quarto/
_quarto.yml
*.html
*.pdf
*.docx
*.pptx
*_files/
/.luarc.json

/.quarto/
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ Here is the source code for a minimal example: [example.qmd](example.qmd).
This is the output of `example.qmd` for:

- [HTML](https://m.canouil.dev/quarto-highlight-text/)
- [LaTeX/PDF](https://m.canouil.dev/quarto-highlight-text/highlight-latex.pdf)
- [Typst/PDF](https://m.canouil.dev/quarto-highlight-text/highlight-typst.pdf)
- [Docx](https://m.canouil.dev/quarto-highlight-text/highlight-openxml.docx)
- [LaTeX/PDF](https://m.canouil.dev/quarto-highlight-text/highlight-latex.pdf)
- [Word/Docx](https://m.canouil.dev/quarto-highlight-text/highlight-openxml.docx)
- [Reveal.js](https://m.canouil.dev/quarto-highlight-text/highlight-revealjs.html)
- [Beamer/PDF](https://m.canouil.dev/quarto-highlight-text/highlight-beamer.pdf)
- [PowerPoint/Pptx](https://m.canouil.dev/quarto-highlight-text/highlight-pptx.pptx) (*not supported yet*)
40 changes: 35 additions & 5 deletions example.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@ format:
pdf:
output-file: highlight-latex
docx:
output-file: highlight-openxml
output-file: highlight-docx
revealjs:
output-file: highlight-revealjs
beamer:
output-file: highlight-beamer
pptx:
output-file: highlight-pptx
format-links: true
embed-resources: true
execute:
echo: true
filters:
- highlight-text
---
Expand All @@ -36,22 +45,43 @@ filters:
Then you can use the span syntax markup to highlight text in your document.
::: {layout-ncol="2"}
:::: {#uk}
::: {.content-hidden when-format="pptx"}
:::: {layout-ncol="2"}
::::: {#UK}
```markdown
[Red]{colour="#b22222"}
```

[Red]{colour="#b22222"}
::::
:::::

:::: {#us}
::::: {#US}
```markdown
[Blue]{color="#0000FF"}
```

[Blue]{color="#0000FF"}
:::::
::::
:::

::: {.content-visible when-format="pptx"}
:::: {.columns}
::::: {.column width="50%"}
```markdown
[Red]{colour="#b22222"}
```

[Red]{colour="#b22222"}
:::::

::::: {.column width="50%"}
```markdown
[Blue]{color="#0000FF"}
```

[Blue]{color="#0000FF"}
:::::
::::
:::

0 comments on commit c69a768

Please sign in to comment.