File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Elastic.Documentation.Configuration/Diagram
Elastic.Markdown/Myst/Directives/Diagram Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ public async Task<int> CreateDiagramCachedFiles(Cancel ctx)
8383 if ( directory != null && ! _writeFileSystem . Directory . Exists ( directory ) )
8484 _ = _writeFileSystem . Directory . CreateDirectory ( directory ) ;
8585
86+ _logger . LogWarning ( "Creating local diagram: {LocalPath}" , localPath ) ;
8687 // Download SVG content
8788 var svgContent = await _httpClient . GetStringAsync ( diagramInfo . EncodedUrl , ct ) ;
8889
Original file line number Diff line number Diff line change @@ -72,8 +72,11 @@ public override void FinalizeAndValidate(ParserContext context)
7272 // only register SVG if we can look up the Markdown
7373 if ( context . DocumentationFileLookup ( context . MarkdownSourcePath ) is MarkdownFile currentMarkdown )
7474 {
75- var path = context . Build . ReadFileSystem . FileInfo . New ( Path . Combine ( currentMarkdown . ScopeDirectory . FullName , localPath ) ) ;
76- context . DiagramRegistry . RegisterDiagramForCaching ( path , EncodedUrl ) ;
75+ var fs = context . Build . ReadFileSystem ;
76+ var scopePath = fs . FileInfo . New ( Path . Combine ( currentMarkdown . ScopeDirectory . FullName , localPath ) ) ;
77+ var relativeScopePath = fs . Path . GetRelativePath ( context . Build . DocumentationSourceDirectory . FullName , scopePath . FullName ) ;
78+ var outputPath = fs . FileInfo . New ( Path . Combine ( context . Build . DocumentationOutputDirectory . FullName , relativeScopePath ) ) ;
79+ context . DiagramRegistry . RegisterDiagramForCaching ( outputPath , EncodedUrl ) ;
7780 }
7881 else
7982 this . EmitError ( $ "Can not locate markdown source for { context . MarkdownSourcePath } to register diagram for caching.") ;
You can’t perform that action at this time.
0 commit comments