From 1881582609d3af202964a1e529680e28b3cc8233 Mon Sep 17 00:00:00 2001 From: Zuri Klaschka Date: Sun, 8 Dec 2024 18:39:24 +0100 Subject: [PATCH] Add multi-paragraph description support to Markdown `docs` writer --- .env.example | 6 ++++++ lib/parse.ts | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index b8505d0..a826879 100644 --- a/.env.example +++ b/.env.example @@ -24,4 +24,10 @@ REQUIRED_VARIABLE= # REQUIRED_VARIABLE=EXAMPLE_VALUE_1 # REQUIRED_VARIABLE=EXAMPLE_VALUE_2 # +# Multi-paragraph description of REQUIRED_VARIABLE_FILE +# REQUIRED_VARIABLE_FILE is a required variable that is used to store the path to a file +# that contains the value of the required variable. The file is mounted as a secret +# in the container. The value of the required variable is read from the file at runtime. +# +# The file should be mounted at the path specified by the REQUIRED_VARIABLE_FILE variable. # REQUIRED_VARIABLE_FILE=/run/secrets/required_variable diff --git a/lib/parse.ts b/lib/parse.ts index d66e2a8..289722a 100644 --- a/lib/parse.ts +++ b/lib/parse.ts @@ -58,9 +58,9 @@ export function parse( } // Descriptions - if (currentLine.startsWith("# ")) { + if (currentLine.startsWith("#")) { // A comment that isn't a variable definition is a description - ast.registerDescription(currentLine.slice(2)); + ast.registerDescription(currentLine.slice(1).trim()); continue; } }