nix flake update
Fix permissions
nix flake update
Markdown lacks many basic features—however SourceHut only supports Markdown and not a more robust lightweight markup language like AsciiDoc. The purpose of this project is to overcome the lack of AsciiDoc support by making an easy-to-import Nix flake to compile the Asciidoc document as well as massage out any additional incompatibilities with classes and styling between the two.
Caution
|
This will not mean you will have broader AsciiDoc support. There are mailing list topics where Drew DeVault expressed that he wants no support of anything other than Markdown—as a result people are making the same errors with Markdown as usual like: Lacking features
|
Add this project to your Flake inputs, and then it can render any AsciiDoc file to a SourceHut-compatible style.
flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
sourcehut-asciidoc-renderer.url = "sourcehut:~toastal/sourcehut-asciidoc-renderer";
};
outputs = { self, nixpkgs, sourcehut-asciidoc-renderer, ... }@inputs:
let
supportedSystems = [ "aarch64-linux" "x86_64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
in
{
packages = forAllSystems (system: {
readme = sourcehut-asciidoc-renderer.renderAsciiDoc {
inherit system;
baseDir = ./.; # used to resolve includes::[]
sourceFile = ./README.adoc;
};
});
};
}
This will build README.adoc
to $out/share/doc/README.html
when built with nix build ".#readme"
. After which you can read the Setting a custom README docs from SourceHut to help you upload your own README. You can also check out the readme
task in the .build.yml
file for an example of how to POST a custom README (and other infomation about Nix + Cachix in builds.sr.ht
).
The only requirement is that Nix is downloaded.
$ nix develop
direnv
on cd
$ cp .envrc.example .envrc
$ direnv allow
$ cachix use toastal
This project is licensed under GNU Lesser General Public License version 2.1 or later (LGPL-3.0) — see the COPYING.txt
+ COPYING.LESSER.txt
files in this project for details.
If you want to make a small contribution to the maintanence of this & other projects.