Permalink
Browse files

update markdown note

  • Loading branch information...
1 parent 6bb3863 commit ec5c094122dd0a8acac8ac239429c3635a2e5d66 @geraldb geraldb committed May 26, 2013
View
@@ -30,7 +30,7 @@ your markdown library of choice. Preconfigured markdown libraries include
## Usage - Web Service / HTTP (JSON) API - `GET /markdown`
Try the `markdown` HTTP (JSON) API running
-on Heroku [`hypertext.herokuapp.com`](http://hypertext.herokuapp.com).
+on Heroku [`note.herokuapp.com`](http://note.herokuapp.com).
Example:
@@ -180,7 +180,7 @@ Just install the gem:
## Dependencies / Building Blocks
-[Markdown Notepad](https://github.com/geraldb/markdown-notepad) - Another simple single-page, server-less Markdown editor
+[Markdown Note](https://github.com/geraldb/markdown-note) - Another simple single-page, server-less Markdown editor
in JavaScript & Hypertext.
View
@@ -54,17 +54,17 @@ def welcome_markdown
erb :service
end
- get %r{/(test|t|notepad)$} do
+ get %r{/(test|t|note|notes|n)$} do
# for testing/debugging use copied sources 1:1 from markdown-notepad repo
- redirect '/notepad/notepad.html'
+ redirect '/note.html'
end
- get %r{/(note|notes|n)$} do
- # NB: do NOT include notepad in route/path (we want notepad/* to function as static resource)!
+ get %r{/(editor|edit|ed|e)$} do
+ # NB: use editor for "ruby-enhanced" parts of note
@welcome_markdown = welcome_markdown
@welcome_html = Markdown.new( @welcome_markdown ).to_html
- erb :notepad
+ erb :editor
end
get '/' do
@@ -17,7 +17,7 @@ a#input-toggle, a#input-toggle:visited, a#input-toggle:hover {
-#input #notepad {
+#input #note {
width: 100%; min-height: 600px;
-moz-box-sizing: border-box;
@@ -65,6 +65,6 @@ a#input-toggle, a#input-toggle:visited, a#input-toggle:hover {
display: none;
width: 21px;
height: 5px;
- background: url('i/dots-white.gif') no-repeat;
+ background: url('../../i/dots-white.gif') no-repeat;
/* -webkit-transition: all 0.1s linear; */
}
@@ -1,4 +1,10 @@
+/***********
+ * fix: use scss or less; cleanup css
+ *
+ ****/
+
+
.markdown a,
.markdown a:visited {
color: #2e80d3;
@@ -15,7 +15,7 @@ var markdown_apis_new = function() {
function _get_dingus_via_proxy( api_url, api_params, handle_html )
{
api_params.url = api_url; // add url to params
- var api_proxy_url = 'http://hypertext.herokuapp.com/proxy'
+ var api_proxy_url = 'http://note.herokuapp.com/proxy'
_get_dingus( api_proxy_url, api_params, handle_html );
}
@@ -26,7 +26,7 @@ var markdown_apis_new = function() {
text: text,
lib: lib
}
- var api_url = 'http://hypertext.herokuapp.com/markdown/dingus';
+ var api_url = 'http://note.herokuapp.com/markdown/dingus';
_get_dingus( api_url, api_params, handle_html );
}
@@ -37,7 +37,7 @@ var markdown_apis_new = function() {
var api_params = {
text: text
}
- var api_url = 'http://hypertext.herokuapp.com/markdown/dingus';
+ var api_url = 'http://note.herokuapp.com/markdown/dingus';
_get_dingus( api_url, api_params, handle_html );
}
@@ -1,6 +1,6 @@
-var markdown_notepad_new = function( opts ) {
+var markdown_note_new = function( opts ) {
// use module pattern (see JavaScript - The Good Parts)
@@ -36,8 +36,8 @@ var markdown_notepad_new = function( opts ) {
output_update: '#output-update', // a/link for update action
output_loading: '#output-loading', // div for loading gif anim
- input: '#notepad', // textarea for markdown source
- input_lib: '#notepad-lib', // select inputbox for markdown libs/engines
+ input: '#note', // textarea for markdown source
+ input_lib: '#note-lib', // select inputbox for markdown libs/engines
input_toggle: {
id: '#input-toggle',
@@ -170,4 +170,4 @@ var markdown_notepad_new = function( opts ) {
update: update_output,
toggle: toggle_output
}
-} // fn markdown_notepad_new
+} // fn markdown_note_new
@@ -2,24 +2,22 @@
<html>
<head>
<meta charset='UTF-8'>
- <title>markdown notepad</title>
+ <title>Markdown Note</title>
- <link href='notepad.css' rel='stylesheet'>
- <link href='markdown.css' rel='stylesheet'>
-
- <script src='lib/jquery-2.0.1.min.js'></script>
- <script src='lib/showdown.min.js'></script>
- <script src='lib/pagedown.js'></script>
+ <link href='css/markdown/note.css' rel='stylesheet'>
+ <link href='css/markdown/themes/basic.css' rel='stylesheet'>
- <script src='markdown.api.js'></script>
- <script src='markdown.lib.js'></script>
-
- <script src='notepad.js'></script>
+ <script src='js/lib3rd/jquery-2.0.1.min.js'></script>
+ <script src='js/lib3rd/showdown.min.js'></script>
+ <script src='js/lib3rd/pagedown.js'></script>
+
+ <script src='js/markdown.api.js'></script>
+ <script src='js/markdown.lib.js'></script>
+
+ <script src='js/markdown.note.js'></script>
<script>
$(document).ready( function () {
-
- var notepad = markdown_notepad_new();
-
+ markdown_note_new();
});
</script>
</head>
@@ -36,7 +34,7 @@
<!-- first column -->
<div id='input'>
- <textarea id='notepad' class='black'></textarea>
+ <textarea id='note' class='black'></textarea>
</div>
</td>
@@ -53,7 +51,7 @@
<!-- first column -->
<span>
- Use <select id='notepad-lib'></select>
+ Use <select id='note-lib'></select>
</span>
<a id='output-update' href='#'>[ Update ]</a>
@@ -1,5 +1,5 @@
-<%= erb :'_notepad_setup' %>
+<%= erb :'_editor_setup' %>
<table width='100%'>
@@ -12,7 +12,7 @@
<!-- first column -->
<div id='input'>
- <textarea id='notepad' class='black'></textarea>
+ <textarea id='note' class='black'></textarea>
</div>
</td>
@@ -29,7 +29,7 @@
<!-- first column -->
<span>
- Use <select id='notepad-lib'></select>
+ Use <select id='note-lib'></select>
</span>
<a id='output-update' href='#'>[ Update ]</a>
@@ -0,0 +1,12 @@
+
+<link href="<%= url('/css/markdown/note.css') %>" rel='stylesheet'>
+<link href="<%= url('/css/markdown/themes/basic.css') %>" rel='stylesheet'>
+
+<script src="<%= url('/js/lib3rd/jquery-2.0.1.min.js') %>"></script>
+<script src="<%= url('/js/lib3rd/showdown.min.js') %>"></script>
+<script src="<%= url('/js/lib3rd/pagedown.js') %>"></script>
+
+<script src="<%= url('/js/markdown.api.js') %>"></script>
+<script src="<%= url('/js/markdown.lib.js') %>"></script>
+
+<script src="<%= url('/js/markdown.note.js') %>"></script>
@@ -4,8 +4,8 @@
/* NB: we need to use to_json (to escape newlines in string if present etc.)
*/
-
- var notepad = markdown_notepad_new( {
+
+ markdown_note_new( {
welcome: {
markdown: <%= @welcome_markdown.to_json %>,
html: <%= @welcome_html.to_json %>
@@ -1,12 +0,0 @@
-
-<link href="<%= url('/notepad/notepad.css') %>" rel='stylesheet'>
-<link href="<%= url('/notepad/markdown.css') %>" rel='stylesheet'>
-
-<script src="<%= url('/notepad/lib/jquery-2.0.1.min.js') %>"></script>
-<script src="<%= url('/notepad/lib/showdown.min.js') %>"></script>
-<script src="<%= url('/notepad/lib/pagedown.js') %>"></script>
-
-<script src="<%= url('/notepad/markdown.api.js') %>"></script>
-<script src="<%= url('/notepad/markdown.lib.js') %>"></script>
-
-<script src="<%= url('/notepad/notepad.js') %>"></script>
@@ -1,5 +1,5 @@
-<%= erb :'_notepad' %>
+<%= erb :'_editor' %>
<!--
<hr>
@@ -1,6 +1,6 @@
-<%= erb :'_notepad' %>
+<%= erb :'_editor' %>
<%= erb :'_libs' %>

0 comments on commit ec5c094

Please sign in to comment.