The path where files generated by loaded should be placed. Will be ignored
if MemlCore.shouldLink
is set to false
.
A string containing the errors outputted to the console. Can be reset between
files using MemlCore.hadError()
Instantiated loader objects for imported values
Keeps track of if an error has occurred. Can be reset between files using
MemlCore.hadError()
Passed into each language loader (see MemlCore.globalLoaders
and ILoader
)
to determine if the output should be minified
If this is set, MEML will reference the files it imports rather than inlining them. The following arguments MUST be set correctly for this to work:
MemlCore.sourcePath
MemlCore.distPath
false (default)
(import './something.css')
Out:
<!-- ... -->
<style>\* File contents here *\</style>
<!-- ... -->
true
(import './something.css')
Out:
<!-- ... -->
<link ... href="./something.css">
<!-- ... -->
The path where all source files are stored. Used when importing files, ignored
if MemlCore.shouldLink
is set to false
.
Converts the contents of a file into a string of html.
May write files to disk depending on your settings for shouldLink
Converts the input tokens to an AST tree with a PageStmt as its root
Converts a source MEML string to a string of html.
May write files to disk depending on your settings for shouldLink
Converts an AST tree to a html string
May write files to disk depending on your settings for shouldLink
Converts the contents of the source string into an array of tokens ready for parsing
Register a new loader for linking and rendering
Resets all errors generated by the compiler and linker cache. Do not use
between files, only between compilations. Use MemlCore.resetErrors()
between files.
Generated using TypeDoc
The main class for handling compiling MEML files and general configuration. Statics in this file are responsible for compiler configuration and an instance of this class can be created to compile files.
Example usage
Build process
The following steps are taken by the build process, with appropriate functions available if you wish to break down the steps
Note that whilst tokenizing and parsing generally remain constant, you can create a custom target for your use case. There is no current documentation for this, however it follows the structure layed out in crafting interpreters and you may use the source code in the web target as a starting point as long as your project is GPLv3 compatible.
Project management
Should config be moved somewhere else?
Should builds be moved into separate functions?