Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demo migrated from ampl project. #18

Closed
wants to merge 78 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
c2bd3ec
[WiP] spliting out build functions into helpers
nelsonic Oct 12, 2014
6f539c7
traversing posts working
nelsonic Oct 12, 2014
f23203a
getPosts(function(err,posts){}) array of posts
nelsonic Oct 12, 2014
d63ab47
titles are clickable in summary view. full page post view working. sl…
nelsonic Oct 12, 2014
4c13a18
ever-expanding list of features...
nelsonic Oct 12, 2014
6c8168c
adds hapi, inert & nodemon dependencies see: https://github.com/dwyl/…
nelsonic Oct 28, 2015
aa92188
update links in package.json to dwyl
nelsonic Nov 29, 2015
7327f12
beginning to convert markdown to amp-html #24
jackcarlisle Dec 1, 2015
b31710d
changing img to amp-img with regex #24
jackcarlisle Dec 1, 2015
a65669f
set up the testing environment, wrote frist test. #36
Conorc1000 Dec 1, 2015
defe858
hard-coding dimensions for images (MVP requirements) #24 #37
jackcarlisle Dec 1, 2015
b3df4cd
first pass at async image dimension fetching. #37
des-des Dec 1, 2015
d139eea
made all request http
des-des Dec 1, 2015
a72c8af
linking together image dimensions with html creation. #24 #37
des-des Dec 2, 2015
ab917f9
wrote tests for helpers.js
Conorc1000 Dec 2, 2015
ca55d5e
finished integrating image dimension retrieval #37
des-des Dec 2, 2015
86a32ac
markdown being converted to amp html using remarkable
Dec 2, 2015
43c558f
#24 changed build code. Now includes amp html creation and uses remar…
des-des Dec 2, 2015
9def6dc
handlebars.js creates a blog post html page #39
thegsi Dec 2, 2015
0d777b2
front end tests #63
Conorc1000 Dec 2, 2015
6552c1c
Merge branch 'team2-master' of https://github.com/dwyl/adoro into tea…
des-des Dec 2, 2015
429e0fb
adding changes in views folder to github
thegsi Dec 2, 2015
2a5e78f
refactoring changing buffer to string
Jbarget Dec 2, 2015
6376d26
added front end Qunit testing environment #36
Conorc1000 Dec 3, 2015
d6c44bd
added front end Qunit testing environment #36
Conorc1000 Dec 3, 2015
dd3827c
fixing merge conflicts #24 #37
jackcarlisle Dec 3, 2015
281d6a7
fixed bug! #24, https://github.com/FAC6/facfaq/issues/5
des-des Dec 3, 2015
b777354
Merge branch 'team2-master' of https://github.com/dwyl/adoro into tea…
des-des Dec 3, 2015
47dba7b
some comments and merge conflict
des-des Dec 3, 2015
6c4a6be
removed jasmine files
Conorc1000 Dec 3, 2015
abc34dc
Merge branch 'team2-master' of https://github.com/dwyl/adoro into tea…
jackcarlisle Dec 3, 2015
e84813b
buildPost test passing #39
thegsi Dec 3, 2015
bb77209
buildPost test passing #39
thegsi Dec 3, 2015
971e1cb
Merge branch 'team2-master' into test
thegsi Dec 3, 2015
46d4c09
making site directory for compiled amp-html files #24 #37
jackcarlisle Dec 3, 2015
b2d2e1b
making site directory for compiled amp-html files #24 #37
jackcarlisle Dec 3, 2015
90d3ee8
merge conflict resolution #24 #37
jackcarlisle Dec 3, 2015
a9a8845
merge conflict resolution #24 #37
jackcarlisle Dec 3, 2015
26ec246
adding differentiation between post pages and index page creation #39
Jbarget Dec 3, 2015
641bb2d
adding differentiation between post pages and index page creation #39
Jbarget Dec 3, 2015
4c48504
Merge branch 'team2-master' of https://github.com/dwyl/adoro into tea…
jackcarlisle Dec 3, 2015
c98b06b
Merge branch 'team2-master' of https://github.com/dwyl/adoro into tea…
jackcarlisle Dec 3, 2015
5ddd602
refactoring handlebars.js and source files #39
Jbarget Dec 3, 2015
af1d169
Merge pull request #66 from dwyl/refactor
thegsi Dec 3, 2015
de456f1
merge conflits resolved#70
Conorc1000 Dec 3, 2015
6460dac
changing end point in server to deploy team2-master branch to heroku …
jackcarlisle Dec 3, 2015
dd7418a
Refactoring handlebars to include partials #39
mantagen Dec 3, 2015
fee47b6
Refactoring handlebars to include partials #39
mantagen Dec 3, 2015
30b5c7d
Merge pull request #72 from dwyl/partials
thegsi Dec 3, 2015
b293af3
converting images from md to amp #37
katkelemen Dec 4, 2015
7397c46
added css into templating. #69. @Joshua-Ronan-Phillips.
des-des Dec 5, 2015
883ac49
added css into templating. #69. @Joshua-Ronan-Phillips.
des-des Dec 5, 2015
74ec4db
#37 error fixed in handler.js convertImgTagInPost function
katkelemen Dec 5, 2015
6f76de3
merge
des-des Jan 7, 2016
0c566c5
cleaning up
des-des Jan 7, 2016
3711bbd
ampl files extracted from adoro
des-des Jan 19, 2016
96e016a
Merge branch 'adoro'
des-des Jan 19, 2016
62dec9c
fetching template stuff from adoro
des-des Jan 19, 2016
fd4a45b
rename handlebars file
des-des Jan 19, 2016
635bb55
Merge branch 'views'
des-des Jan 19, 2016
c3d90da
moved all templating from handlebars into es6 templates
des-des Jan 19, 2016
5be6e5f
build file from adoro
des-des Jan 19, 2016
093f973
Merge branch 'build'
des-des Jan 19, 2016
26c6480
ampl
des-des Jan 19, 2016
2276bb3
example server
des-des Jan 19, 2016
d41a8bc
much more control of how html is built. Can add custom rules to add c…
des-des Jan 20, 2016
5fe5092
example server now hasstyle
des-des Jan 20, 2016
508260a
choose protocal based on url. fix #10
des-des Jan 20, 2016
67c52f2
tests! fix #7
des-des Jan 20, 2016
1f38543
moved all dependecies not required for npm to dev-dependencies
des-des Jan 20, 2016
f4c4795
ready for publish!
des-des Jan 20, 2016
a9fe098
more stuff in npm ignore
des-des Jan 20, 2016
80bc62d
increased version num
des-des Jan 20, 2016
8547c92
procfile
des-des Jan 20, 2016
d4f787f
separate package for heroku
des-des Jan 20, 2016
2d204d1
move hapi into dependencies for heroku
des-des Jan 20, 2016
d4e941f
example should now use npm version of ampl
des-des Jan 20, 2016
19ad776
ampl as a dependency ....
des-des Jan 20, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

