Writing a plugin file in ClojureScript for use in CKEditor - clojurescript

I currently have a project that is using ClojureScript, shadow-cljs, re-frame, and CKEditor.
I am trying to figure out how to write a custom plugin for CKEditor usoing CLJS instead of JS.
CKEditor uses the following to load external custom plugins
// Loads a plugin from '/myplugins/sample/my_plugin.js'.
CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/', 'my_plugin.js' );
Is there a way to write my_plugin.js in CLJS in my current project?

I think your question is: I have a CLJS project that uses shadow-cljs and happens to use CKEditor as a library. I also want to create a plugin for CKEditor within the same project.
If that's the case, I think what you need is just create a new build for the plugin code in the :builds section of your shadow-cljs.edn file and configure it properly (eg. source files, etc.). See the Build Configuration section of the shadow-cljs User's Guide for details.
Once you build your plugin, it will put the output JS file in some location. Probably you need to copy this plugin JS file to a location in the "parent" project before building the main project.

Related

Where is the site.css file located for Identity?

I have an asp.net core 2.1 MVC application. I have ran the Scaffold Identity which has generated all the HTML and models used. I can't however find the css file that identity is using for its layouts?
In chrome developer tools it tells me site.css is being loaded from /Identity/css/site.css and bootstrap is being loaded from /Identity/lib/bootstrap/dist/css/bootstrap.css. These files don't seem to exist anywhere in my project. Am I missing something?
It's not using the site.css file that's located in wwwroot/css.
The Identity default UI is a Razor Class Library. The static resources are being embedded and loaded from the library. Specifically, the Static Files middleware is loading up the embedded resources as if they were on the filesystem, using a ManifestEmbeddedFileProvider.
Long and short, you can override those by simply creating files in the same location in your project. Then, your project's versions will take over. Unfortunately, the scaffold doesn't provide a way to scaffold static resources as well. However, you can simply view the source in your browser and then copy that into your project's version of the file.
You can also view the source of the RCL here. That way you can reference whatever code you need, without even needing the scaffold. Anything you add to your own project overrides what's coming from the RCL.

Can slidify use a custom framework instead of slidifyLibraries version?

I want to use slidify with a locally modified version of the revealjs framework instead of the version that's included in the slidifyLibraries package.
I'm working in selfcontained mode, so slidify copies the framework to the local libraries/frameworks folder.
Is there an easy way to tell slidify() to copy files to libraries from a different source than the slidifyLibraries package (similarly to the way I can tell author() to use a custom scaffold?
I can accomplish this by manually copying my local version of the framework into libraries/frameworks, but it would be nice to have slidify do this for me when I run slidify().

Add angular.js in HTML file

I am new at web development and working on one project where i have to use bower tool for front end development.I have created a project in intellij and installed bower and grunt on local project with angular js and jquery.i have created a file called index.html and its working fine when i write HTML but now i want to code in angular js. So i have added the script tag which is shown below in html file but it doesnt work. I know its a basic thing but i am not able to get it. I tried many things. Thank you in advance.
Ok just to make sure.
first
Check into the bower_components directory if the Angular folder is there.
If angular folder is there, like on the image.
if the file its not there run bower install angular or sudo bower install angular
second
You could manually add the Angular Sortable
script files yourself but Yeoman will automate this for you!
now run grunt serve just to check if angular script tag is there.
you should get this on console.
<script src="bower_components/angular/angular.js"></script>
Third
If this is ok, you could start getting into this tutorials to start using Angular.
W3 School Angular tutorial
thinkster.io Tutorial
From angular docs
include the Angular Javascript file via script tag.
http://fdietz.github.io/recipes-with-angular-js/introduction/including-the-angular-library-code-in-an-html-page.html
check this link for detail

Can you bundle live templates into a plugin/package in PHPStorm?

I have a selection of live templates / snippets specific to a particular framework that I would like to distribute as a plugin/package. Is it possible to do this for PHPStorm/WebStorm?
I have managed to do this for the Sublime Text 2/3 editor very easily and my package is now accessible via the package manager. In short I'm wanting to do the same for PHPStorm, allowing people to download my live templates as a plugin from the plugin repository.
I think you can use answer from this question How can I create custom Live Templates with an Intellij plugin.
You need to create DefaultLiveTemplateProvider and register it in plugin.xml

What is the best way to add a Dart hello world into my existing Node.js website?

I have been reading tutorials and guides concerning this but have not found a straight forward answer to this.
I currently have an existing website running on a node.js platform, locally on my computer.
Goal: Now I want to try and write a simple hello world in Dart, export it to plain JavaScript and see it work in my existing website.
Reading the documents, I read that I should create a new "Web Application" and to create some sample code up and running, I check the "Generate sample content" box.
And my project is now created in Dart Editor:
I can run the sample in Dartium, see it work, etc.
But the problem is that I have now a .html file in the Dart-project, while I have a real .html file for my existing node website in a totally different path. I don't want that. I want to try and use the existing .html instead, since.. thats my real website.
But when trying to create a new Dartium launcher, I can only refer to .html files within my Dart-project:
So my big question is; How do actually start using Dart with my existing developed website?
How do I create that bridge?
On the second image above in your original question, there is an option just below the HTML file, called URL - is this what you're looking for? You can set that to any arbitrary URL.
You'd also need to copy the helloworld.dart file into your node.js server path, and copy the bits inside the <body> tag into your existing HTML page. You'll also need to copy the packages\browser\dart.js file somewhere to your node.js server, too.
If you wanted to run the JS version, you'd also need to use the editor menu option to Generate JavaScript and copy the .js files into your node.js server path.
The script tag that refers to dart.js automatically detects if the browser supports Dart natively, and will either load the .dart version of your app, or the .dart.js version of your app (from the same folder location).
So what you're likely after is something like:
c:/nodejs_server_root
/existingIndex.html // containing the two script tags from helloworld.html
// and other tags referred to in helloworld.dart
/helloworld.dart
/dart.js
/helloworld.dart.js
And in the "URL" path in the launch configuration, you'd put something like http://localhost:<port>/existingIndex.html
https://pub.dartlang.org/packages/dev_compiler can compile Dart to Node.js modules with the --modules=node option.
See also https://github.com/dart-lang/dev_compiler/issues/291#issuecomment-176687849