-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add "preset" option to adjust output files to target renderer
Adds the option to specify a "preset" to optimize the generated documents for a specific Markdown renderer. In the commandline version of MdDocs, the perset can be specified Using the '--markdown-preset' parameter, for the MSBuild-integrated version, the preset can be set using the 'MdDocsMarkdownPreset' MSBuild property. The currently only preset other than 'Default' is 'MkDocs', which generates Markdown suited to be included in a MkDocs projects. At the moment the preset does not change the document structure being generated, but uses the corresponding preset from the 'MarkdownGenerator' libary, which adjust the output for MkDocs by: - Increasing the number of characters used to indent nested lists - Changing the escaping of '<' and '>' to '<' respectively '>'
- Loading branch information
Showing
11 changed files
with
167 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Grynwald.MarkdownGenerator; | ||
|
||
namespace Grynwald.MdDocs.Common | ||
{ | ||
public static class DocumentSetExtensions | ||
{ | ||
public static void Save<T>(this DocumentSet<T> documentSet, string directoryPath, bool cleanOutputDirectory, MdSerializationOptions markdownOptions) where T : IDocument | ||
{ | ||
documentSet.Save(directoryPath, cleanOutputDirectory, (document, path) => | ||
{ | ||
if (document is MdDocument mdDocument) | ||
{ | ||
mdDocument.Save(path, markdownOptions); | ||
} | ||
else | ||
{ | ||
document.Save(path); | ||
} | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.