lib
30 changes: 30 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

src
example
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: node example/app.js
185 changes: 185 additions & 0 deletions example/amp.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
/*!
* Writ v1.0.2
*
* Copyright © 2015, Curtis McEnroe <[email protected]>
*
* https://cmcenroe.me/writ/LICENSE (ISC)
*/

/* Fonts, sizes & vertical rhythm */

html {
font-family: Palatino, Georgia, Lucida Bright, Book Antiqua, serif;
font-size: 16px;
line-height: 1.5rem;
}

code, pre, samp, kbd {
font-family: Consolas, Liberation Mono, Menlo, Courier, monospace;
font-size: 0.833rem;
}

kbd { font-weight: bold; }
h1, h2, h3, h4, h5, h6, th { font-weight: normal; }

/* Minor third */
h1 { font-size: 2.488em; }
h2 { font-size: 2.074em; }
h3 { font-size: 1.728em; }
h4 { font-size: 1.44em; }
h5 { font-size: 1.2em; }
h6 { font-size: 1em; }
small { font-size: 0.833em; }

h1, h2, h3 { line-height: 3rem; }

p, ul, ol, dl, table, blockquote, pre, h1, h2, h3, h4, h5, h6 {
margin: 1.5rem 0 0;
}
ul ul, ol ol, ul ol, ol ul { margin: 0; }

hr {
margin: 0;
border: none;
padding: 1.5rem 0 0;
}

/* Accounting for borders */
table {
line-height: calc(1.5rem - 1px);
margin-bottom: -1px;
}
pre {
margin-top: calc(1.5rem - 1px);
margin-bottom: -1px;
}

/* Colors */

