Skip to content

MulleWeb/MulleScion

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MulleScion

๐ŸŒฑ A modern template engine for Objective C

(written in an oldfashioned way)

This is a fork of mulle-kybernetik/MulleScion tailored for use in mulle-sde projects

Release Version Release Notes
Mulle kybernetiK tag Build Status RELEASENOTES

Example

Here is a simple example, where ObjC code is embedded in a template:

<html>
   <!-- rendered by mulle-scion on
        2024-01-14T00:57:58Z -->
   <body>
   </body>
</html>

Using MulleScion the creation of a string from your object using a template file is as easy as:

   NSString  *output;

   output = [MulleScionTemplate descriptionWithTemplateFile:@"test.scion"
                                                 dataSource:self];

Info

This is the general architecture of MulleScion

MulleScion is happily used in a commercial project and has gone through enough iterations to pronounce it "ready for production".

HTML PREPROCESSOR

There is a companion project MulleScionHTMLPreprocessor that uses HTML like tags, to make the template easier to reformat in HTML editors:

<html>
  <!-- rendered by mulle-scion on
        2024-01-14T00:57:58Z -->
  <body>
    <for item in [NSTimeZone knownTimeZoneNames]>
      <if item#.isFirst>
        <table>
          <tr><th>TimeZone</th></tr>
      </if>
        <tr><td></td></tr>
      <if item#.isLast>
        </table>
      </if>
    <else/>
      Sorry, no timezone info available.
    </for>
  </body>
</html>

Documentation

The documentation is contained in a companion project mulle-scion.

MulleScion is very similar to TWIG, so you can glean much of relevance from http://twig.sensiolabs.org. If you see a feature in TWIG but don't see it in the tests file, it's likely not there (but it's probably easily achieved some other way (using a define or a macro or an ObjC category on NSString).

LIMITATIONS

Because you can execute arbitrary ObjC methods, and have access to Key Value Coding, MulleScion can pretty much do anything. MulleScion uses NSInvocation for method calls. That means there will be problems with variable arguments methods. Be wary of anything using structs and C-Arrays and C-strings, although MulleScion tries to be as helpful as possible.

MulleScion does not do arithmetic or bitwise logic, quite on purpose.

MulleScion && and || have no operator precedence, use parentheses.

MulleScion doesn't prevent you from trying stupid things.

The documentation is not very good, actually it is just more or less a collection of test cases with comments...

You are here

Overview

Add

Use mulle-sde to add MulleScion to your project:

mulle-sde add github:MulleWeb/MulleScion

Install

Install with mulle-sde

Use mulle-sde to build and install MulleScion and all dependencies:

mulle-sde install --prefix /usr/local \
   https://github.com//MulleScion/archive/latest.tar.gz

Manual Installation

Install the requirements:

Requirements Description
MulleFoundation ๐Ÿ’ Umbrella library for the MulleFoundation
MulleObjCHTTPFoundation ๐ŸŽซ HTTP and HTML utility methods and classes for mulle-objc
MulleObjCInetOSFoundation ๐Ÿ“ ๐Ÿ’ป OS specific extensions to NSHost and NSURL
mulle-objc-list ๐Ÿ“’ Lists mulle-objc runtime information contained in executables.

Download the latest tar or zip archive and unpack it.

Install MulleScion into /usr/local with cmake:

cmake -B build \
      -DCMAKE_INSTALL_PREFIX=/usr/local \
      -DCMAKE_PREFIX_PATH=/usr/local \
      -DCMAKE_BUILD_TYPE=Release &&
cmake --build build --config Release &&
cmake --install build --config Release

Platforms and Compilers

All platforms and compilers supported by mulle-c11.

Author

Nat! for Mulle kybernetiK
@hons82 (Hannes)

About

๐ŸŒฑ A modern template engine for mulle-objc (library)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 92.5%
  • C 7.3%
  • CMake 0.2%