Meteor with haml - haml

Does Meteor support haml?
If a package needs to be created, what would be the recommended library to use?
Is do haml and handlebars play nice together?
I would like to write haml, that would be processed into the html style (with handlebars) that is shown in the Meteor demos.

I've created a smart package for 9elements haml-coffee.
You can clone my fork of meteor here: https://github.com/huetsch/meteor/tree/devel .
I've also created a pull request that's located here: https://github.com/meteor/meteor/pull/138 .

Meteor does not currently have a smart package for haml. Haml and handlebars should work together just fine as, like coffeescript, haml is pre-processed and meteor would only ever see the generated html.
The docs on smart packages for meteor are here: http://docs.meteor.com/#smartpackages
But as it says, the api is rapidly changing and undocumented so your best bet is to look at an existing package and go from there. Here's coffeescript's: https://github.com/meteor/meteor/tree/master/packages/coffeescript

Related

Is it possible to remove all npm and gulp files from a bootstrap project?

I am a backend django-developper with very limited knowledge of frontend technologies. I decided to challenge myself into building a full-stack application using a pre-made Boostrap Admin dashboard. The problem is the dashboard I chose makes use of npm and gulp, which I know nothing about. Of course, I can try to learn it, but I am wondering if it's possible to remove them and create a compiled version that has all dependencies linked directly in the head tag and at the end of the body tag and style the frontend using vanilla bootstrap.
Your help will be greatly appreciated. Thanks

Is it possible to integrate Webpack/VueJS with the Odoo Framework (v12)?

I'd like to integrate VueJS through WebPack in one of my custom Odoo modules, and have it start up automatically when I launch Odoo-bin.
Does anyone have a solution?
Is it even possible?
I know you can include VueJS as a simple .JS file in the module's template, but that means I can't use the .vue components supported by WebPack.
I also read that Odoo has its own JS framework, but I couldn't find good tutorials/documentation for it.
EDIT: To anyone that might be wondering how I solved this, here's what I did:
I initialized a package.json file in the root of my Odoo folder using npm init. I added a start script to the package that launches webpack and bundles all vue components in myAddons folder (where I store my custom modules), then launches Odoo through the python odoo-bin ... command. All that's left is to use npm start to start it all up.
This way, the vue components get bundled into single JS files, that I then add to the templates of my modules. This has a small inconvenient in that the first bundle has to be done manually in order to know which JS files need to be imported to the templates. Also, i'm still trying to figure out how to bundle the components of every single module separately. Will update this once I find a proper way to do it. ...Hopefully.
By default, odoo frontend part is heavily built upon backbone, jquery, underscore. If you want to use any other JS library, you have to make sure the compatibility in between them. The odoo backend parts of JS functionalities are written under web module can be found in odoo/addons/web/static/src/js directory in odoo community codes. The ecommerce/website part is under website* modules.
Along with the fact that the Odoo JS API documentation is basically non-existent (as of the time I am posting this) .. I would add the fact that its going to be like working with a moving target compared to calling Odoo's JSON-RPC API directly since their JSON-RPC API changes very little over different versions of Odoo.
Moreover, making JSON-RPC API calls with Axios is extremely simple. So just go directly to the server's JSON-RPC API from your Vue project.
This is what I am doing with at odooinvue.org which is basically a Vue project that uses Odoo in the back-end. That project is designed specifically as a resource for Vue developers that are trying to use Odoo in the back-end but have difficulty because they are new to Odoo development.
I suggest trying #StartupGuy's odooinvue, which is really nice.
With Odoo 14 they created a new modern frontend framework: Owl framework.
I have not tried it myself.

How to use external API within Yii2 application?

I'd like to use external API within Yii2 application.
I couldn't find any tutorial about it.
I'd like to know how to do it in a decent way - do I have to build separate module to use this API or organize it in another way?
Any simple examples would be appreciated.
I'd like to build a tool, to use external API of other online application. To be straightforward - I'd like to import invoices etc. from external accounting system to my Yii2 application. This accounting system has API and I wonder how to use it properly inside Yii2 application.
The perfect solution for now would be to install ready module like "yii2-accountingsystemname-api", then I put some login and password for this system and I'm good to go - I can use it inside my application like:
getInvoices->all() etc.
After doing a bit of research I have found this guide that explains how to use third-Party code with the Yii2 application:
http://www.yiiframework.com/doc-2.0/guide-tutorial-yii-integration.html
This is a excerpt from that article:
Using Third-Party Libraries in Yii To use a third-party library in a
Yii application, you mainly need to make sure the classes in the
library are properly included or can be autoloaded.
Using Composer Packages Many third-party libraries are released in
terms of Composer packages. You can install such libraries by taking
the following two simple steps:
modify the composer.json file of your application and specify which
Composer packages you want to install. run composer install to install
the specified packages. The classes in the installed Composer packages
can be autoloaded using the Composer autoloader. Make sure the entry
script of your application contains the following lines to install the
Composer autoloader:
// install Composer autoloader
require(__DIR__ . '/../vendor/autoload.php');
// include Yii class file
require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
I suggest that you read the article because there is lots of other valuable information that may help you, and possibly better suit your needs than what I copied above.
Best of luck with your project!

Download HERE JS API for IDE code completion?

is there a way to download the here maps JS api 3.x to provide code completion in my IDE (like PHPStorm)?
I didn't find anything in the documentation.
Regards, Kristian
My knowledge of PHPStorm is limited, but are you able to use the javascript files by downloading them using the direct urls ?
Although you will run into issues when there are updates in the javascript file.

monologue gem with media plugin in tinemce

I am using monologue gem to mount a blog in existing rails application. It is working fine. But i need to embed audio and video content in tineMCE. For that we need to add media plugin as mentioned here. Initailly monologue only having "fullscreen" plugin. We can see that here. How can i add media plugin to the existing monologue configurations. ?
Search the monologue source code for the point where tinymce gets initiallized. tinymce.init or mceAddControll will be sufficient strings to search for.
when found you will find out if you are able to configure monologue to your needs or if you will have to hack the plugin list in the code.