Skip to content

Commit

Permalink
🌄 Fix unsplash images (#1292)
Browse files Browse the repository at this point in the history
Currently all unsplash images are broken, this pins them to images that I have taken.
  • Loading branch information
rowanc1 authored Jun 13, 2024
1 parent 464b955 commit 7190846
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/asides.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Asides provide an easy way to represent content that is only indirectly related
```{aside} Margin Content
Here’s some margin content! It was created by using the {myst:directive}`margin` directive in a Markdown, we can include images:
![](https://source.unsplash.com/random/400x75?sunset)
![](https://github.com/rowanc1/pics/blob/main/sunset.png)
or any other sort of content!
```
Expand Down
4 changes: 2 additions & 2 deletions docs/commonmark.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Link with alternative text and optional title:
Link to an image can be done similar to other inline links, or you may use HTML syntax to include image size, etc.

```{myst}
![alt](https://source.unsplash.com/random/500x200/?fruit "title")
![alt](https://github.com/rowanc1/pics/blob/main/apples.png?raw=true "title")
```

```{seealso}
Expand All @@ -184,5 +184,5 @@ break
```

```{seealso}
[](./typography.md) provides other roles for subscript, superscript, abbeviations, and other text formatting.
[](./typography.md) provides other roles for subscript, superscript, abbreviations, and other text formatting.
```
2 changes: 1 addition & 1 deletion docs/cross-references.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ There are many ways that you can label a target, and the sections below describe
Targets are custom anchors that you can refer to elsewhere, for example, a figure, section, table, program, or proof. To be referenced, they must have a `label`/`identifier` pair [in the AST](xref:spec#association). These can be created by setting the `label` option in many directives. For example, to label and reference a figure, use the following syntax:

````{myst}
```{figure} https://source.unsplash.com/random/500x200/?mountain
```{figure} https://github.com/rowanc1/pics/blob/main/mountains.png?raw=true
:label: my-fig
:align: center
Expand Down
9 changes: 5 additions & 4 deletions docs/embed.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ To attach labels to Jupyter Notebook content, see [](./reuse-jupyter-outputs.md)
For the examples below, we are defining a figure with a label:

```markdown
:::{figure} https://source.unsplash.com/random/400x200?beach,ocean
:::{figure} https://github.com/rowanc1/pics/blob/main/mountains.png
:label: myLabel
Here's a cool figure.
:::
```

:::{figure} https://source.unsplash.com/random/400x200?beach,ocean
:::{figure} https://github.com/rowanc1/pics/blob/main/mountains.png
:label: myLabel
Here's a cool figure.
:::
Expand Down Expand Up @@ -78,11 +78,11 @@ For example, we'll define an image with a label below:

```
(nice-sunset)=
![](https://source.unsplash.com/random/500x150?sunset)
![](https://github.com/rowanc1/pics/blob/main/sunset.png)
```

(nice-sunset)=
![](https://source.unsplash.com/random/500x150?sunset)
![](https://github.com/rowanc1/pics/blob/main/sunset.png)

And embed it into a figure next with a new `label`:

Expand Down Expand Up @@ -125,6 +125,7 @@ You can then refer to content in these sites in two ways:
```md
![](xref:spec#admonition)
```

2. The {myst:directive}`Embed directive <embed>`:

```md
Expand Down
4 changes: 2 additions & 2 deletions docs/exercises.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ to include in an exercise or solution admonition.

and maybe you wish to add a figure

```{figure} https://source.unsplash.com/random/400x200?beach,ocean
```{figure} https://github.com/rowanc1/pics/blob/main/beach.png

```

Expand All @@ -269,7 +269,7 @@ and maybe you wish to add a figure

and maybe you wish to add a figure

```{figure} https://source.unsplash.com/random/400x200?beach,ocean
```{figure} https://github.com/rowanc1/pics/blob/main/sunset.png
```

Expand Down
19 changes: 10 additions & 9 deletions docs/figures.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ There are two directives that can be used to add additional information about th
## Image directive

````{myst}
```{image} https://source.unsplash.com/random/500x150?sunset
:alt: Beautiful Sunset
```{image} https://github.com/rowanc1/pics/blob/main/grapes-wide.png?raw=true
:alt: Grapes on a vineyard
:width: 500px
:align: center
```
Expand All @@ -44,9 +44,9 @@ There are two directives that can be used to add additional information about th
## Figure directive

````{myst}
```{figure} https://source.unsplash.com/random/400x200?beach,ocean
```{figure} https://github.com/rowanc1/pics/blob/main/sunset.png?raw=true
:label: myFigure
:alt: Random image of the beach or ocean!
:alt: Sunset at the beach
:align: center
Relaxing at the beach 🏝 🌊 😎
Expand All @@ -66,8 +66,8 @@ These will be numbered as `Figure 1a` and `Figure 1b`, etc. For example:
:label: subFigure
:align: left

![Banff, Canada](https://source.unsplash.com/random/600x225?banff)
![Golden Gate Bridge, San Francisco](https://source.unsplash.com/random/600x225?golden-gate)
![Banff, Canada](https://github.com/rowanc1/pics/blob/main/banff-wide.png)
![Golden Gate Bridge, San Francisco](https://github.com/rowanc1/pics/blob/main/sfo-wide.png)

We saw some great things on our trips this year to Banff, Canada 🇨🇦 and San Francisco, USA 🌉.
:::
Expand All @@ -80,11 +80,11 @@ You can also cross-reference either the whole figure [@subFigure], or an individ
:align: left
(my-figure-fruit)=
![Here is some fruit 🍌](https://source.unsplash.com/random/600x100?fruit)
![Here is some fruit 🍏](https://github.com/rowanc1/pics/blob/main/apples-wide.png?raw=true)
![My beach pics! 🏝](https://source.unsplash.com/random/600x100?beach)
![My vacation pics! 🏝](https://github.com/rowanc1/pics/blob/main/ocean-wide.png?raw=true)
Some pictures of fruit and beaches!
Some pictures of fruit and the ocean!
:::
See [](#my-figure-fruit) for the fruit, and [](#my-figure) to reference both subfigures.
Expand Down Expand Up @@ -163,6 +163,7 @@ The image transforms and optimizations requires you to have the following packag
:::

(figures:multiple-images)=

### Multiple Images

If you have manually converted your images or have different images for different formats, use an asterisk (`*`) as the extension. All images matching the provided pattern will be found and the best image out of the available candidates will be used for the export:
Expand Down
5 changes: 3 additions & 2 deletions docs/quickstart-myst-markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ For example, try editing the following {myst:directive}`figure` directive, you c

```{myst}
:::{figure} https://source.unsplash.com/random/400x200?meditation
:::{figure} https://github.com/rowanc1/pics/blob/main/banff-tall.png?raw=true
:align: right
:width: 40%
The picture would look better if it is `:align: center`-ed!
:::
Expand Down Expand Up @@ -126,7 +127,7 @@ To link to a document, for example [](./frontmatter.md), is done through a simpl
To create a cross-reference, you need to label a "target", like a figure, section, equation or table (or anything!!). To be referenceable, these elements can add the `label` option in many directives. To then reference the figure, use the link syntax again pointing to the label as the target `[](#my-fig)`. If you leave the title blank the default will fill in with an enumerated "Figure 1".

````{myst}
```{figure} https://source.unsplash.com/random/500x200/?mountain
```{figure} https://github.com/rowanc1/pics/blob/main/mountains.png?raw=true
:label: my-fig
:align: center
Expand Down
4 changes: 2 additions & 2 deletions docs/typography.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Term 3
: > A quote
: A final definition, that can even include images:
![Beach!](https://source.unsplash.com/random/400x200?beach,ocean)
![Sunset at the Beach!](https://github.com/rowanc1/pics/blob/main/sunset.png?raw=true)
```
````

Expand Down Expand Up @@ -220,7 +220,7 @@ That's exactly right[^1].
- and some *serious* points 💥
- and even images!
![Beach!](https://source.unsplash.com/random/400x200?beach,ocean)
![Mountains!](https://github.com/rowanc1/pics/blob/main/mountains.png?raw=true)
Plus any preceding unindented lines,
that are not separated by a blank line
Expand Down

0 comments on commit 7190846

Please sign in to comment.