Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Commit

Permalink
Add Tutorial on application install, refs #60
Browse files Browse the repository at this point in the history
  • Loading branch information
clochix committed Oct 16, 2015
1 parent b251791 commit b13298a
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 31 deletions.
4 changes: 2 additions & 2 deletions client/app/views/note_view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ class exports.NoteView extends Backbone.View
###
setContent : (note) ->
if note.content
# means that the note had been saved in the olf markdown format
if !note.version
# means that the note had been saved in the old markdown format
if !note.version or /^#/gm.test note.content
@editor.setEditorContentFromMD(note.content)
# otherwise it was stored in html
else
Expand Down
31 changes: 19 additions & 12 deletions client/public/javascripts/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/public/javascripts/app.js.map

Large diffs are not rendered by default.

35 changes: 19 additions & 16 deletions init.coffee
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
server = require './server'
async = require "async"
Note = require './server/models/note'
Tree = require './server/models/tree'

DataTree = require("./common/data-tree").DataTree

## Small script to intialize finalNote of available applications.

note = new Note
title: "Tutorial"
parent_id: "tree-node-all"
path: "[\"Tutorial\"]"
content: """
# What is Cozy Notes ?
Cozy Notes is a simple yet powerful note manager. It can be used entirely with the keyboard and its original text editor makes formating incredibly fast.
Cozy Notes is a simple yet powerful note manager.
It can be used entirely with the keyboard and its original text editor
makes formating incredibly fast.
# Navigation
You organize your notes following a tree structure.
* To create a top level note, click the "+" button in the left panet on the right side of "My notes" logo
* To create a sub level note, hover the mouse on an existing note and press the "+" button
* To create a top level note, click the "+" button in the left panet on the
right side of "My notes" logo
* To create a sub level note, hover the mouse on an existing note and press
the "+" button
# Layout
You can structure your notes with two actions.
* Toggle between titles and bullet points pressing Alt + A or clicking "T" button
* Toggle between titles and bullet points pressing Alt + A or clicking
"T" button
* Indent and un-indent lines pressing Tab and Shift + Tab or using the buttons
# Tools
Expand All @@ -47,14 +54,10 @@ Note.create note, (err, finalNote) ->
process.exit 0

finalNote.index ["title", "content"], (err) ->
Tree.getOrCreate (err, tree) ->
if err
console.log err
console.log "Initialization failed (cannot update tree)"
process.exit(0)
dataTree = new DataTree tree.struct
dataTree.addNode finalNote

tree.updateAttributes struct: dataTree.toJson(), (err) ->
console.log "Initialization succeeds."
process.exit(0)
if err
console.log err
console.log "Initialization failed (can't index note)"
else
console.log "Done creating tutorial"
process.exit 0

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"coffee-script": "*"
},
"scripts": {
"postinstall": "coffee init.coffee",
"start": "node server.js",
"test": "cake tests"
},
Expand Down

0 comments on commit b13298a

Please sign in to comment.