re-org 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.org CHANGED
@@ -13,7 +13,7 @@ to re-organize the files in a less chaotic manner.
13
13
  =re-org= is distributed using =rubygems=:
14
14
 
15
15
  #+begin_src sh
16
- $ gem install re-org
16
+ $ gem install re-org
17
17
  #+end_src
18
18
 
19
19
  ** Usage
@@ -22,31 +22,96 @@ The idea here is to have a pair of ~todo~ and ~done~ folders.
22
22
  Writings that are still in progress would go into the ~todo~ folder
23
23
  and those that are considered as finished can go into the ~done~ directory.
24
24
 
25
+ Let's say that we want to create a new writing:
26
+
25
27
  #+begin_src sh
26
- re-org
28
+ $ re-org new writing
29
+ #+end_src
30
+
31
+ This would create a file at =todo/2013-12-09-november.org= with the
32
+ following contents below that we can use to just start writing:
33
+
34
+ #+begin_src org
35
+ # -*- mode: org -*-
36
+ ,#+OPTIONS: ^:nil
37
+ ,#+TITLE: November
38
+ ,#+DATE: 2013-12-09
39
+ ,#+STARTUP: showeverything
40
+ ,#+NOTEBOOK: re-org
41
+
42
+ ,*
43
+ :PROPERTIES:
44
+ :DATE: 2013-12-09
45
+ :NOTEBOOK: re-org
46
+ :END:
47
+
48
+ ,* COMMENT ________
49
+ # Local Variables:
50
+ # eval: (auto-fill-mode t)
51
+ # eval: (progn (goto-line 0)(re-search-forward ":PROPERTIES:") (org-narrow-to-subtree))
52
+ # End:
27
53
  #+end_src
28
54
 
