Skip to content

Commit 5c00933

Browse files
authored
feat: merge PR to integrate new 'format' page (lter/ssecr#62)
Add Page for Small Formatting Tips/Tricks
2 parents 7fdc597 + 6c3bcf0 commit 5c00933

2 files changed

Lines changed: 125 additions & 0 deletions

File tree

_quarto.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ website:
4747
href: edit.qmd
4848
- text: "Customize a Website"
4949
href: customize.qmd
50+
- text: "Formatting Notes"
51+
href: format.qmd
5052
page-footer:
5153
center: "Copyright 2025, LTER Network"
5254
background: secondary

format.qmd

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
title: "Formatting Odds & Ends"
3+
---
4+
5+
## Module Learning Objectives
6+
7+
By the end of this module, you will be able to:
8+
9+
- <u>Use</u> the formatting tips demonstrated in the module
10+
11+
## Format Background
12+
13+
This module is slightly different than the others in that it is sort of a 'grab bag' of miscellaneous formatting tools rather than a clear, sequential tutorial. However, if you do not have much experience with Markdown, some of these operations are likely to be valuable to you and thus make sense to include in a workshop like this one (though admittedly not as part of the core content of said workshop).
14+
15+
## Embedding Images
16+
17+
There are several methods for embedding an image in a Quarto document. In this author's view, the most flexible is the one that uses HTML syntax so, even if you don't have much experience with that language, it is still worth using it for this specific purpose. Let's begin with embedding an image in the simplest way and then build from there.
18+
19+
See the tabs below for what you will write in your `.qmd` file versus what a visitor to your site will see respectively.
20+
21+
:::{.panel-tabset}
22+
### Back End
23+
24+
```
25+
<img src="images/logos/lter.png" alt="LTER Network logo" width="10%" align="left"/>
26+
```
27+
28+
In the above code we've specified the "alternative text" (what people who use screen readers will 'see' when they encounter this image) as well as the width of the image and its alignment). Note also that parameters (e.g., `src`, `align`, etc. ) are not separated by anything! Comparable R code would typically separate arguments with commas but that is not the case with HTML
29+
30+
### Front End
31+
32+
<img src="images/logos/lter.png" alt="LTER Network logo" width="10%" align="left"/>
33+
34+
<br>
35+
<br>
36+
<br>
37+
38+
:::
39+
40+
Unfortunately, the `align` parameter used above only accepts `"left"` or `"right"`. In order to center-align, we'll need to add some code.
41+
42+
:::{.panel-tabset}
43+
### Back End
44+
45+
```
46+
<p align="center">
47+
<img src="images/logos/lter.png" alt="LTER Network logo" width="10%"/>
48+
</p>
49+
```
50+
### Front End
51+
52+
<p align="center">
53+
<img src="images/logos/lter.png" alt="LTER Network logo" width="10%"/>
54+
</p>
55+
56+
:::
57+
58+
If we wanted to add a figure caption to the image we can extend this syntax even further!
59+
60+
:::{.panel-tabset}
61+
### Back End
62+
63+
```
64+
<p>
65+
<img src="images/logos/lter.png" alt="LTER Network logo" width="10%"/>
66+
<figcaption>This is the LTER network logo</figcaption>
67+
</p>
68+
```
69+
### Front End
70+
71+
<p>
72+
<img src="images/logos/lter.png" alt="LTER Network logo" width="10%"/>
73+
<figcaption>This is the LTER network logo</figcaption>
74+
</p>
75+
76+
:::
77+
78+
## Hyperlinking Text
79+
80+
Hyperlinking text can be really nice if you want to avoid making visitors to your site manually copy/paste links. This can also be nice if you want to change where an existing website routes people without changing their view of the site. For example, imagine a collaborator has their website linked in the Quarto website but they change institutions and their website link changes. If you embed the hyperlink you can simply change that and the same hyperlinked text that was always in your site will seamlessly redirect users to the correct location.
81+
82+
See the tabs below for what you will write in your `.qmd` file versus what a visitor to your site will see respectively.
83+
84+
:::{.panel-tabset}
85+
### Back End
86+
87+
```
88+
Visit [the workshop website](https://lter.github.io/workshop-quarto/) for more details!
89+
```
90+
91+
### Front End
92+
93+
Visit [the workshop website](https://lter.github.io/workshop-quarto/) for more details!
94+
95+
:::
96+
97+
98+
## Collapsible Sections
99+
100+
This is a little more niche but can be really useful in teaching contexts where you want to have some piece of information readily-accessible without being automatically visible to learners. For instance, you could provide some practice problems with associated answers (or hints) but learners would have to click something to expand the section including that hidden information.
101+
102+
See the tabs below for what you will write in your `.qmd` file versus what a visitor to your site will see respectively.
103+
104+
:::{.panel-tabset}
105+
### Back End
106+
107+
```
108+
<details>
109+
<summary>Click Me!</summary>
110+
Hello!
111+
</details>
112+
```
113+
114+
You can of course change the text between the `summary` tags to tailor the button prompt to your context.
115+
116+
### Front End
117+
118+
<details>
119+
<summary>Click Me!</summary>
120+
Hello!
121+
</details>
122+
123+
:::

0 commit comments

Comments
 (0)