MarkdownCodeEmbed 0.1.2
.NET Core 2.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet tool install --global MarkdownCodeEmbed --version 0.1.2
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local MarkdownCodeEmbed --version 0.1.2
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=MarkdownCodeEmbed&version=0.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package MarkdownCodeEmbed --version 0.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MarkdownCodeEmbed
MarkdownCodeEmbed is a dotnet tool designed to embed source files into Markdown files.
Note: Currently the tool embeds all code as C# files.
Tool installation
The easiest way to install the tool is to use the dotnet
tool.
dotnet tool install -g MarkdownCodeEmbed
Syntax - Embed code inside Markdown file
To embed code from a source file add following line in the Markdown file:
[embed-code]: # (Path\To\Source\File.cs)
Example
The following source MarkdownFile from LucidCode library: source file (raw file)
Is transformed to: file with embeded code (raw file)
Execute the tool
To embed a code inside Markdown files execute the tool with following parameters
MarkdownCodeEmbed --code DIRECTORY_WITH_SOURCE_FILES --input DIRECTORY_WITH_INPUT_MARKDOWN_FILES --output DIRECTORY_FOR_TRANSFORMED_MARKDOWN_FILES
Build system integration
The tool can be integrated with build system and executed as post-build event.
Commands for the event:
dotnet tool install -g MarkdownCodeEmbed || dotnet tool update -g MarkdownCodeEmbed
MarkdownCodeEmbed --input MARKDOWN_INPUT_DIR --code SOURCE_CODE_DIR --output MARKDOWN_OUTPUT_DIR
Example: Examples project of the LucidCode library: Examples.csproj (raw file)
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows |
.NET Core | netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1 |
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.