Skip to content

Commit

Permalink
v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
duartepinto committed Jul 25, 2019
1 parent 14c1c45 commit fbe60ec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Utility to extract a section of a Markdown file and write it into a separate fil

Options:
* __--title__ - Title that will replace the section title in the output file. If none, it will use the same title.
* __--out_level__ - Level of the parent section in the output file. If none, it will keep the same level.

Named after [Jocasta Nu](https://starwars.fandom.com/wiki/Jocasta_Nu) from Star Wars.
Based on script made by [ReSwift](https://github.com/ReSwift/ReSwift/blob/master/.scripts/doc-preprocessor)
9 changes: 4 additions & 5 deletions bin/jocasta
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

require 'json'

# This script is based on a script by ReSwift that can be found at
# https://github.com/ReSwift/ReSwift/blob/master/.scripts/doc-preprocessor

def parse_options(paired_args)
options = { args: [] }
index = 0
Expand Down Expand Up @@ -56,7 +53,8 @@ def get_section(content, level, section)
end

paired_args = {
'--title' => :title
'--title' => :title,
'--out_level' => :out_level
}
options = parse_options paired_args

Expand All @@ -77,7 +75,8 @@ unless result
end

level_hash = ''
(1..level).each do
out_level = options[:out_level] || level
(1..out_level.to_i).each do
level_hash += '#'
end
result = if options[:title]
Expand Down
2 changes: 1 addition & 1 deletion jocasta.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'jocasta'
s.version = '0.0.1'
s.version = '0.1.0'
s.date = '2019-07-24'
s.summary = "Utility to extract a section of a Markdown file and write it into a separate file."
s.authors = ["Duarte Pinto"]
Expand Down

0 comments on commit fbe60ec

Please sign in to comment.