Meteor markdown editor with embedded images / files - meteor

I want to be able to insert a file or image into a post written in markdown. I have a decent idea of how to do this using collectionFS and inserting the appropriate markdown text, but I was hoping that someone else has done this in a convenient smart-package.

Do any of these do what you're looking for?
https://atmospherejs.com/?q=markdown
I'm with you. I want to know if there's already something out there.
I've ended up implementing something I need only to find out there's already a smart package in atmosphere that does it better too many times! lol

It's possible to reference images stored directly in your server. Place any images you want in the Public folder of your Meteor project. Even better Public/Images.
In your page, reference these images without the Public directory, e.g. <img src="/Images/pic1.png">

Related

Wordpress: how to know which page is requesting a specific css file

I am helping out a friend with a slow WP. I installed hummingbird and it's telling me that some css files are slow to load (for example: https://cdnjs.cloudflare.com/ajax/libs/gsap/1.11.2/TweenMax.min.js - it takes 390ms to load). I would like to store this file locally and see if the performance improves. The problems is that I'm not sure about how to locate the file that is actually requesting this css file. Any help is appreciated.
I suggest a sweet plugin I use called String locator. It will search the whole site for a string like TweenMax.min.js. It will also search by plugin. When it find it it gives options to edit straight to the file. Hope this helps.

Adding d3.js charts to Wordpress

I'm looking for some advice for adding d3.js charts to Wordpress.
My client has commissioned a forceSimulation - still in progress. It is currently organised as follows:
index.html
main_javascript.js
main_css.css
global_properties.js
data_file.csv
I'm totally clueless as to whether it is possible to add the chart to her Wordpress blog and if so how to do it.... Any advice would be much appreciated.
Many thanks.
For reference, here are the WordPress docs on Using JavaScript.
Making it easy for them
From past experience (though not in WordPress), I'd try to simplify the steps your client has to take to get the visualisation working well, just in case the person doing them has little technical skill.
Hence, as far as possible, I'd combine your files into one force-viz.js:
CSS rules can be inlined by using d3.style in JS on the appropriate elements.
CSV can be inlined as a JavaScript string, parsed with d3.csvParse.
global_properties.js can just be in the same JS file.
index.html is unnecessary if you use d3.select(...).append(...) to construct the DOM tree you want, and instruct your client to write—
<div id="force-viz"></div>
—where they want the chart to appear, then d3.select that in your script.
This would mean all your client has to do is:
Place force-viz.js in a scripts/ directory.
Paste—
<div id="force-viz"></div>
<script src="scripts/force-viz.js"></script>
—into the text of any page, wherever they want the chart to appear.
Making it easy for you
If being forced to program into a single file is annoying, I recommend Browserify. It's a tool that can process a set of JavaScript files with require('whatever.js')-calls to each other, combining them appropriately into one file. With a plugin, it can even turn fs.readSync('data.csv') calls into strings containing that file's contents, which you could use with that CSV file.
That way, you could continue programming the thing as separate files, then run browserify to bundle them up for your client.
Or just do it manually, if this is a one-off project. Your call.

atom.io auto create html basic structure

Im using atom.io for some time now and really like it. there is just one thing im missing. I used to use brackets and sublime before and they both had a feature where you could create the basic structure of a html documents by just typing html.
this would just set the html, head and body tag. created the charset meta, title and link to css file.
I create a lot of html files a day so it would be really helpfull if I know the shortcode or the package which supports this!
You're looking for autocomplete-snippets.
Simply type html and press Enter
Here's a terrible GIF to prove it:
There is a nice Plugin, called emmet: https://atom.io/packages/emmet
When you got that, you just have to type ! -> tab in an empty document. You get pretty much the same result as #hatchet GIF.
If you have disabled the autocomplete functionality mentioned in the currently accepted answer, or want more flexibility than that allows, there is a file-templates package:
https://atom.io/packages/file-templates
Here are some basic instructions.
To install the package: edit->preferences->install->file-templates.
To save the template: packages->new template from this file.
To open a new file with that template, just hit ctrl-alt-n and
select it.
Make sure your file has .html added on the end of its name.
Then go back into Atom, type HTML, and press enter. Your boilerplate should appear. Solved my problem instantly!
If we install Emmet package we are not getting the boiler plate code. So I disabled emmet and it is working fine for me.
!tab is the command u seek. But it won't work unless you create a file and save it with the html extension...
So go create a new file in the directory u want, call it index.html and now go type !tab
It should work 100%, if not be sure u have emmet installed.

Handlebars NodeJS/Koa Script/Src Reference

The answer is probably going to make me bang my head on the keyboard, but for the life of me I can't seem to figure out how to reference a template file so that I can load it from a handlebars view.
Let's say the view is 'ROOT/views/intro/home.html'. In it I want to reference an external CSS file called style.css.
Let's say that this external CSS file is located at 'ROOT/assets/css/style.css'.
How would I reference this file in the view in the <link ref=""></link> tag? I have tried everything from
'../../assets/css/style.css' to
'../assets/css/style.css' to
even appending localhost to the front and referencing
'localhost/assets/css/style.css'.
Thank you in advance!
Figured it out! For anyone else having this problem, you have to declare the static path for public files in the middleware, using something like koa-static and opening up that folder for access like:
_app.use(serve(__dirname + '/public/'));
Hope this saves someone a lot of time! It definitely was a trip trying to figure this one out.

EPub viewer for Flex

Does any such control exist out of the box for Flex?
I see people say things like "EPUB is just a zip file of XML and HTML files, so it shouldn't be too hard"... yeah, I get that... but if such a control exists, I wouldn't have to write it.
Has anyone seen anything like this?
Brian
Check out the walflower project, it needs updating to the new TLF though.
http://designwithoutdesign.blogspot.com/2010/07/working-with-epub-files-in-flash-and.html
http://wir35.com/teaser/
https://github.com/maxl0rd/walflower/

Resources