1. 02 Dec, 2017 2 commits
  2. 01 Dec, 2017 1 commit
  3. 30 Nov, 2017 1 commit
  4. 01 Jan, 2017 1 commit
    • Dustin L. Howett's avatar
      Expose .Obj, .With and .Value. · 92fe3ff4
      Dustin L. Howett authored
      * {{.Obj}}
        The object passed into a bound template's Exec.
      * {{.With Name Value}}
        Returns a new view context with the specified key-value pair.
      * {{.Value Name}}
        Returns the value prevously bound to Name in this context stack.
      92fe3ff4
  5. 22 Nov, 2016 6 commits
    • Dustin L. Howett's avatar
      Cache var lookups against dp in vctx. · 00597432
      Dustin L. Howett authored
      00597432
    • Dustin L. Howett's avatar
      Add options.go, which I forgot. · 0e161b7d
      Dustin L. Howett authored
      0e161b7d
    • Dustin L. Howett's avatar
      a10255a6
    • Dustin L. Howett's avatar
    • Dustin L. Howett's avatar
      Nil data provider should be acceptable. · 69df87b6
      Dustin L. Howett authored
      69df87b6
    • Dustin L. Howett's avatar
      Implement package views. · f596f3f6
      Dustin L. Howett authored
      Package views provides Ghostbin's view model. Views are templates loaded
      from a set of globbed files, and provide four template functions:
      * global <var>
        Fetches a variable from the global view data provider.
      * local <var>
        Fetches a variable from the local view data provider.
      * now
        Returns the current time.
      * subtemplate <name>
        Renders a sibling view and returns its HTML.
      
      A view model alone is not useful; it can contain any number of
      templates but provides no way to use them. This is where binding comes
      in.
      
      Once a single view is bound via model.Bind(name, dataProvider), it can
      be used in perpetuity as a handle to the open template with its bound
      name. It will look up `local` variables from its bound data provider,
      and `global` variables from its parent's bound data provider.
      
      Views can be bound with string names, in which case they are simply
      executed by name (and subtemplate will not function properly), or with
      the special type views.PageID. A view bound by way of views.PageID will
      render the special `tmpl_page` template, passing the bound name along in
      {{.page}}. {{.page}} is crucial to the operation of subtemplate; for a
      given page "A", {{subtemplate "X"}} will render the template named
      "A_X".
      f596f3f6