Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add Nustache to Xamarin project? I've got problem with targetFramework... #106

Open
demylia opened this issue Dec 24, 2015 · 10 comments

Comments

@demylia
Copy link

demylia commented Dec 24, 2015

In Package console, I see next:

Adding Nustache...
Adding 'Nustache 1.15.3.7' to testFrameworcTarget.
Could not install package 'Nustache 1.15.3.7'. You are trying to install this package into a project that targets 'portable-net40+sl50+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10', , but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author

@Romanx
Copy link
Collaborator

Romanx commented Dec 29, 2015

Hi there,

Sorry for the delay in replying. Nustache doesn't have a mono build unfortunately and I'm currently only bug-fixing issues and taking pull requests on this project. I've moved to developing my own Mustache templating engine called Stubble.

If you'd like to open an issue in that repo, I know that it builds using Mono and i'd be happy to work with you to get the nuget package to install correctly in a Xamarin project.

Thanks,

@demylia
Copy link
Author

demylia commented Dec 29, 2015

Romanx, I've just copied all classes to my project and it works now. But I've got a new problem:
I have a html-template (string type) and a json (string type), I create a JObject, then I use the method Render.StringToString(template,JObject,null), the generation works only for - Variables and Sections, but doesn't work for - False Values or Empty Lists, Inverted Sections.
Can you improve this behavior or maybe you know another possible - how to generate Anonymous C# class from json in runtime?
I want to get from server the new templates and new json after the compilation of app, thus i don't know which Properties will be inside of my Model
Thanks in advance

@Romanx
Copy link
Collaborator

Romanx commented Dec 29, 2015

Hey,

If you could provide a reproduction case I could take a look. As i mentioned above i'm not really working on this as i'm improving functionality on my separate library. I've added explicit code for Json.Net in that library here.

A reproduction case would be useful as i could see how much work getting this working would be for you,

Cheers

@demylia
Copy link
Author

demylia commented Dec 29, 2015

Romanx, thanks a lot for your cool job! I've just added all needed classes to my project and now it works well. By now I would like to know how to make a package for Portable Class Library in Xamarin, how to do it (maybe I can find out it using google, I didn't see it yet)

@Romanx
Copy link
Collaborator

Romanx commented Dec 29, 2015

Nuget not working with the same error you get with Nustache?

@demylia
Copy link
Author

demylia commented Dec 29, 2015

Nuget even don't see your package "Stubble", anyway I think that the error will be the same

@Romanx
Copy link
Collaborator

Romanx commented Dec 29, 2015

It's slightly confusing sorry. I split them out quite widely.

  • Core Package
    This contains the core functionality of the mustache renderer.
  • Json.Net Extensions
    This is the extension package that adds all the Json.net specific functionality
  • Stubble.All This is the combined package which merges all the extensions into one easy to use dll.

If you'd like to try including them from nuget, i'm not sure if they'd work as i've not tested the scenario although all my tests do run under mono. Either way a reproduction case would be excellent so I can try help with your issue.

@demylia
Copy link
Author

demylia commented Jan 13, 2016

Hi Romanx, the Stubble library works correct with JObject. Now, I would want to add the SDWebImage library to my project to cache the images. And what I want to do is add some code to your class from this lib which let me to change global references on images to local (if the cache have these images ). Only after that invoke the Render method. 1) Can you tell me in which class you iterate inside of the collection in JObject. 2) Can you add me to your skype: demylia
Thank you in advance

@Romanx
Copy link
Collaborator

Romanx commented Jan 13, 2016

Hi @demylia Since this is now more a Stubble issue than a Nustache one could you open a ticket over there and i'll try help you, thanks.

@demylia
Copy link
Author

demylia commented Jan 14, 2016

ok, I agree with you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants