-
Couldn't load subscription status.
- Fork 32
#1552 Title in HTML head #2044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
#1552 Title in HTML head #2044
Conversation
… and at the end of the build reports the repeated document titles.
| markdownExporters.Add(new ElasticsearchMarkdownSemanticExporter(logFactory, context.Collector, indexNamespace, context.Endpoints)); | ||
| if (exportOptions.Contains(Exporter.ElasticsearchNoSemantic)) | ||
| markdownExporters.Add(new ElasticsearchMarkdownExporter(logFactory, context.Collector, indexNamespace, context.Endpoints)); | ||
| markdownExporters.Add(new MarkdownValidationExporter()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| markdownExporters.Add(new MarkdownValidationExporter()); | |
| markdownExporters.Add(new MarkdownValidationExporter(context.Collector)); |
|
|
||
| namespace Elastic.Markdown.Exporters; | ||
|
|
||
| public class MarkdownValidationExporter : IMarkdownExporter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public class MarkdownValidationExporter : IMarkdownExporter | |
| public class MarkdownValidationExporter(IDiagnosticsCollector collector) : IMarkdownExporter |
| { | ||
| var title = kv.Key; | ||
| var filePaths = string.Join(", ", files.Select(f => f.FilePath)); | ||
| Console.WriteLine($"Error: Title '{title}' is used in multiple files: {filePaths}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Console.WriteLine($"Error: Title '{title}' is used in multiple files: {filePaths}"); | |
| collector.EmitError(filePaths.First(), $"Title '{title}' is used in multiple files: {filePaths}"); |
Added a Markdown validation exporter. It collects the document titles and at the end of the build reports the repeated document titles.
This PR is not complete. It currently reports the repeated document titles by writing to the console. The StopAsync() method of an exporter doesn't have access to a build context to report the errors to the build.