Skip to content

Instantly share code, notes, and snippets.

@franTarkenton
Last active November 4, 2020 02:31
Show Gist options
  • Select an option

  • Save franTarkenton/dd1404f1a84d3a7baa0b2b74367c10bc to your computer and use it in GitHub Desktop.

Select an option

Save franTarkenton/dd1404f1a84d3a7baa0b2b74367c10bc to your computer and use it in GitHub Desktop.
A introductory guide to getting started with SMK, for users that might be wondering... What is node, where to type that? what editor should I use, etc

Introduction

This is a really really simple guide to try to get people with little to no experience with node or command lines or software development experience, started with using the Simple Map Kit Command Line Interface (SMK-CLI). Documentation already exists at the SMK-CLI github repository, however for some it starts with too many assumptions about what a user may or may not know. This document attempts to bring it down to mere mortal level.

Getting started / Installing Dependencies

In subsequent sections we will install the software you will need in order to be able to use the SMK-CLI

Install choco

Choco, is a super awesome package installer that allows you to install stuff with easy command line interface. I could fill this page with why its awesome, but am trying to keep it brief!

Installed choco, get from : https://chocolatey.org/

Use choco to install node and other useful packages

  • right click on windows icon
  • type in 'powershell'
  • chooose 'run as adminstrator'

once the powershell admin window is open run the following choco command:

choco install nodejs vscode cmder -Y

installs node js, vscode editor, cmder

Set Execution Policy

  • in the same administrator window that you opened in the previous step copy and paste the following command to modify the default execution policy on your machine. This is required in order to be able to run node scripts.

Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force

Now you should have everthing you need to get started with SMK-CLI, you can now close the powershell window.

Install SMK-CLI

create directory and open VS Code

  • create a folder where you will put your smk project
  • navigate to that folder in windows explorer
  • right click and choose 'open with code'

or if you are command line kinda person:

  • navigate or create the folder
  • once in the project directory start vscode code .

Now you should have VSCODE open.

open vscode terminal

In VS code we are now going to open a terminal...

from the pulldown menu at the top... select terminal->New Terminal

Now you should have a command prompt open in VSCODE. By default the terminal type is usually powershell, The rest of this doc assumes that you are using powershell in the terminal.

By default the shell that the terminal will open is likely going to be powershell. If you wanted to use a different shell see this

Install SMK

  • verify that you are in the correct directory by...
  • type pwd
  • that will tell you what directory you are currently in. Verify it aligns with the directory you wanted to create your smk app inside of. The directory should be empty. the command prompt in in the correct directory. (it is unlikely that it will not be!)

in the powershell window type the following:

npm install -global smk-cli

Now verify that the Simple Map Kit command line is working for you. Type the following into the powershell terminal:

smk help

You should get a return text similar to what is displayed below:

PS C:\Kevin\proj\smk-demo> smk help
  ()                     _      _ _ _               _   ,      
  /\                    //     ' ) ) )             ' ) /    _/_
 /  )  o ______    _   //  _    / / /  __.    _     /-<   o /  
/__/__<_/ / / <_  /_)_</_ </_  / ' (_ (_/|_  /_)_  /   ) <_<__ 
                 /                          /
                '                          ' CLI v1.0.0-beta.12
Usage: index create|edit|help
To create a new SMK project:     index create [name]
To modify an SMK project config: index edit [-p port]
PS C:\Kevin\proj\smk-demo> 

Now create your first smk app

smk create

The cli will then prompt you with a bunch of questions. Answer them as best you can but do not get hung up on any of them as you can change them later.

Once complete your browser should open up with the SMK config tool where you can configure your app.

Edit Existing SMK app

  • open VSCode in the SMK app directory
  • open a terminal
  • edit the app by typing smk edit

That should open up the browser with you current smk based map

Deploying your app to github pages

TBD ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment