MarkdownCodeEmbed 0.1.2
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 Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.