Skip to content

Commit 02c29bb

Browse files
author
Shawn McCool
committed
want to kill myself
1 parent 00965d8 commit 02c29bb

38 files changed

+195
-4
lines changed

Vagrantfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Vagrant::Config.run do |config|
77

88
config.vm.network :hostonly, "10.10.10.10"
99

10-
config.vm.share_folder "vagrant-root", "/vagrant", ".", :mount_options => ['dmode=777','fmode=777', 'uid=1000', 'gid=33']
10+
config.vm.share_folder("vagrant-root", "/vagrant", ".", :mount_options => ['dmode=777','fmode=777', 'uid=1000', 'gid=33'])
1111

1212
config.vm.provision :chef_solo do |chef|
1313

app/config/app.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122

123123
'Lio\ServiceProviders\GitHubServiceProvider',
124124
'Lio\ServiceProviders\CommentServiceProvider',
125+
'Lio\ServiceProviders\MarkdownServiceProvider',
125126
),
126127

127128
/*

app/domain/Lio/Comments/CommentPresenter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php namespace Lio\Comments;
22

33
use McCool\LaravelAutoPresenter\BasePresenter;
4-
use \Michelf\MarkdownExtra;
4+
use App;
55

66
class CommentPresenter extends BasePresenter
77
{
@@ -42,6 +42,6 @@ public function created_ago()
4242

4343
public function body()
4444
{
45-
return MarkdownExtra::defaultTransform($this->resource->body);
45+
return App::make('markdown')->transform($this->resource->body);
4646
}
4747
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php namespace Lio\Markdown;
2+
3+
use \Michelf\MarkdownExtra;
4+
5+
class Markdown extends MarkdownExtra
6+
{
7+
public function transform($content)
8+
{
9+
$parsedContent = parent::transform($content);
10+
$parsedContent = str_replace('<code>', '<code class="prettyprint">', $parsedContent);
11+
12+
return $parsedContent;
13+
}
14+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php namespace Lio\ServiceProviders;
2+
3+
use Illuminate\Support\ServiceProvider;
4+
5+
class MarkdownServiceProvider extends ServiceProvider
6+
{
7+
protected $defer = true;
8+
9+
public function register()
10+
{
11+
$this->app->singleton('markdown', function($app) {
12+
return new \Lio\Markdown\Markdown;
13+
});
14+
}
15+
16+
public function provides()
17+
{
18+
return ['markdown'];
19+
}
20+
}

app/views/forum/thread.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
@stop
66

77
@section('content')
8+
89
<div class="row forum">
910
<div class="small-12 columns comments">
1011
@foreach($comments as $comment)
@@ -58,4 +59,5 @@
5859
</div>
5960
@stop
6061

61-
@include('layouts._markdown_editor')
62+
@include('layouts._markdown_editor')
63+
@include('layouts._code_prettify')
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@section('scripts')
2+
@parent
3+
<script src="{{ asset('javascripts/vendor/google-code-prettify/run_prettify.js') }}"></script>
4+
@stop
5+
6+
@section('styles')
7+
@parent
8+
<link rel="stylesheet" href="{{ asset('javascripts/vendor/google-code-prettify/prettify.css') }}">
9+
@stop

public/javascripts/vendor/google-code-prettify/lang-apollo.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/javascripts/vendor/google-code-prettify/lang-basic.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
Copyright (C) 2011 Google Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
var a=null;
17+
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a],
18+
["typ",/^:[\dA-Za-z-]+/]]),["clj"]);

0 commit comments

Comments
 (0)