29
- (the name of these folders could depend of the project, and it marks the difference
30
- between the drafts and finished folders.
55
+ That above is using the ~writing~ template that I like using for
56
+ starting a new text that I don't usually would publish.
31
57
 
32
- For example, in Jekyll the name of these folders would be ~_drafts~
33
- and ~_posts~.
58
+ We can inspect at the available templates as follows:
34
59
 
35
- - I suppose there is another kind of folder which works as the outline
36
- of the work that is being done. (~_clockfiles~?). Maintenance of
37
- this file is usually done per month from my experience.
38
- ~re-org~ helps to create a new file by using the same template.
60
+ #+begin_src sh
61
+ $ re-org templates
62
+
63
+ * Default Templates
64
+
65
+ - clockfile.org (default)
66
+ - jekyll-post.org (default)
67
+ - notebook.org (default)
68
+ - writing.org (default)
69
+
70
+ $ re-org templates --name=writing.org
71
+ # -*- mode: org -*-
72
+ ,#+OPTIONS: ^:nil
73
+ ,#+TITLE: <%= @org[:title] %>
74
+ ,#+DATE: <%= @org[:date] %>
75
+ ,#+STARTUP: showeverything
76
+ ,#+NOTEBOOK: <%= @org[:notebook] %>
77
+
78
+ ,*
79
+ :PROPERTIES:
80
+ :DATE: <%= @org[:date] %>
81
+ :NOTEBOOK: <%= @org[:notebook] %>
82
+ :END:
39
83
 
40
- Digressions on the site itself also would go here.
41
84
 
42
- These kind of entries are much more useful to post them to a site
43
- (like ~org-remote~) where you can track and see them published on a per Headline basis
44
- by using what is included in the ~PROPERTIES~ drawer and ~CLOCK~.
85
+ ,* COMMENT ________
86
+ # Local Variables:
87
+ # eval: (auto-fill-mode t)
88
+ # eval: (progn (goto-line 0)(re-search-forward ":PROPERTIES:") (org-narrow-to-subtree))
89
+ # End:
90
+ #+end_src
91
+
92
+ A more interesting would be when preparing a Jekyll blog post.
93
+ ~re-org~ currently detects whether the project is a Jekyll project or
94
+ not by checking whether a =_config.yml= exists at the =APP_ROOT=.
95
+ When using Jekyll, ~re-org~ expects that the name of the folders
96
+ would be ~_drafts~ and ~_posts~.
97
+
98
+ We can use the included template for Jekyll like this:
99
+
100
+ #+begin_src sh
101
+ re-org new jekyll-post --title=using-jekyll-and-org-mode
102
+ #+end_src
45
103
 
46
- #+begin_src sh :results output
47
- bundle exec ruby bin/re-org --help
104
+ ...and this would create a file at =_drafts/2013-12-06-using-jekyll-and-org-mode=
105
+
106
+ #+begin_src org
107
+ ,#+title: Using jekyll and org mode
108
+ ,#+date: 2013-12-09
109
+ ,#+layout: post
110
+ ,#+category: posts
48
111
  #+end_src
49
112
 
113
+ Other ideas are still a work in progress at this point.
114
+
50
115
  ** Contributing
51
116
 
52
117
  1. Fork it
data/TODO.org CHANGED
@@ -3,8 +3,8 @@
3
3
  - [X] Create new file with current datetime
4
4
  - [X] Put the current writings in =todo= directory
5
5
  - [X] Allow to use different templates
6
+ - [X] Make it possible to set a =templates= directory
7
+ - [X] Add examples to README.org
6
8
  - [ ] Completed and organized files go to the =done= folder.
7
- - [ ] Make it possible to set a =templates= directory
8
9
  - [ ] Load an Org mode file, do some changes to it, and then export it again to Org
9
10
  + Needs work on this =org-ruby= branch: [[https://github.com/wallyqs/org-ruby/commits/feature/org-exporter][link]]
10
- - [ ] Add examples to README.org
data/bin/re-org CHANGED
@@ -8,7 +8,7 @@ doc = <<OPTIONS
8
8
  re-org: A tool to help re-organize your texts written in Org mode
9
9
 
10
10
  Usage:
11
- re-org new <template> [--notebook=<notebook>] [--title=<title>]
11
+ re-org new <template> [--notebook=<notebook>] [--title=<title>] [--path=<path>]
12
12
  re-org status [--notebook=<notebook>] [--count-keywords]
13
13
  re-org templates [--name=<name>]
14
14
 
@@ -89,9 +89,9 @@ module ReOrg
89
89
  @org = OrgFile.new({ :title => @options["--title"],
90
90
  :template => @options["<template>"],
91
91
  :notebook => @options["<notebook>"] || @options["--notebook"],
92
- :path => @options["--path"]
92
+ :path => @options["--path"]
93
93
  })
94
- OrgFile.prepare_directories(@org)
94
+ OrgFile.prepare_directories(@org) unless @options["--path"]
95
95
 
96
96
  c = 1
97
97
  while File.exists?(@org[:file])
@@ -8,11 +8,12 @@ module ReOrg
8
8
 
9
9
  def initialize(opts={})
10
10
  @options = opts
11
+
11
12
  @options[:title] ||= 'Untitled'
12
13
  @options[:time] = Time.now
13
14
  @options[:date] = Time.at(@options[:time]).strftime("%Y-%m-%d")
14
15
  @options[:org_format_date] = org_format_date(@options[:time])
15
- @options[:todo_dir] ||= OrgFile.todo_dir
16
+ @options[:todo_dir] ||= @options[:path] || OrgFile.todo_dir
16
17
  @options[:done_dir] ||= OrgFile.done_dir
17
18
  @options[:notebook] ||= File.basename(File.expand_path('.'))
18
19
  @options[:filename] = resolve_filename
@@ -1,3 +1,3 @@
1
1
  module ReOrg
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: re-org
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-08 00:00:00.000000000 Z
12
+ date: 2013-12-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: docopt
16
- requirement: &70292512920380 !ruby/object:Gem::Requirement
16
+ requirement: &70115363142000 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70292512920380
24
+ version_requirements: *70115363142000
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: org-ruby
27
- requirement: &70292512916760 !ruby/object:Gem::Requirement
27
+ requirement: &70115363141580 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70292512916760
35
+ version_requirements: *70115363141580
36
36
  description: An Org mode file organizer
37
37
  email:
38
38
  - waldemar.quevedo@gmail.com