Fable, invoke F# from JS - fable-f#

I see a lot of documentation on F# JS interop and how to use JS code from F#, but I am trying to do the opposite: Call some of my F# code from (inlined) JS. I cannot find any information regarding this. Is it possible? If so how?

So after 2 weeks of trying everything I could think about, google every word combination I could think of and creating a SO account to ask for help: I finally found how to do this.
It turns out I needed to add this to my webpack config's output section:
libraryTarget: 'var',
library: 'EntryPoint'
as explained here: https://itnext.io/calling-a-es6-webpacked-class-from-outside-js-scope-f36dc77ea130
As it turns out this is not related to F#, fable or babel but to webpack.

Related

Documentation for Javascript code in RStudio?

RStudio has support for ROxygen for generating documentation for R code. My R package has a fair bit of Javascript code in it. Has anyone written an RStudio plugin to support Javascript documentation, using JSDoc for example?
I'd like the equivalent of "Insert ROxygen skeleton", which isn't trivial to write myself, since it needs to parse the following Javascript.
There's now a prototype addin for RStudio to do this. It currently uses the development version of the js package, so you'll need two Github installs to use it:
devtools::install_github("jeroen/js")
devtools::install_github("dmurdoch/JSDocPlugin")
See the ?insertJSDocAddin help topic for instructions on how to install it with a keyboard shortcut.
Comments or pull requests on https://github.com/dmurdoch/JSDocPlugin would be welcome.

Elixir Phoenix inlining css for sending emails

I am sending emails using the mailgun library in Phoenix.
Turns out that when i look at the email in my gmail account, it has been stripped off of all the css classes and the link to external css files.
Mailgun suggests using a css inline library http://blog.mailgun.com/transactional-html-email-templates/
Tried search a lot, but could not find a css inline library for Phoenix/Elixir like the premailer gem in Ruby.
Does anyone know of a way to achieve this?
I just released Smoothie, an Elixir library that does just this. We use this in our product at the startup I run, and decided to write our own library as we also couldn't find one in the elixir ecosystem yet. Check out the github page for installation instructions. Let me know if it works for you!
There is also a library now called premailex which was released October 2017. It handles CSS inlining
I have not been able to find anything myself but I believe you can find tools for that online and use them, it's not exactly the same but I guess it's better than to inline everything manually. For instance, you could use this one. I have not tested it though.
Also you can create a package yourself and share it with us :)

Dart tag and syntax reference?

This is a very noobie question. I hope I still can get some help. I normally use references for the languages I use. Like Tag and Syntax references so I know what they do. A example would be If I was doing HTML I would have this site open http://www.w3schools.com/tags/default.asp
I do this because I can't remember anything. It seems like w3school does not have dart yet so I was wondering if any other Dart coders found something similar?
If there is none what do you guys do to know all the syntaxes/tags? Do you remember everything?
Dartlang.org only has the API reference and some code samples which is good but not enough for me
https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/home
Dart cheat sheet is a concise and clearly arranged summary of the Dart language.
Try Chapter 2. A Tour of the Dart Language from the web version of Dart Up and Running.
It's concise but quite useful, and published as a single we page so it can be searched with the browser search function.

BlogEngine.Net Code Formatting Extension that works?

For months now I've been trying to find a code syntax formatting extension that works for BlogEngine.Net. I'm not fond of the behavior of the default formatting extension, and have tried a couple of others (manoli is among them), but they always seem to interact badly with the TinyMCE editor. Does anyone know of an extension that works, or a different approach that will allow me to make code samples pretty on my blog without hacking the crap out of the HTML myself?
Thanks.
I would try using Windows Live Writer along w/ the Paste From Visual Studio plugin. One you go WLW, you'll never go back to that damn TinyMCE interface.
WLW here:
http://get.live.com/writer/overview
Plugin here:
http://gallery.live.com/liveItemDetail.aspx?li=d8835a5e-28da-4242-82eb-e1a006b083b9&l=8
Thanks, Rafe. Thanks to this post that Hanselman put up the day after I asked the question, I downloaded WLW and am now using it. As far as getting prettily formatted code, I'm using cut-and-paste from a little tool developed and available on manoli.net.
Check out SyntaxHighlighter.. Works excellent. For easy integration into BlogEngine have a look at my blog post.

Code syntax formatter for posting code on webpages

Is there a utility that will generate html or css for blocks of code (.net c#) when you post it on a website?
I have seen several websites with very nicely formatted code and I dont believe they do this manually.
Google prettify -
http://code.google.com/p/google-code-prettify/
I prefer Syntax Highlighter implementations (I'm using Wordpress plugin implementation for my blog).
Advantages
It is based on JavaScript and does
not care about what you have on the
server.
Posts with this formatting display
properly on different RSS feeds and
can be copied to clipboard.
It is trivial to extend syntax
rules. I'm using that to highlight
custom operators in Boo-based DSL (see sample post)
Multiple languages are supported
out-of-the-box
(source: googlecode.com)
You can get JavaScript syntax-highlighting scripts, such as this one by Dean Edwards.
This is also a jQuery version apparently based on it which looks good.
CopySourceAsHtml is an add-in for Microsoft Visual Studio 2005 that allows you to copy source code, syntax highlighting, and line numbers as HTML.
http://copysourceashtml.codeplex.com
It's highly configurable, and works much better than the download page would make you expect! Don't know if there is something similar for VS 2008
If you don't have the ability to add the google prettifier CSS reference, this would be a better way to go, as what you get is a complete HTML with the required style. I use it all the time on our developers wiki, and loving it.
An even better solution, if you don't want to bother installing anything, is to just use the little web app I wrote called BlogTrog CodeWindow:
http://www.blogtrog.com
It's easy to use. Just paste your code and embed the results.

Resources