How to use import properly?

I'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).


Does [[intro]] exist in intro.sp???
And knowing Quest...
Is it [[intro]] and not [[Intro]]???


Hello.

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.



Thank you. It helped.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums