Sage
Welcome to Sage
Volume (65%) Hide Volume
Topics
Including Other Files
You should consider breaking all but the smallest of volumes into multiple files. The [include] tag allows one .sage file to include the contents of another. For example…

[volume Threads and Fibers aka Threading] [include Overview] [topic Fibers] [include Fibers_Overview] [include Fibers_Cycles] [include Fibers_Aborting] [include Fibers_Properties] [end] [topic Threads] [include Threads_Overview] [topic Coordinating Threads aka Threads.Coordinating] [include Threads_VsFibers] [include Threads_CriticalSection] [end] [topic Background Tasks aka BGTasks] [include Threads_BGTasks] [include Threads_DSSchedule] [include Threads_ITaskRunner] [end] [include Threads_FirstTrust] [end] [end]

Advantages

As you can see, this approach allows you to focus on the organization of topics and articles within the volume. The articles are each kept in separate files (though larger articles could span multiple files).

Tip

Among other benefits, this approach allows multiple people to edit different articles in the same volume simultaneously, without need to branch and merge.


File Extensions

As shown above, you may omit the file extension. Moreover, Sage requires all source files to use the .sage extension. You may specify this extension in include statements, but it is preferred to omit the extension.

Code Insight

DSEdit's Code Insight for Sage files offers suggestions for [include] tags. For example…

Relative Paths

Relative paths are resolved from the location of the including file. For example, if the file C:\Docs\Sage\Main.sage has the statement: [include Details\Info], this refers to the file C:\Docs\Sage\Details\Info.sage. Similarly, the statement: [include ..\Overview] refers to the file C:\Docs\Overview.sage.

Warning

Sage does allow absolute paths, but relative paths are strongly preferred.


Last Modified: 10/24 10:44:32 am
In this article (top)  View article's Sage markup
10/24 10:44:32 am