How to use import properly?
KaiSD
06 Apr 2019, 08:57I'm trying to use import, but I can't make it work.
start.sq
[[start]]:
this is start
[[intro]]
@import intro.sq
intro.sq
[[intro]]:
This is intro
$ squiffy start.sq
Squiffy 5.1.3
Loading start.sq
Writing story.js
WARNING: start.sq line 1: In section 'start' there is a link to a section called [[intro]], which doesn't exist
Writing index.html
Writing style.css
Done.
What am I doing wrong?
I'm using Windows 10 Ubuntu Subsystem with NodeJS 8.10.0 and Squiffy 5.1.3 (installed from NPM).
![](https://i.imgur.com/vjdH3t6b.jpg)
DarkLizerd
06 Apr 2019, 09:19Does [[intro]] exist in intro.sp???
And knowing Quest...
Is it [[intro]] and not [[Intro]]???
![](https://i.imgur.com/WUGXS8yb.png)
Richard Headkid
06 Apr 2019, 13:34Hello.
Try renaming the files with the extension .squiffy
(instead of .sq
).
First, I tested it with the .sq
extension, and I got the same results as you.
Then, I changed the extensions to .squiffy
(making sure to change the line in "start.squiffy" to @import intro.squiffy
), and it works.
[rh@rharch squiffy-docs]$ ls
intro.squiffy start.squiffy
[rh@rharch squiffy-docs]$ cat start.squiffy
This is a test.
[[intro]]
@import intro.squiffy
[rh@rharch squiffy-docs]$ cat intro.squiffy
[[intro]]:
This is intro
[rh@rharch squiffy-docs]$ squiffy start.squiffy
Squiffy 5.1.3
Loading /home/rh/squiffy-docs/start.squiffy
Loading /home/rh/squiffy-docs/intro.squiffy
Writing story.js
Writing index.html
Writing style.css
Done.
KaiSD
06 Apr 2019, 19:51Thank you. It helped.