Closed MangelMaxime closed 1 year ago
Goal:
Make it easier to extends
Make it easy to share layouts
Native support for F# API generation
Prefer explicit over configuration
Nacara itself should not be based on configuration. For example, the concepts of partials will not exist anymore inside of Nacara itself. However, themes could allow the users to adapt some portion of the generated code:
let myTheme =
theme_basic {
site {
title "Nacara"
}
footer {
section {
title "Project ressources"
links [
link {
label "Repository"
icon "fa-repo"
url "http://repository.com"
}
link {
label "Release notes"
icon "fa-repo"
url "http://repository.com"
}
]
}
}
}
let config =
config {
add_theme theme
}
Strongly typed configuration file + API
Example of configuration file:
#r "./src/Nacara/bin/Debug/net6.0/Nacara.Core.dll"
open System.IO
open Nacara.Core
let config =
config {
directory {
source "docs"
output "public"
loaders "loaders"
}
render {
layout "post"
script "layouts/post.fsx"
change_extension_to "html"
}
template {
extension "md"
front_matter { delimiter "---" }
}
template {
extension "fsx"
front_matter {
start_delimiter "(***"
end_delimiter "***)"
}
}
}
After giving it a try and re-thinking what gives value to Nacara I came up with the following conclusion:
What I want from Nacara, is to provide good looking documentation for F# project and have support for API generation. Nacara doesn't aim to create a new static site generator which can compete with projects like Hugo, Eleventy, Jekyll, etc.
When thinking like that I came up with the decision to create Nacara as a plugin on top of an existing site generator.
See https://github.com/MangelMaxime/Nacara/issues/197
I also decided to stop trying to implement it in .NET because I find it difficult to have a correct file watch and server implement using .NET (now I am delegating this work to another project and focus on solving the problem that matter the most to me).
Nacara running on top of JavaScript allows to benefit from amazing libraries for Markdown parsing + syntax highlighting for example.
However, the mechanism to register a extends Nacara are just not easy to do because of the mix of F# and JavaScript.
Moreover, the API generation requires the invocation of an external tools because we can't have the F# compiler service or F# formatting running on top of JavaScript.