Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Adds some random docs #693

Merged
merged 1 commit into from

3 participants

@icco

Nothing significant, but figured I'd do something after reading http://blog.parkermoore.de/2012/12/18/the-immediate-future-of-jekyll/.

@deanmao

that blog is getting lots of eyes... I use jekyll too, so I may have to contribute a few things to make my own life easier.

@mojombo mojombo commented on the diff
lib/jekyll/post.rb
@@ -44,8 +44,8 @@ def initialize(site, source, dir, name)
raise FatalException.new("#{msg} in #{@base}/#{name}")
end
- #If we've added a date and time to the yaml, use that instead of the filename date
- #Means we'll sort correctly.
+ # If we've added a date and time to the yaml, use that instead of the
+ # filename date Means we'll sort correctly.
@mojombo Owner
mojombo added a note

There's a missing period here after "date".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@mojombo mojombo commented on the diff
lib/jekyll/post.rb
@@ -64,7 +64,10 @@ def initialize(site, source, dir, name)
end
end
- # Spaceship is based on Post#date, slug
+ # Compares Post objects. First compares the Post date. If the dates are
+ # equal, it compares the Post slugs.
+ #
+ # +other+ is the object we are comparing to.
@mojombo Owner
mojombo added a note

Could you do this in TomDoc style? I'd love to have everything converted to that in the long run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@mojombo mojombo merged commit 934495b into jekyll:master
@mojombo
Owner

Merged, fixed up the few little things I saw, and TomDoc'd the rest of the post.rb file. Thanks for the contribution!

@icco

No worries, sorry I didn't get to the tomdoc fast enough, been a pretty busy week despite the holidays.

@icco icco deleted the icco:docs branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 17 additions and 3 deletions.
  1. +11 −0 lib/jekyll/filters.rb
  2. +6 −3 lib/jekyll/post.rb
View
11 lib/jekyll/filters.rb
@@ -57,6 +57,17 @@ def date_to_xmlschema(date)
date.xmlschema
end
+ # XML escape a string for use. Replaces any special characters with
+ # appropriate HTML entity replacements.
+ #
+ # input - The String to escape.
+ #
+ # Examples
+ #
+ # xml_escape('foo "bar" <baz>')
+ # # => "foo &quot;bar&quot; &lt;baz&gt;"
+ #
+ # Returns the escaped String.
def xml_escape(input)
CGI.escapeHTML(input)
end
View
9 lib/jekyll/post.rb
@@ -44,8 +44,8 @@ def initialize(site, source, dir, name)
raise FatalException.new("#{msg} in #{@base}/#{name}")
end
- #If we've added a date and time to the yaml, use that instead of the filename date
- #Means we'll sort correctly.
+ # If we've added a date and time to the yaml, use that instead of the
+ # filename date Means we'll sort correctly.
@mojombo Owner
mojombo added a note

There's a missing period here after "date".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
if self.data.has_key?('date')
# ensure Time via to_s and reparse
self.date = Time.parse(self.data["date"].to_s)
@@ -64,7 +64,10 @@ def initialize(site, source, dir, name)
end
end
- # Spaceship is based on Post#date, slug
+ # Compares Post objects. First compares the Post date. If the dates are
+ # equal, it compares the Post slugs.
+ #
+ # +other+ is the object we are comparing to.
@mojombo Owner
mojombo added a note

Could you do this in TomDoc style? I'd love to have everything converted to that in the long run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
#
# Returns -1, 0, 1
def <=>(other)
Something went wrong with that request. Please try again.