Code Monkey home page Code Monkey logo

whisker's Issues

Behaviour in regard of missing variables is not documented

Describe the feature

The template can't be rendered if the variable it refers to is missing in the data. This is different from mustache, where "If the top context is reached and the name key is still not found, nothing will be rendered."

This behavior is confusing and deserves mention in the documentation.

Ideally, it should suggest how to make conditional rendering possible.

Use Case

variable is missing in the data but mentioned in the template

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Version used

0.2.0

Environment details (OS name and version, etc.)

any

Automated package installation test in CI

Describe the feature

The project is currently tested on a separate machine to ensure that the package can be installed and used properly. It needs to be included in the CI so that third-party users of this library should not face any inconveniences.

Use Case

This will ensure that the package is always installable for users.

Proposed Solution

Add a sample project and a separate workflow file that runs this.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Version used

Latest

Environment details (OS name and version, etc.)

All environments.

Fix recursive templates

Describe the bug

Recursive templates that contain lists are currently broken. This is a side-effect of broken nested-list handling as documented in #1.

Expected Behavior

The commented out test case in the partial spec should work.

Current Behavior

It causes invalid memory access errors.

Reproduction Steps

Run the test case shown above.

Possible Solution

It is possible that fixing #1 should fix this as well.

Additional Information/Context

No response

V version

Latest

Environment details (OS name and version, etc.)

All environments.

Please add description how to iterate over a map into the Readme

Describe the feature

Please add description how to iterate over a map into the Readme

Use Case

Currently, the Readme describes iteration over items of an array and using a map with hard-coded key values.
It would be great to have an example of how to iterate over a map using dynamic key/value pairs.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Version used

0.2.0

Environment details (OS name and version, etc.)

any

Boolean emptiness property for arrays

Describe the feature

Please provide a way to conditionally render parts of the template where the condition is emptiness / non-emptiness of the list.

Use Case

When rendering lists as HTML, more often than not, it is needed to render parts of the layout only if there are some elements in the list, for example:

  • Table header and/or footer are only to be shown when there are rows in the table
  • Heading has to be visible only if there are paragraphs
  • Ordered and unordered lists might have an introduction and/or conclusion that only need to be shown if there are elements in the list

Proposed Solution

There are two possible ways to implement this functionality:

  • provide a synthetic property depending on the list emptiness, for example, when reading json. This gives full flexibility how the new key should be named
  • On the tokenizer level by extending the meaning of positive and negative sections for lists:
<+list>
<h1>Currenty on vacation</h1>
<ul>
<*list><li>{{.}}</li></list>
</ul>
</list>
<-list>Nobody is no vacation now</list>

The second way feels more elegant and will work for manually constructed data models as well.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Version used

0.2.0

Environment details (OS name and version, etc.)

any

Nested lists do not work (yet)

Describe the bug

Right now, the list section duplication code is incomplete. It works for flat lists but fails for nested lists.

Expected Behavior

Expecting nested lists to work. An example is the commented out part here.

Current Behavior

Invalid memory access.

Reproduction Steps

Just run the code that is shown in the highlighted section and is currently commented out in the spec.

Possible Solution

The copying algorithm needs to reattach jump points when the list section is being copied.

Additional Information/Context

No response

V version

Latest

Environment details (OS name and version, etc.)

All environments.

Add documentation for public API functions

Describe the feature

Currently, the source code has very few comments. Documentation comments should be added at the very least so that module documentation can be generated.

Use Case

For user reference.

Proposed Solution

Add documentation comments to public module functions.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Version used

0.1.x

Environment details (OS name and version, etc.)

All environments.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.