body { color: #222; }
code, pre, samp, kbd { color: #111; }
a, nav a:visited { color: #00e; }
a:visited { color: #60b; }
mark { color: inherit; }

code, pre, samp, thead, tfoot { background-color: rgba(0, 0, 0, 0.05); }
mark { background-color: #fe0; }

main aside, blockquote, ins { border: solid rgba(0, 0, 0, 0.05); }
pre, code, samp { border: solid rgba(0, 0, 0, 0.1); }
th, td { border: solid #dbdbdb; }

/* Layout */

.wrapper-main {
width: 80%;
margin: auto;
}

body { margin: 1.5rem 1ch; }

body > header { text-align: center; }

main, body > footer {
display: block; /* Just in case */
max-width: 78ch;
margin: auto;
}

main figure, main aside {
float: right;
margin: 1.5rem 0 0 1ch;
}

main aside {
max-width: 26ch;
border-width: 0 0 0 0.5ch;
padding: 0 0 0 0.5ch;
}

/* Copy blocks */

blockquote {
margin-right: 3ch;
margin-left: 1.5ch;
border-width: 0 0 0 0.5ch;
padding: 0 0 0 1ch;
}

pre {
border-width: 1px;
border-radius: 2px;
padding: 0 0.5ch;
overflow-x: auto;
}
pre code {
border: none;
padding: 0;
background-color: transparent;
white-space: inherit;
}

img { max-width: 100%; }

/* Lists */

ul, ol, dd { padding: 0 0 0 3ch; }
dd { margin: 0; }

ul > li { list-style-type: disc; }
li ul > li { list-style-type: circle; }
li li ul > li { list-style-type: square; }

ol > li { list-style-type: decimal; }
li ol > li { list-style-type: lower-roman; }
li li ol > li { list-style-type: lower-alpha; }

nav ul {
padding: 0;
list-style-type: none;
}
nav ul li {
display: inline;
padding-left: 1ch;
white-space: nowrap;
}
nav ul li:first-child { padding-left: 0; }

/* Tables */

table {
width: 100%;
border-collapse: collapse;
overflow-x: auto;
}

th, td {
border-width: 1px;
padding: 0 0.5ch;
}

/* Copy inline */

a { text-decoration: none; }

sup, sub {
font-size: 0.75em;
line-height: 1em;
}

ins {
border-width: 1px;
padding: 1px;
text-decoration: none;
}

mark {
padding: 1px;
}

code, samp {
border-width: 1px;
border-radius: 2px;
padding: 0.1em 0.2em;
white-space: nowrap;
}
40 changes: 40 additions & 0 deletions example/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
var fs = require('fs');
var path = require('path');

var Hapi = require('hapi');
var Inert = require('inert');

var ampl = require('ampl');

var css = fs.readFileSync(path.join(__dirname, './amp.css'));

var port = process.env.PORT || 3000;
var server = new Hapi.Server();

server.connection({ port: port });

server.register(Inert, function (err) {
server.route( {
method: 'GET',
path: '/{param*}',
handler: {
directory: {
path: path.join(__dirname, 'public'),
listing: true
}
}
});
server.route({
method: 'POST',
path: '/convert',
handler: function(request, reply) {
ampl.parse(request.payload.md, css, function(ampHtml) {
return reply(ampHtml);
});
}
})
});

server.start(function(){
console.log('server listening on port', port);
});
5 changes: 5 additions & 0 deletions example/public/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.big {
width: 80%;
min-height: 50vh;
text-align: left;
}
16 changes: 16 additions & 0 deletions example/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ampl demo</title>
<link rel="stylesheet" href="/custom.css" media="screen" charset="utf-8">
</head>
<body>
<h1>ampl Demo</h1>
<form action="../convert" method="POST">
<textarea name="md" class='big' placeholder="enter markdown"></textarea>
<input type="submit" value="convert">
</form>
<script type="text/javascript" src="./main.js"></script>
</body>
</html>
22 changes: 19 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"name": "ampl",
"version": "1.0.0",
"version": "1.0.1",
"description": "ampl converts your markdown files into AMP-compliant html so they can be cached by google for the fastest possible page load",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "babel-node test",
"watch-build": "babel src -d lib -w",
"build": "babel src -d lib",
"prepublish" : "npm run build"
},
"repository": {
"type": "git",
Expand All @@ -20,5 +23,18 @@
"bugs": {
"url": "https://github.com/nelsonic/ampl/issues"
},
"homepage": "https://github.com/nelsonic/ampl#readme"
"homepage": "https://github.com/nelsonic/ampl#readme",
"devDependencies": {
"babel-cli": "^6.4.0",
"babel-preset-es2015": "^6.3.13",
"tape": "^4.4.0"
},
"dependencies": {
"ampl": "^1.0.0",
"hapi": "^12.1.0",
"inert": "^3.2.0",
"htmlparser2": "^3.9.0",
"image-size": "^0.4.0",
"remarkable": "^1.6.1"
}
}
Loading