Partas.Solid.MdxUtils 0.1.0

dotnet add package Partas.Solid.MdxUtils --version 0.1.0
                    
NuGet\Install-Package Partas.Solid.MdxUtils -Version 0.1.0
                    
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="Partas.Solid.MdxUtils" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Partas.Solid.MdxUtils" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Partas.Solid.MdxUtils" />
                    
Project file
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 Partas.Solid.MdxUtils --version 0.1.0
                    
#r "nuget: Partas.Solid.MdxUtils, 0.1.0"
                    
#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 Partas.Solid.MdxUtils@0.1.0
                    
#: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=Partas.Solid.MdxUtils&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Partas.Solid.MdxUtils&version=0.1.0
                    
Install as a Cake Tool

Partas.Solid.MdxUtils

Utility library package for streamlining making doc pages with MDX and Partas.Solid.

Requirements:

  • Tailwindcss
  • Vite

Femto Installation:

femto install Partas.Solid.MdxUtils

This will automatically install the required dependencies.

<NpmPackage Name="solid-jsx" Version=">= 1.1.4" DevDependency="true" />
<NpmPackage Name="tailwindcss" Version=">= 4.1.0" />
<NpmPackage Name="@tailwindcss/vite" />
<NpmPackage Name="@tailwindcss/typography" Version=">= 0.5.16" DevDependency="true" />
<NpmPackage Name="@mdx-js/rollup" Version=">= 3.1.0" />
<NpmPackage Name="clsx" Version=">= 2.1.1" />
<NpmPackage Name="tailwind-merge" Version=">= 2.6.0" />
<NpmPackage Name="rehype-pretty-code" Version=">= 0.14.1" DevDependency="true" />
<NpmPackage Name="remark-gfm" Version=">= 4.0.1" DevDependency="true" />
<NpmPackage name="@shikijs/transformers" Version=">= 3.2.1" DevDependency="true" />

Ensure you setup your css file with tailwind and typography:

@import 'tailwindcss';
@plugin "@tailwindcss/typography";

If there are issues with the inlined style, then you'll have to manually add the following to your main .css

code[data-line-numbers] {
    counter-reset: line;
}

code[data-line-numbers] > [data-line]::before {
    counter-increment: line;
    content: counter(line);

    /* Other styling */
    display: inline-block;
    width: 0.75rem;
    margin-right: 2rem;
    text-align: right;
    color: gray;
}

code[data-line-numbers-max-digits="2"] > [data-line]::before {
    width: 1.25rem;
}

code[data-line-numbers-max-digits="3"] > [data-line]::before {
    width: 1.75rem;
}

code[data-line-numbers-max-digits="4"] > [data-line]::before {
    width: 2.25rem;
}

[data-rehype-pretty-code-title] {
    @apply bg-zinc-700 text-zinc-200 rounded-t-lg py-2 -mb-1 px-3 font-semibold text-sm;
}

Usage

MdxStyler() {
    // ... place your mdx page components in here
}
MdxStyler(
    highlightedLinesTwClasses = "black", // set tailwind class for highlighted line color
    highlightedCharsTwClasses = "black", // set tailwind class for highlighted text color
    maxHeight = Some 500 // set max height for code blocks
)

The highlighted tailwind class properties can only be one utility class (no spaces). You can alternatively supply your own classes and override any of the defaults.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 was computed.  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.

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
0.1.0 104 6/1/2025

Init