AdocNet.Converters.Man
1.0.23
dotnet add package AdocNet.Converters.Man --version 1.0.23
NuGet\Install-Package AdocNet.Converters.Man -Version 1.0.23
<PackageReference Include="AdocNet.Converters.Man" Version="1.0.23" />
<PackageVersion Include="AdocNet.Converters.Man" Version="1.0.23" />
<PackageReference Include="AdocNet.Converters.Man" />
paket add AdocNet.Converters.Man --version 1.0.23
#r "nuget: AdocNet.Converters.Man, 1.0.23"
#:package AdocNet.Converters.Man@1.0.23
#addin nuget:?package=AdocNet.Converters.Man&version=1.0.23
#tool nuget:?package=AdocNet.Converters.Man&version=1.0.23
Adoc.Net
A pure managed C# AsciiDoc library for .NET. No external runtime dependencies.
Adoc.Net parses AsciiDoc into a typed AST and renders it to HTML5, PDF, DocBook 5.0, EPUB 3.0, man pages, or reveal.js slides. HTML rendering supports custom per-node templates via INodeTemplate. It multi-targets .NET 10 and .NET 8 (optimized) plus .NET Standard 2.0 (broad compatibility: .NET Framework 4.6.1+, .NET Core 2.0+, Mono, Unity, Xamarin).
Asciidoctor parity
AdocNet 1.0 produces output that is structurally identical to Asciidoctor
(zero DOM diff) for HTML, DocBook, and Reveal.js across the full 36-document
conformance corpus (spec/conformance/*.adoc, verified via tools/parity-sweep.py,
which renders both with matching options and compares the structural DOM). EPUB ships
the same asset payload as asciidoctor-epub3 (fonts, stylesheets, default
images) with a dedicated chapter renderer emitting the reference's semantic
HTML5; readers see indistinguishable output. Man output is cleaner roff than
the reference while remaining structurally equivalent. See CHANGELOG.md for
the v1.0 parity arc.
| Format | Per-doc diff (sum, 36-doc corpus) | Perfect-match docs |
|---|---|---|
| HTML | 0 | 36/36 ✓ |
| DocBook | 0 | 36/36 ✓ |
| Reveal.js (slide DOM) | 0 | 36/36 ✓ |
| Man | 5,510 (stylistic roff) | 11/36 |
| EPUB | 87 (small structural residuals) | 0/36, visually indistinguishable |
Installation
The meta-package pulls in the core parser plus the HTML and PDF renderers:
dotnet add package AdocNet
Which package do I need?
For library use, reference the package for the output you want. (The AdocNet.Pdf,
AdocNet.Epub, etc. IDs are command-line tools, not libraries — for code, use the
AdocNet.Converters.* packages below.)
| Task | Library package (dotnet add package …) |
|---|---|
| Parse + AST | AdocNet (or AdocNet.Parser + AdocNet.Ast) |
| Render HTML | AdocNet.Converters.Html (included in AdocNet) |
| Render PDF | AdocNet.Converters.Pdf (included in AdocNet) |
| Render DocBook | AdocNet.Converters.DocBook |
| Render EPUB | AdocNet.Converters.Epub |
| Render man page | AdocNet.Converters.Man |
| Render Reveal.js | AdocNet.Converters.Revealjs |
| Avalonia UI renderer | AdocNet.Avalonia |
| Emit AsciiDoc from an AST | AdocNet.Emitter |
Import Word .docx |
AdocNet.Importers.Docx |
Command-line tools
These are dotnet tool packages (not referenceable libraries):
dotnet tool install --global AdocNet.Tool # adocnet (HTML default)
dotnet tool install --global AdocNet.Pdf # adocnet-pdf
dotnet tool install --global AdocNet.Epub # adocnet-epub
dotnet tool install --global AdocNet.DocBook # adocnet-docbook
dotnet tool install --global AdocNet.Docx # docx2adoc (.docx → AsciiDoc)
Quick Start
using AdocNet;
// One line — that's it
string html = Adoc.ToHtml("= Hello\n\nThis is *bold* text.");
More control
// Styled full HTML document with CSS theme
string page = Adoc.ToStyledHtml(source, HtmlTheme.Asciidoctor);
// PDF output
byte[] pdf = Adoc.ToPdf(source);
// Write directly to a stream (no intermediate string)
using var file = File.Create("output.html");
Adoc.ToHtml(source, file);
// Convert a file with include resolution
Adoc.ConvertFile("docs/chapter.adoc", file);
// Parse with diagnostics
var result = Adoc.Parse(source);
if (result.HasErrors)
foreach (var d in result.Diagnostics) Console.WriteLine(d);
Full API (when you need options)
using AdocNet; // ParseOptions, RenderToString extension
using AdocNet.Parser; // AdocParser
using AdocNet.Converters.Html; // HtmlRenderer, HtmlRenderOptions, HtmlTheme
var result = AdocParser.Parse(source, new ParseOptions
{
SourceFilePath = "docs/chapter.adoc", // enables include resolution
Attributes = new Dictionary<string, string> { ["version"] = "2.0" },
});
var html = new HtmlRenderer().RenderToString(result.Document,
new HtmlRenderOptions { Theme = HtmlTheme.Asciidoctor });
Render to PDF
using AdocNet.Converters.Pdf;
byte[] pdf = new PdfRenderer().RenderToBytes(result.Document);
File.WriteAllBytes("output.pdf", pdf);
Render to DocBook
// dotnet add package AdocNet.Converters.DocBook
using AdocNet; // RenderToString extension
using AdocNet.Converters.DocBook;
string xml = new DocBookRenderer().RenderToString(result.Document);
Render to EPUB
// dotnet add package AdocNet.Converters.Epub
using AdocNet.Converters.Epub;
byte[] epub = new EpubRenderer().RenderToBytes(result.Document);
File.WriteAllBytes("output.epub", epub);
Import a Word document
// dotnet add package AdocNet.Importers.Docx
using AdocNet.Importers.Docx;
var importer = new DocxImporter();
string adoc = importer.ToAsciiDoc("handbook.docx");
// Or keep the AST, extracted images, and the fidelity report
var imported = importer.ImportFile("handbook.docx");
Console.Write(imported.Report.ToSummary()); // fidelity: 99.63% (272/273 units) …
Structure, lists, tables, images, links, notes and formatting are mapped; anything AsciiDoc cannot express (page geometry, tab stops, shapes) is listed in the report rather than dropped silently. See docs/DOCX_IMPORT.md.
Parse with includes
var text = File.ReadAllText("book.adoc");
var result = AdocParser.Parse(text, new ParseOptions
{
SourceFilePath = "book.adoc",
});
Check for errors
if (result.HasErrors)
{
foreach (var diag in result.Diagnostics.Where(d => d.IsError))
Console.Error.WriteLine(diag);
}
CLI Tools
# General-purpose (default: HTML)
adocnet input.adoc # → input.html
adocnet input.adoc -b pdf # → input.pdf
adocnet input.adoc -o - # → stdout
# Specialized tools (same flags, different default format)
adocnet-pdf input.adoc # → input.pdf
adocnet-epub input.adoc # → input.epub
adocnet-docbook input.adoc # → input.xml
# Common options (all tools)
adocnet input.adoc -o custom.html # explicit output file
adocnet input.adoc -a version=2.0 # set document attribute
adocnet docs/ -r -D build/ # convert directory
adocnet docs/ --watch -v # watch and rebuild
adocnet preview input.adoc # live preview with hot reload
# Built-in HTML themes (require -e for full document with embedded CSS)
adocnet input.adoc -e --theme default # AdocNet's bold, modern default
adocnet input.adoc -e --theme asciidoctor # iconic Asciidoctor red-on-cream look
adocnet input.adoc -e --theme clean # minimal monochrome
adocnet input.adoc -e --theme github # GitHub-flavoured markdown style
The --theme asciidoctor option is for users migrating from Asciidoctor
who want their HTML output to look familiar — it reproduces the iconic
red section headings, serif body, and centered layout.
See docs/CLI.md for the full reference.
Supported AsciiDoc Features
Block-level
| Feature | Status |
|---|---|
| Document title, author, revision | Supported |
Section headings (==/## through ======/######) |
Supported |
| Paragraphs | Supported |
| Unordered, ordered, description (Q&A, horizontal), and nested lists | Supported |
| Checklists | Supported |
| Tables (header/footer, column specs, spans, alignment, cell styles) | Supported |
| Source blocks with language and callouts | Supported |
Markdown fenced code blocks (``` with optional language) |
Supported |
| Listing, literal, example, open, sidebar, verse, quote blocks | Supported |
Markdown-compatible blockquotes (> prefix) |
Supported |
| Admonitions (NOTE, TIP, WARNING, IMPORTANT, CAUTION) | Supported |
| Include directives (files, partial includes, leveloffset, indent) | Supported |
| Conditional directives (ifdef, ifndef, ifeval) | Supported |
Document attributes (:name: value, line continuation with \) |
Supported |
Conditional attribute substitution ({foo?yes}, {foo!no}) |
Supported |
Table of contents (:toc:, toc::[] macro placement) |
Supported |
Book doctype section styles ([appendix], [glossary], etc.) |
Supported |
| Book doctype parts (level-0 sections as "Part I", "Part II") | Supported |
| Block images, video, audio macros | Supported |
| Anchors, cross-references, inter-document xrefs | Supported |
| Footnotes with back-references | Supported |
| Bibliography sections | Supported |
| Page breaks, horizontal rules | Supported |
Inline
| Feature | Status |
|---|---|
| Bold, italic, monospace, highlight | Supported |
Nested formatting (*_bold italic_*) |
Supported |
| Bare URLs, link macros, email links | Supported |
| Image macros | Supported |
Attribute references ({name}) |
Supported |
Passthrough (+text+, pass:[text]) |
Supported |
Cross-references (<<id>>) |
Supported |
| Footnotes | Supported |
Superscript (^text^), subscript (~text~) |
Supported |
| Smart punctuation (em/en dash, ellipsis, curly quotes) | Supported |
Inline macros (kbd:[], btn:[], menu:[]) |
Supported |
Rendering Features
| Feature | HTML | |
|---|---|---|
| Built-in themes (Default, Asciidoctor, Clean, Github) | 4 themes | Style presets |
| Syntax highlighting (C#, Java, JS, Python, JSON, XML, SQL) | Server-side <span> classes |
Per-token color operators |
| Hyphenation (English, Liang/Knuth algorithm) | N/A (browser CSS) | Enabled via option |
| Custom styling | Custom CSS override | Color/spacing properties |
| TrueType font embedding with Unicode | N/A | Full Unicode support |
Processing Extensions
| Feature | Status |
|---|---|
Document processors (IDocumentProcessor) |
Supported |
Block processors (IBlockProcessor) |
Supported |
Inline processors (IInlineProcessor) |
Supported |
| Diagram blocks (PlantUML, Mermaid, Ditaa, Graphviz) | Supported (external tool) |
Node replacement and removal (NodeReplacements) |
Supported |
Warning callback (OnWarning) |
Supported |
Dynamic extension loading (LoadExtension, --extensions) |
Supported |
Extension packaging (ext install, ext list, ext remove) |
Supported |
Extension registry (ext info, ext search, dependency validation) |
Supported |
Extension safety (ext status, failure disabling, API version) |
Supported |
Output processors (IOutputProcessor, post-render transforms) |
Supported |
| Kroki diagram runner (HTTP-based, no local tools needed) | Supported |
Extension lifecycle (IExtensionLifecycle) |
Supported |
Extension enable/disable (ext enable, ext disable) |
Supported |
Zip-based extension install (ext install myext.zip) |
Supported |
Extension diagnostics (RenderContext.AddDiagnostic) |
Supported |
Extension capabilities (IExtensionCapabilities, determinism declaration) |
Supported |
Extension priority (IExtensionPriority, execution ordering) |
Supported |
Max engine version (maxAdocNetVersion in manifest) |
Supported |
| bool Process() return with short-circuiting | Supported |
| AssemblyLoadContext isolation (net6.0+) | Supported |
Extension hot-reload (EnableHotReload, FileSystemWatcher) |
Supported |
| Dependency-ordered loading (topological sort) | Supported |
Extension signing verification (publicKeyToken) |
Supported |
Extension validation tool (ext validate) |
Supported |
Performance
| Feature | Status |
|---|---|
| Parse cache (SHA-256 keyed LRU) | Supported |
| Render cache (composite key, deterministic extensions only) | Supported |
| Persistent cache (disk-based, cross-session render cache) | Supported |
Editor Integration
| Feature | Status |
|---|---|
| DocumentChange model for incremental edits | Supported |
| DocumentSnapshot versioned document state | Supported |
Cache-aware incremental re-parse (ParseIncremental) |
Supported |
AST structural hashing (StructuralHash) |
Supported |
Section-level tree diff (AstDiffer) |
Supported |
Incremental HTML rendering (IncrementalHtmlRenderer) |
Supported |
| Extension diagnostics after Convert() | Supported |
Collapsible blocks ([%collapsible] with <details>/<summary>) |
Supported |
Data URI embedding (:data-uri: for inline base64 images) |
Supported |
Font Awesome CSS injection (:icons: font) |
Supported |
Docinfo injection (:docinfo: header/footer files) |
Supported |
| Safe modes (Unsafe, Safe, Server, Secure) | Supported |
STEM/Math (MathJax, stem:[], latexmath:[], asciimath:[]) |
Supported |
Rendering attributes: :sectanchors:, :sectlinks:, :hide-uri-scheme: |
Supported |
Rendering attributes: :source-language:, :linkattrs:, :webfonts: |
Supported |
Rendering attributes: :nofooter:, :nofootnotes:, :notitle:, :last-update-label: |
Supported |
YAML front matter stripping (:skip-front-matter:, stored as :front-matter: attribute) |
Supported |
CSS delivery attributes: :stylesheet:, :linkcss:, :stylesdir: |
Supported |
$$...$$ stem delimiters (block and inline, scoped to :stem:) |
Supported |
:max-include-depth: document attribute (document-level cap, capped at API maximum) |
Supported |
Architecture
Focused assemblies, each with a single responsibility:
| Assembly | Namespace | Description |
|---|---|---|
| AdocNet | AdocNet |
Facade meta-package (Adoc.ToHtml/ToPdf/…); references Core, Parser, Html, Pdf |
| AdocNet.Ast | AdocNet.Ast |
Typed AST node classes |
| AdocNet.Core | AdocNet |
Diagnostics, options, renderer framework |
| AdocNet.Parser | AdocNet.Parser |
Block and inline parsing |
| AdocNet.Converters.Html | AdocNet.Converters.Html |
HTML5 renderer with themes |
| AdocNet.Converters.Pdf | AdocNet.Converters.Pdf |
Pure managed PDF 1.4 renderer with TrueType font embedding and Unicode support |
| AdocNet.Converters.DocBook | AdocNet.Converters.DocBook |
DocBook 5.0 renderer |
| AdocNet.Converters.Epub | AdocNet.Converters.Epub |
EPUB 3.0 renderer |
| AdocNet.Converters.Man | AdocNet.Converters.Man |
Man page (roff) renderer |
| AdocNet.Converters.Revealjs | AdocNet.Converters.Revealjs |
Reveal.js slides renderer |
| AdocNet.Emitter | AdocNet.Emitter |
AST-to-AsciiDoc emitter (round-trip; in progress) |
| AdocNet.Layout | AdocNet.Layout |
UI-agnostic layout model and AST-to-layout builder |
| AdocNet.Avalonia | AdocNet.Avalonia |
Avalonia UI renderer (layout tree to controls) |
| AdocNet.LanguageServer | — | LSP server (adocnet-lsp); build-from-source |
The data flow for the Avalonia viewer is strictly layered: AST → Layout → Avalonia. The Layout library has zero UI dependencies and targets netstandard2.0, making it consumable by any .NET UI framework.
Documentation
| Guide | Description |
|---|---|
| USAGE.md | Library usage, parsing, rendering workflows |
| CLI.md | CLI reference and examples |
| RENDERERS.md | Renderer guide (HTML, PDF, DocBook, EPUB) |
| PDF_RENDERER.md | PDF renderer: fonts, images, links, tables, configuration |
| EXTENSIONS.md | Processing extensions, custom renderers, and include readers |
| DYNAMIC_EXTENSIONS.md | Loading extensions from external DLLs at runtime |
| EXTENSION_PACKAGING.md | Extension packaging, installation, and automatic loading |
| EXTENSION_REGISTRY.md | Extension registry, search, and dependency validation |
| EXTENSION_SAFETY.md | Extension safety: failure disabling, API version, structured loading |
| PERFORMANCE.md | Performance caching: parse cache, render cache, configuration |
| EDITOR_INTEGRATION.md | Editor APIs: DocumentChange, DocumentSnapshot, ParseIncremental |
| INCREMENTAL_RENDERING.md | Incremental rendering: structural hashing, tree diff, HTML splicing |
| DIAGRAMS.md | Diagram block processing with external tools |
| COMPATIBILITY.md | Asciidoctor conformance and known differences |
| SECURITY.md | Security considerations for untrusted input |
Performance
AdocNet is a native managed library with no interpreter startup, so it's significantly faster than Asciidoctor (Ruby) for typical workloads. Preliminary measurements on the 36-document conformance corpus show 15-25× speedup for HTML rendering on warm JIT. To benchmark on your hardware:
dotnet run -c Release --project benchmarks/AdocNet.Benchmarks
Concrete numbers (with BenchmarkDotNet methodology, percentile breakdowns, allocation counts) will be published in a follow-up release.
Migrating from Asciidoctor
For users moving from the Asciidoctor (Ruby) toolchain, the
docs/MIGRATION-FROM-ASCIIDOCTOR.md guide covers CLI flag mapping,
parity matrix per format, intentional differences (e.g. CDN vs local
paths for reveal.js assets), and known out-of-scope features.
Building
dotnet build
dotnet test
Target Frameworks
All core libraries (and AdocNet.Avalonia) multi-target netstandard2.0, net8.0,
and net10.0. The CLI tools and LSP server target net10.0 only.
| Consumer | Resolved TFM |
|---|---|
| .NET Framework 4.6.1+ | netstandard2.0 |
| .NET Core 2.0+ | netstandard2.0 |
| .NET 5-7 | netstandard2.0 |
| .NET 8 / 9 | net8.0 (optimized) |
| .NET 10+ | net10.0 (optimized) |
License
MIT
| 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 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- AdocNet.Ast (>= 1.0.23)
- AdocNet.Core (>= 1.0.23)
- AdocNet.Parser (>= 1.0.23)
-
net10.0
- AdocNet.Ast (>= 1.0.23)
- AdocNet.Core (>= 1.0.23)
- AdocNet.Parser (>= 1.0.23)
-
net8.0
- AdocNet.Ast (>= 1.0.23)
- AdocNet.Core (>= 1.0.23)
- AdocNet.Parser (>= 1.0.23)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.23 | 0 | 8/5/2026 |
| 1.0.22 | 97 | 7/16/2026 |
| 1.0.21 | 117 | 6/21/2026 |
| 1.0.20 | 115 | 6/21/2026 |
| 1.0.19 | 109 | 6/20/2026 |
| 1.0.18 | 127 | 6/20/2026 |
| 1.0.17 | 107 | 6/19/2026 |
| 1.0.16 | 113 | 6/18/2026 |
| 1.0.15 | 122 | 6/18/2026 |
| 1.0.14 | 122 | 6/17/2026 |
| 1.0.13 | 128 | 6/17/2026 |
| 1.0.12 | 114 | 6/12/2026 |
| 1.0.11 | 106 | 6/4/2026 |
| 1.0.10 | 110 | 6/3/2026 |
| 1.0.9 | 113 | 6/1/2026 |
| 1.0.8 | 112 | 5/22/2026 |
| 1.0.6 | 112 | 5/22/2026 |
| 1.0.5 | 104 | 5/19/2026 |
| 1.0.4 | 98 | 5/19/2026 |
| 1.0.3 | 114 | 5/19/2026 |
v1.0.23: Word (.docx) import. Adds AdocNet.Importers.Docx — a pure-managed WordprocessingML reader that maps a .docx package onto the Adoc.Net AST, which the emitter serialises to AsciiDoc — and the docx2adoc tool (AdocNet.Docx). Mapped: sections from heading styles, lists with nesting and numbering style, tables with grid widths, header rows and gridSpan/vMerge spans, images with captions and sizes, text boxes as sidebars, hyperlinks, bookmarks and cross references, footnotes and endnotes, fields, quote and listing blocks, admonitions, page and thematic breaks, tracked changes, and core properties; character formatting maps to AsciiDoc markup with underline/strikethrough/caps/colour kept as roles. DocxImportReport lists everything approximated or lost with a content-mapping fidelity ratio (99.8% weighted over a 69-document corpus, 62 of them at 100%). Literal text is protected by a match-driven escaper verified by a round-trip harness. No dependency on the Open XML SDK or System.IO.Packaging, so netstandard2.0 is unaffected. Also fixes two emitter bugs: nested lists lost their numbering-style attribute line, and a cell specifier after an empty spanned cell was read as content, shortening the row. See CHANGELOG.md and docs/DOCX_IMPORT.md.