Skip to content

Instantly share code, notes, and snippets.

@pbassiner
Last active December 22, 2016 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbassiner/c8afc3af6f591702bf173354fa7859ad to your computer and use it in GitHub Desktop.
Save pbassiner/c8afc3af6f591702bf173354fa7859ad to your computer and use it in GitHub Desktop.
Blog Post - Contributing to Open Source Projects - atom-scalariform: Ammonite support + scalariform properties relative to project code snippets
var projectPath = function(fileToFormatPath) {
var ref = atom.project.getDirectories();
var projectPath = '';
for (var i = 0, len = ref.length; i < len; i++) {
var directory = ref[i];
if (fileToFormatPath.indexOf(directory.path) > -1) {
projectPath = directory.path;
}
}
return projectPath;
}
if (activeTextEditor === '' ||
!(activeTextEditor.getPath().endsWith(".scala") || activeTextEditor.getPath().endsWith(".sc"))) {
atom.notifications.addError("You do not have a valid scala file open!");
}
if (activeTextEditor === '' || !activeTextEditor.getPath().endsWith(".scala")) {
atom.notifications.addError("You do not have a valid scala file open!");
}
html(
head(
title("title"),
link(rel := "stylesheet", href := "../blog.css")
),
body(
div(`class` := "container")(
div(`class` := "blog-header")(
h1(`class` := "blog-title")
),
div(`class` := "row")(
div(`class` := "blog-post")(
//...
)
)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment