MarkdownCodeEmbed 0.1.2

There is a newer version of this package available.
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
nuke :add-package MarkdownCodeEmbed --version 0.1.2

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 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.

Version Downloads Last updated
0.2.3 665 9/27/2019
0.2.2 812 3/20/2019
0.2.1 824 2/23/2019
0.2.0 852 2/9/2019
0.1.3 844 2/8/2019
0.1.2 832 2/6/2019
0.1.1 880 2/5/2019
0.1.0 906 2/4/2019