aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorTaeer Bar-Yam <taeer@bar-yam.me>2022-02-17 13:59:32 -0500
committerTaeer Bar-Yam <taeer@bar-yam.me>2022-02-17 13:59:32 -0500
commitf56dd3a36bc8a325028588fd5500cbc33fa48a26 (patch)
tree695710479528dd14c84f06b1bd93d1ddc73f7f1a /src/nix
parentf3a2940e70dea2c35dcae3fca019e94bf8758b4d (diff)
make flake template welcomeText markdown
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/flake-init.md14
-rw-r--r--src/nix/flake.cc5
2 files changed, 13 insertions, 6 deletions
diff --git a/src/nix/flake-init.md b/src/nix/flake-init.md
index c8bcee375..c13b22248 100644
--- a/src/nix/flake-init.md
+++ b/src/nix/flake-init.md
@@ -37,8 +37,8 @@ A flake can declare templates through its `templates` and
* `path`: The path of the directory to be copied.
-* `welcomeText`: A block of text to display when a user initializes a new flake
- based on this template.
+* `welcomeText`: A block of markdown text to display when a user initializes a
+ new flake based on this template.
Here is an example:
@@ -50,8 +50,14 @@ outputs = { self }: {
path = ./rust;
description = "A simple Rust/Cargo project";
welcomeText = ''
- You've created a simple Rust/Cargo template.
- Visit https://www.rust-lang.org/ for more info.
+ # Simple Rust/Cargo Template
+ ## Intended usage
+ The intended usage of this flake is...
+
+ ## More info
+ - [Rust language](https://www.rust-lang.org/)
+ - [Rust on the NixOS Wiki](https://nixos.wiki/wiki/Rust)
+ - ...
'';
};
diff --git a/src/nix/flake.cc b/src/nix/flake.cc
index f5d34c10f..ac14bed74 100644
--- a/src/nix/flake.cc
+++ b/src/nix/flake.cc
@@ -13,6 +13,7 @@
#include "registry.hh"
#include "json.hh"
#include "eval-cache.hh"
+#include "markdown.hh"
#include <nlohmann/json.hpp>
#include <queue>
@@ -741,8 +742,8 @@ struct CmdFlakeInitCommon : virtual Args, EvalCommand
}
auto welcomeText = cursor->maybeGetAttr("welcomeText");
if (welcomeText) {
- notice("\n----------\n");
- notice(welcomeText->getString());
+ notice("\n");
+ notice(renderMarkdownToTerminal(welcomeText->getString()));
}
}
};