mdhtml

command module
v0.0.0-...-fcd8b22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 1 Imported by: 0

README ¶

Really simple CLI Markdown to HTML converter with styling support

Showcase

asciicast

🌟 Usage

To convert a Markdown file to HTML, you can run the following command:

mdhtml convert <input file>

This will create a file called output.html in the current directory. You can also specify the output file name:

mdhtml convert <input file> --output <output file>

You can also specify a CSS file to style the HTML file:

mdhtml convert <input file> --output <output file> --stylesheet <css file>

MDHTML also supports watching a file for changes and automatically updating the output file:

mdhtml convert <input file> --watch

If you want, you can also enable an HTTP server with live reloading:

mdhtml convert <input file> --watch --httpserver

To see all available options, you can run:

mdhtml --help

💻 Installation

mdhtml is currently packaged only for Arch Linux and nixpkgs. You can find the packages here:

Packaging status

NOTE: The version of mdhtml in the nixpkgs repository is on 0.3.0, which is an old version. This version has some bugs and problem with high CPU usage on watch mode. You probably want to use the latest version.

For NixOS users, I recommend using the nixpkgs-unstable channel, which should have the latest version of mdhtml soon. Or you can install mdhtml through a Nix flake.

To install mdhtml, you can either download the binary from the releases page and install it to the system or build it from source.

Installing the binary

To install the binary, you can download it from the releases page and install it to your system (Linux):

sudo mv mdhtml /usr/local/bin

Building from source

To build mdhtml from source, you need to have Go installed on your system. Then, you can run the following command to build the binary:

go build -o mdhtml main.go

Then you can install the binary to your system (Linux):

sudo mv mdhtml /usr/local/bin

Installing from AUR

If you are using Arch Linux, you can install mdhtml from the AUR.

Installing from a Nix flake

If you are using Nix, you can install mdhtml from a Nix flake. To do this, you need to have Nix installed on your system. Then you can add the mdhtml input to your configuration and install it:

# flake.nix

{
  inputs.mdhtml.url = "git+https://codeberg.org/Tomkoid/mdhtml";
  # ...

  outputs = {nixpkgs, ...} @ inputs: {
    nixosConfigurations.HOSTNAME = nixpkgs.lib.nixosSystem {
      specialArgs = { inherit inputs; }; # this is the important part
      modules = [
        ./configuration.nix
      ];
    };
  } 
}

# configuration.nix

{inputs, pkgs, ...}: {
  # ...
  environment.systemPackages = [
    inputs.mdhtml.defaultPackage.${system}
  ];
  # ...
}

Documentation ¶

Overview ¶

Copyright © 2023 Tomkoid <tomkoid@proton.me>

Directories ¶

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL