From 52254d9265d069253cac3649e474e824bbaba5f6 Mon Sep 17 00:00:00 2001
From: ezsh <ezsh.junk@gmail.com>
Date: Thu, 25 Nov 2021 16:46:34 +0100
Subject: [PATCH] Put SugarCube format version in StoryData

Twee language tools VS Code extension reads story format version from
the StoryData passage, and it does not hurt to keep it there. Also
remove the format argument from the Gulp build files, as tweego can
reads it from the StoryData object.
---
 build.config.json       | 1 -
 gulpfile.js             | 2 +-
 src/002-config/start.tw | 4 +++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/build.config.json b/build.config.json
index 29c31825181..3d84c8e0c54 100644
--- a/build.config.json
+++ b/build.config.json
@@ -4,7 +4,6 @@
 		"output": "bin"
 	},
 	"output": "FC_pregmod.html",
-	"twineformat": "sugarcube-2",
 	"gitVersionFile": "src/002-config/fc-version.js.commitHash.js",
 	"sources": {
 		"module": {
diff --git a/gulpfile.js b/gulpfile.js
index c3576981d91..1f717698e96 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -96,7 +96,7 @@ function tweeCompileCommand() {
 
 	let modules = [path.join(cfg.dirs.intermediate, "module")];
 	let moduleArgs = modules.map(fn => `--module=${fn}`);
-	return `${tweeCompilerExecutable()} -f ${cfg.twineformat} --head=${cfg.sources.head} -o ${path.join(cfg.dirs.intermediate, htmlOut)} ${moduleArgs.join(' ')} ${sources.join(' ')}`;
+	return `${tweeCompilerExecutable()} --head=${cfg.sources.head} -o ${path.join(cfg.dirs.intermediate, htmlOut)} ${moduleArgs.join(' ')} ${sources.join(' ')}`;
 }
 
 /**
diff --git a/src/002-config/start.tw b/src/002-config/start.tw
index 8bef19a0369..f54f0b07e0a 100644
--- a/src/002-config/start.tw
+++ b/src/002-config/start.tw
@@ -1,6 +1,8 @@
 :: StoryData
 {
-	"ifid":"18DFC483-910E-4D3B-AC31-71AE10C5015A"
+	"ifid":"18DFC483-910E-4D3B-AC31-71AE10C5015A",
+	"format": "SugarCube",
+	"format-version": "2.35.0"
 }
 
 :: Start [nobr]
-- 
GitLab