mdzip-core
1.3.3
Suggested Alternatives
Additional Details
This package has been renamed to MDZip.Core to match the project's MDZip.* NuGet naming scheme. mdzip-core will remain listed for existing consumers but receives no further updates — please migrate your PackageReference to MDZip.Core. See https://github.com/mdzip-project/mdzip-core for details.
dotnet add package mdzip-core --version 1.3.3
NuGet\Install-Package mdzip-core -Version 1.3.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="mdzip-core" Version="1.3.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="mdzip-core" Version="1.3.3" />
<PackageReference Include="mdzip-core" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add mdzip-core --version 1.3.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: mdzip-core, 1.3.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package mdzip-core@1.3.3
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=mdzip-core&version=1.3.3
#tool nuget:?package=mdzip-core&version=1.3.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
mdzip-core
Core .NET library for working with .mdz archives.
mdzip-core provides APIs to:
- create
.mdzarchives from folders or explicit file mappings - extract archives safely
- list archive contents
- read
manifest.json - resolve the archive entry point
- validate archives against path and manifest rules
Package Info
- Package ID:
mdzip-core - Target framework:
.NET 8 - Output assembly:
mdzip.core.dll - Main namespace:
MDZip.Core
Installation (NuGet.org)
Install the package from NuGet.org:
dotnet add package mdzip-core
Quick Start
using MDZip.Core;
using MDZip.Core.Models;
// Create from a directory
MdzArchive.Create(
outputPath: "book.mdz",
sourceDirectory: "content",
manifest: new Manifest
{
Spec = new ManifestSpec { Name = "markdownzip-spec", Version = "1.1.0-draft" },
Title = "My Document",
EntryPoint = "index.md"
});
// Validate
var result = MdzArchive.Validate("book.mdz");
Console.WriteLine(result.IsValid);
// List entries
var files = MdzArchive.List("book.mdz");
// Add or replace a file in-place
MdzArchive.AddFile("book.mdz", "assets/notes.txt", "local-notes.txt");
// Remove a file in-place
MdzArchive.RemoveFile("book.mdz", "assets/old-image.png");
// Extract
MdzArchive.Extract("book.mdz", "out");
Public API
MdzArchive:
Create(string outputPath, string sourceDirectory, Manifest? manifest = null)CreateFromFiles(string outputPath, IEnumerable<(string ArchivePath, string LocalPath)> files, Manifest? manifest = null)AddFile(string archivePath, string archiveEntryPath, string localFilePath)RemoveFile(string archivePath, string archiveEntryPath)Extract(string archivePath, string destinationDirectory)List(string archivePath)ListDetailed(string archivePath)ReadManifest(string archivePath)ResolveEntryPoint(string archivePath)Validate(string archivePath)
Additional types:
ValidationResultArchiveEntryPathValidatorManifest,ManifestSpec,ManifestAuthor,ManifestProducer,ManifestAgent,ManifestFile
Notes on Validation Behavior
- Entry paths are validated for traversal attempts and OS-reserved characters.
manifest.jsonis optional, but if present it is parsed and validated.- Supported manifest
spec.versionmajor version is1(when present). - Entry point resolution order:
manifest.entryPoint(must reference a.mdor.markdownfile)- root
index.md - exactly one root markdown file (
.mdor.markdown)
Development
Build locally:
dotnet restore src/mdzip-core/mdzip-core.csproj
dotnet build src/mdzip-core/mdzip-core.csproj --configuration Release
Pack locally:
dotnet pack src/mdzip-core/mdzip-core.csproj --configuration Release -o out
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.