Permalink
Browse files

Updated with latest version of website + markdown

  • Loading branch information...
1 parent 4421dfd commit b50df183567400983c77c46a3f188cd24fd394bd @DAddYE DAddYE committed Mar 24, 2013
Showing with 7,189 additions and 7,850 deletions.
  1. +7 −0 Gemfile
  2. +5 −80 README.md
  3. +75 −0 Rakefile
  4. +0 −61 guides/3rd-party-plugins.textile
  5. +528 −0 guides/adding-new-components.md
  6. +0 −645 guides/adding-new-components.textile
  7. +729 −0 guides/application-helpers.md
  8. +0 −675 guides/application-helpers.textile
  9. +66 −0 guides/asynchronous-concurrency-with-padrino.md
  10. +124 −0 guides/basic-projects.md
  11. +0 −132 guides/basic-projects.textile
  12. +626 −0 guides/blog-tutorial.md
  13. +0 −707 guides/blog-tutorial.textile
  14. +8 −0 guides/caching-support.md
  15. +0 −7 guides/caching-support.textile
  16. +404 −0 guides/controllers.md
  17. +0 −448 guides/controllers.textile
  18. +132 −0 guides/development-commands.md
  19. +0 −158 guides/development-commands.textile
  20. +26 −0 guides/examples.md
  21. +0 −19 guides/examples.textile
  22. +0 −26 guides/exception-handling.textile
  23. +28 −0 guides/extensions.md
  24. +0 −26 guides/extensions.textile
  25. +384 −0 guides/generators.md
  26. +0 −407 guides/generators.textile
  27. +169 −0 guides/getting-started.md
  28. +0 −197 guides/getting-started.textile
  29. +52 −0 guides/home.md
  30. +0 −57 guides/home.textile
  31. +18 −0 guides/installation.md
  32. +0 −15 guides/installation.textile
  33. +120 −0 guides/localization.md
  34. +0 −140 guides/localization.textile
  35. +38 −0 guides/mounting-applications.md
  36. +0 −43 guides/mounting-applications.textile
  37. +111 −0 guides/padrino-admin.md
  38. +0 −123 guides/padrino-admin.textile
  39. +346 −0 guides/padrino-cache.md
  40. +0 −415 guides/padrino-cache.textile
  41. +195 −0 guides/padrino-mailer.md
  42. +0 −233 guides/padrino-mailer.textile
  43. +176 −0 guides/rake-tasks.md
  44. +0 −177 guides/rake-tasks.textile
  45. +89 −0 guides/running-padrino-on-jruby.md
  46. +0 −193 guides/running-padrino-on-jruby.textile
  47. +135 −0 guides/standalone-usage-in-sinatra.md
  48. +0 −140 guides/standalone-usage-in-sinatra.textile
  49. +103 −0 guides/the-bleeding-edge.md
  50. +0 −102 guides/the-bleeding-edge.textile
  51. +8 −0 pages/admin.md
  52. +0 −6 pages/admin.textile
  53. +27 −0 pages/agnostic.md
  54. +0 −26 pages/agnostic.textile
  55. +23 −0 pages/comprehensive.md
  56. +0 −31 pages/comprehensive.textile
  57. +65 −0 pages/contribute.md
  58. +0 −61 pages/contribute.textile
  59. +24 −0 pages/drop-in-admin.md
  60. +0 −22 pages/drop-in-admin.textile
  61. +13 −0 pages/home-code.md
  62. +0 −11 pages/home-code.textile
  63. +20 −0 pages/home.md
  64. +0 −19 pages/home.textile
  65. +19 −0 pages/lightweight.md
  66. +0 −20 pages/lightweight.textile
  67. +24 −0 pages/mic.md
  68. +0 −20 pages/mic.textile
  69. +12 −0 pages/sinatra-core.md
  70. +0 −15 pages/sinatra-core.textile
  71. +8 −0 pages/slogan.md
  72. +0 −6 pages/slogan.textile
  73. +12 −0 pages/team.md
  74. +0 −13 pages/team.textile
  75. +315 −0 pages/why.md
  76. +0 −340 pages/why.textile
  77. +24 −92 posts/addressing-concerns-about-padrino.md
  78. +17 −0 posts/code-tv-padrino-code-school.md
  79. +14 −0 posts/darío-cravero-joins-the-padrino-core-team.md
  80. +17 −21 posts/euruko-2011-is-coming-who-s-up-for-a-meeting.md
  81. +22 −24 posts/fikus-cms.md
  82. +26 −0 posts/hosting-our-first-padrino-meetup-in-san-francisco.md
  83. +10 −10 posts/introducing-padrino.md
  84. +22 −0 posts/json-gem-vulnerability.md
  85. +56 −120 posts/looking-at-projects-using-padrino.md
  86. +11 −18 posts/o-reilly-sinatra-up-and-running-book.md
  87. +103 −180 posts/padrino-0-10-0-routing-upgrades-rbx-and-jruby-support-and-minor-breaking-changes.md
  88. +30 −61 posts/padrino-0-10-1-mongo-cache-store-routing-translation-and-bug-fixes.md
  89. +31 −58 posts/padrino-0-10-2-activesupport-3-1-travisci-support-routing-and-misc-bug-fixes-galore.md
  90. +104 −0 posts/padrino-0-10-3-sinatra-1-3-documentation-minitest-improved-logger-and-more.md
  91. +39 −0 posts/padrino-0-10-4-hot-fix-release-yard-documentation-and-more.md
  92. +74 −0 posts/padrino-0-10-6-activesupport-3-2-minirecord-html5-helpers-and-bug-fixes.md
  93. +34 −0 posts/padrino-0-10-7-reloader-jruby-helpers-and-other-bug-fixes.md
  94. +269 −0 posts/padrino-0-11-0-released-padrino-lives.md
  95. +109 −181 posts/padrino-0-9-10-released-built-for-speed.md
  96. +121 −184 posts/padrino-0-9-11-release-overview.md
  97. +17 −32 posts/padrino-0-9-13-gets-pushed-early.md
  98. +16 −20 posts/padrino-0-9-14-important-hotfixes.md
  99. +28 −41 posts/padrino-0-9-15-release-new-core-member.md
  100. +26 −21 posts/padrino-0-9-16-important-hotfixes-to-the-admin.md
  101. +11 −6 posts/padrino-0-9-17.md
  102. +11 −6 posts/padrino-0-9-18-fixes.md
  103. +38 −19 posts/padrino-0-9-19-sinatra-1-1-compat-screencast.md
  104. +23 −42 posts/padrino-0-9-20-now-works-with-sinatra-1-2.md
  105. +50 −64 posts/padrino-0-9-21-nested-forms-translations-and-more.md
  106. +23 −41 posts/padrino-0-9-22-quick-followup-release.md
  107. +11 −2 posts/padrino-0-9-23-sinatra-1-2-compatibility.md
  108. +131 −254 posts/padrino-0-9-25-slim-and-erubis-caching-and-fixes.md
  109. +23 −50 posts/padrino-0-9-26-hotfix-release.md
  110. +45 −72 posts/padrino-0-9-27-project-settings-routing-compatibility-and-bug-fixes.md
  111. +14 −19 posts/padrino-0-9-28-reloader-compatibility-and-bug-fixes.md
  112. +42 −95 posts/padrino-0-9-29-stability-compatibility-and-bug-fix-release.md
  113. +10 −14 posts/padrino-0-9-9-released-with-screencast.md
  114. +105 −155 posts/padrino-and-omniauth-overview.md
  115. +12 −23 posts/padrino-gets-interviewed-by-thechangelog.md
  116. +23 −45 posts/padrino-moving-forward.md
  117. +10 −3 posts/padrino-slides.md
  118. +12 −15 posts/padrino-user-resources-and-screencasts.md
  119. +11 −19 posts/padrino-weekly-issue-1-announcing-padrino-weekly-changelog-podcast-0-9-11-13-released.md
  120. +9 −11 posts/padrino-weekly-issue-2-simple-apps-website-now-open-source.md
  121. +18 −16 posts/padrino-welcomes-new-core-contributors.md
  122. +39 −0 posts/sleep-well-yaml-vulnerabilites-and-padrino.md
  123. +18 −0 posts/thank-you-steve.md
  124. +16 −0 posts/upgrade-rack-immediately.md
