Skip to content

Commit

Permalink
Add support for gif & jpeg images (#370)
Browse files Browse the repository at this point in the history
* Add support for gif images

* include jpeg support as well
  • Loading branch information
Mpdreamz authored Jan 29, 2025
1 parent a78d321 commit 1246c5d
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/syntax/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ Here is the same image used inline ![Elasticsearch](img/observability.png)

Here is the same image used inline ![Elasticsearch](img/observability.png)

### SVG

```markdown
![Elasticsearch](img/alerts.svg)
```
![Elasticsearch](img/alerts.svg)

### GIF

```markdown
![Elasticsearch](img/timeslider.gif)
```
![Elasticsearch](img/timeslider.gif)


## Asciidoc syntax

```asciidoc
Expand Down
62 changes: 62 additions & 0 deletions docs/syntax/img/alerts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/syntax/img/timeslider.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/Elastic.Markdown/IO/DocumentationSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public DocumentationSet(BuildContext context)
.Select(f => context.ReadFileSystem.FileInfo.New(f))
.Select<IFileInfo, DocumentationFile>(file => file.Extension switch
{
".jpg" => new ImageFile(file, SourcePath, "image/jpeg"),
".jpeg" => new ImageFile(file, SourcePath, "image/jpeg"),
".gif" => new ImageFile(file, SourcePath, "image/gif"),
".svg" => new ImageFile(file, SourcePath, "image/svg+xml"),
".png" => new ImageFile(file, SourcePath),
".md" => CreateMarkDownFile(file, context),
Expand Down

0 comments on commit 1246c5d

Please sign in to comment.