Skip to content

Commit

Permalink
Ensure our own docs build without errors (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz authored Nov 14, 2024
1 parent 07e54ad commit 5f06d1b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/source/markup/admonitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ This is a tip
Feature A
```

```{versionchanged} 8.15
```{versionchanged} 8.15.0
Feature B
```

```{deprecated} 2
```{deprecated} 0.2.0
Feature C
```

Expand Down
5 changes: 3 additions & 2 deletions docs/source/markup/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ Here is an image from the local image folder.

We can use the `figure-md` directive to add caption to an image.

```{figure-md}
![Elasticsearch](/_static/img/observability.png){w=350px align=center}
```{figure-md} /_static/img/observability.png
:width: 350px
:align: center
This is a caption in **Markdown**
```
1 change: 0 additions & 1 deletion docs/source/markup/substitutions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ Here are some variable substitutions:

| Value | Source |
| ------------------- | ------------ |
| {{project}} | conf.py |
| {{frontmatter_key}} | Front Matter |
2 changes: 1 addition & 1 deletion src/Elastic.Markdown/Myst/Directives/ImageBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private void ExtractImageUrl(ParserContext context)

ImageUrl = imageUrl;
var imagePath = Path.Combine(includeFrom, imageUrl.TrimStart('/'));
if (context.Build.ReadFileSystem.File.Exists(imageUrl))
if (context.Build.ReadFileSystem.File.Exists(imagePath))
Found = true;
else
EmitError(context, $"`{imageUrl}` does not exist. resolved to `{imagePath}");
Expand Down
3 changes: 3 additions & 0 deletions src/Elastic.Markdown/Myst/ParserContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public ParserContext(MarkdownParser markdownParser,
foreach (var (key, value) in props)
Properties[key] = value;
}

if (frontMatter?.Title is {} title)
Properties["page_title"] = title;
}

public MarkdownParser Parser { get; }
Expand Down

0 comments on commit 5f06d1b

Please sign in to comment.