View
@@ -0,0 +1,7 @@
+# A sample Gemfile
+source "https://rubygems.org"
+
+gem 'bson_ext'
+gem 'net-ssh-gateway'
+gem 'mongo'
+gem 'pandoc-ruby'
View
@@ -7,87 +7,12 @@ Feel free to fork it, apply your corrections or make a useful translation.
* Word wrap must be set to 110
* Encoding UTF-8
-## Internal Links
+## Syntax
-```
-[[Page Title]]
-```
+[GitHub Flavored Markdown](https://help.github.com/articles/github-flavored-markdown)
-## Code Highlighting:
+## Author(s)
-```
-pre[ruby], pre[html], pre[bash], pre[erb]
-```
+* [DAddYE](https://github.com/daddye), articles, guides, code.
-## Phrase modifiers:
-
-```
-_emphasis_
-*strong*
-__italic__
-**bold**
-??citation??
-- deleted text -
-+ inserted text +
-^ superscript ^
-~ subscript ~
-%span%
-@code@
-```
-
-## Block modifiers:
-
-```
-h n . heading
-bq. Blockquote
-fn n . Footnote
-p. Paragraph
-bc. Block code
-pre. Pre-formatted
-# Numeric list
-* Bulleted list
-```
-
-## Links:
-
-```
-"linktext":http://...
-```
-
-## Punctuation:
-
-```
-"quotes" → “quotes”
-'quotes' → ‘quotes’
-it's → it's
-em -- dash → it’s
-en - dash → en em — dash
-2 x 4 → 2 2 × 4
-foo(tm) → foo™
-foo(r) → foo®
-foo(c) → foo©
-```
-
-## Alignment:
-
-```
-> right
-< left
-= center
-<> justify
-```
-
-## Tables:
-
-```
-|_. a|_. table|_. header|
-|a|table|row|
-|a|table|row|
-```
-
-## Images:
-
-```
-!imageurl!
-!imageurl!:http://...
-```
+*add_you_here*
View
@@ -0,0 +1,75 @@
+require 'bundler/setup'
+require 'mongo'
+require 'net/ssh/gateway'
+require 'yaml'
+require 'pandoc-ruby'
+
+def on_remote(&block)
+ gateway = Net::SSH::Gateway.new('lps2.lipsiasoft.com', 'root')
+
+ # Open port 27018 to forward to 127.0.0.1:27017
+ # on the remote host provided above
+ gateway.open('127.0.0.1', 27017, 27018)
+
+ # Connect to local port set in previous statement
+ conn = Mongo::Connection.new('127.0.0.1', 27018)
+ @_db = conn['padrino_www']
+
+ # Invoke block with current db
+ yield @_db
+
+ # Just printing out stats to show that it works
+ # p conn.db('padrino_www').stats
+ensure
+ gateway.shutdown!
+end
+
+def db
+ @_db
+end
+
+def category_name(id)
+ cat = db['categories'].find_one(_id: id)
+ cat['name'] if cat
+end
+
+def convert(code, *args)
+ args.push({ from: :html, to: 'markdown_github+fenced_code_blocks', columns: 110 }, 'atx-headers', 'normalize')
+ PandocRuby.convert(code, *args)
+end
+
+def gen(kind, doc)
+ account = db['accounts'].find_one(_id: doc['author_id'])
+ categories = doc['category_ids'] ? doc['category_ids'].map(&method(:category_name)) : []
+ metadata = {}
+ metadata['date'] = Date.parse(doc['created_at'].to_s)
+ metadata['author'] = account['name']
+ metadata['email'] = account['email']
+ metadata['categories'] = categories.join(', ') unless categories.empty?
+ metadata['tags'] = doc['tags'] if doc['tags']
+ metadata['title'] = doc['title'].strip.gsub(/\r|\n/, '')
+
+ file = "./#{kind}/#{doc['permalink']}.md"
+ puts " writing #{file} ..."
+
+ File.open(file, 'w') do |f|
+ f.write YAML.dump(metadata)
+ f.puts '---'
+ f.puts
+ if doc['summary_html'] && !doc['summary_html'].empty?
+ f.write convert(doc['summary_html'])
+ f.write "\n\n<break>\n\n" unless doc['body_html'].nil? || doc['body_html'].empty?
+ end
+ f.write convert(doc['body_html'])
+ end
+end
+
+desc 'Download new stuff'
+task :download do
+ on_remote do
+ %w[posts guides pages].each do |kind|
+ puts "Downloading #{kind} ..."
+ db[kind].find.each { |doc| gen(kind, doc) }
+ end
+ end
+end
@@ -1,61 +0,0 @@
----
-:author: Foo Bar
-:title: 3rd Party Plugins
----
-Padrino is a modular framework. As such, you can leverage other libraries such as Sinatra libraries which
-complement Padrino quite well.
-
-h2. Rendering JSON with sinatra-contrib
-
-First you must reference ["sinatra-contrib":https://github.com/sinatra/sinatra-contrib] in your Gemfile:
-
-<pre lang="ruby"><code>
-#Gemfile
-source :rubygems
-
-# Server requirements
-# gem 'thin' # or mongrel
-# gem 'trinidad', :platform => 'jruby'
-
-# Project requirements
-gem 'rake'
-gem 'sinatra-flash', :require => 'sinatra/flash'
-
-# Component requirements
-gem 'haml'
-
-# Test requirements
-
-# Padrino Stable Gem
-gem 'padrino', :path => '~/Desktop/code/padrino-framework'
-
-# Or Padrino Edge
-# gem 'padrino', :git => 'git://github.com/padrino/padrino-framework.git'
-
-# Or Individual Gems
-# %w(core gen helpers cache mailer admin).each do |g|
-# gem 'padrino-' + g, '0.10.7'
-# end
-
-gem 'sinatra-contrib'
-</code></pre>
-
-
-You may use the #json method after you have registered the sinatra helper:
-
-<pre lang="ruby"><code>
-class MyJsonApp < Padrino::Application
- register Padrino::Rendering
- register Padrino::Mailer
- register Padrino::Helpers
-
-
- helpers Sinatra::JSON
-
- enable :sessions
- get '/' do
- hash = {foo: 'bar'}
- json hash
- end
-end
-</code></pre>
Oops, something went wrong.

0 comments on commit b50df18

Please sign in to comment.