From 2a73abae727d05cbc0e74934deb0be7f5055cb41 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Thu, 14 Nov 2024 13:22:10 +0100 Subject: [PATCH] Ensure our own docs build without errors --- docs/source/markup/admonitions.md | 4 ++-- docs/source/markup/images.md | 5 +++-- docs/source/markup/substitutions.md | 1 - src/Elastic.Markdown/Myst/Directives/ImageBlock.cs | 2 +- src/Elastic.Markdown/Myst/ParserContext.cs | 3 +++ 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/source/markup/admonitions.md b/docs/source/markup/admonitions.md index dbbec01..2bd14ce 100644 --- a/docs/source/markup/admonitions.md +++ b/docs/source/markup/admonitions.md @@ -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 ``` diff --git a/docs/source/markup/images.md b/docs/source/markup/images.md index b41fdf8..d9beb83 100644 --- a/docs/source/markup/images.md +++ b/docs/source/markup/images.md @@ -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** ``` diff --git a/docs/source/markup/substitutions.md b/docs/source/markup/substitutions.md index fba0a40..1b2ffeb 100644 --- a/docs/source/markup/substitutions.md +++ b/docs/source/markup/substitutions.md @@ -8,5 +8,4 @@ Here are some variable substitutions: | Value | Source | | ------------------- | ------------ | -| {{project}} | conf.py | | {{frontmatter_key}} | Front Matter | \ No newline at end of file diff --git a/src/Elastic.Markdown/Myst/Directives/ImageBlock.cs b/src/Elastic.Markdown/Myst/Directives/ImageBlock.cs index d8304a8..e14b503 100644 --- a/src/Elastic.Markdown/Myst/Directives/ImageBlock.cs +++ b/src/Elastic.Markdown/Myst/Directives/ImageBlock.cs @@ -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}"); diff --git a/src/Elastic.Markdown/Myst/ParserContext.cs b/src/Elastic.Markdown/Myst/ParserContext.cs index 1949194..d693e81 100644 --- a/src/Elastic.Markdown/Myst/ParserContext.cs +++ b/src/Elastic.Markdown/Myst/ParserContext.cs @@ -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; }