-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #113: Add filename to error message when reading metdata blocks fail
- Loading branch information
Showing
31 changed files
with
258 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
~* | ||
*.swp | ||
*.bak | ||
*.log | ||
|
||
documentation/api-doc | ||
.yardoc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
source "https://rubygems.org" | ||
source 'https://rubygems.org' | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
## Acknowledgements | ||
|
||
I would like to thank [Ian](https://github.com/iandol) for his contribution of | ||
patches, bug reports, fixes, and suggestions. With your help pandocomatic is | ||
growing beyond a simple tool for personal use into a useful addition to the | ||
pandoc ecosystem. | ||
Thanks to [Ian](https://github.com/iandol) for his contribution of patches, | ||
bug reports, fixes, and suggestions. With your help pandocomatic is growing | ||
beyond a simple tool for personal use into a useful addition to the pandoc | ||
ecosystem. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
#!/usr/bin/env ruby | ||
require "paru/filter" | ||
require 'paru/filter' | ||
|
||
Paru::Filter.run do | ||
with "CodeBlock" do |code_block| | ||
command, path, *classes = code_block.string.strip.split " " | ||
if command == "::paru::insert" | ||
# prepend a space for each line to prevent pandocomatic to interpret | ||
# YAML code blocks as pandoc YAML metadata | ||
code_lines = File.readlines path.gsub(/\\_/, "_") | ||
code_block.string = code_lines.map {|l| " " + l}.join() | ||
classes.each {|c| code_block.attr.classes.push c} | ||
Paru::Filter.run do | ||
with 'CodeBlock' do |code_block| | ||
command, path, *classes = code_block.string.strip.split ' ' | ||
if command == '::paru::insert' | ||
# prepend a space for each line to prevent pandocomatic to interpret | ||
# YAML code blocks as pandoc YAML metadata | ||
code_lines = File.readlines path.gsub('\\_', '_') | ||
code_block.string = code_lines.map { |l| ' ' + l }.join | ||
classes.each { |c| code_block.attr.classes.push c } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
#!/usr/bin/env ruby | ||
require "paru/filter" | ||
require 'paru/filter' | ||
|
||
Paru::Filter.run do | ||
with "Para" do |paragraph| | ||
Paru::Filter.run do | ||
with 'Para' do |paragraph| | ||
if paragraph.inner_markdown.lines.length == 1 | ||
command, path = paragraph.inner_markdown.strip.split " " | ||
if command == "::paru::insert" | ||
markdown = File.read path.gsub(/\\_/, "_") | ||
command, path = paragraph.inner_markdown.strip.split ' ' | ||
if command == '::paru::insert' | ||
markdown = File.read path.gsub('\\_', '_') | ||
paragraph.outer_markdown = markdown | ||
end | ||
end | ||
end | ||
end | ||
|
25 changes: 12 additions & 13 deletions
25
documentation/data-dir/filters/insert_pandocomatic_version.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
#!/usr/bin/env ruby | ||
# A filter to insert paru's version. All occurrences of | ||
# A filter to insert paru's version. All occurrences of | ||
# '::paru::version' are replaced by paru's version. | ||
require_relative "../../../lib/pandocomatic/pandocomatic" | ||
require "paru/filter" | ||
require_relative '../../../lib/pandocomatic/pandocomatic' | ||
require 'paru/filter' | ||
|
||
# Get pandocomatic's version | ||
def version(str) | ||
str.gsub "::pandocomatic::version", Pandocomatic::Pandocomatic::VERSION.join(".") | ||
str.gsub '::pandocomatic::version', Pandocomatic::VERSION.join('.') | ||
end | ||
|
||
Paru::Filter.run do | ||
with "Str" do |str| | ||
str.string = version(str.string) | ||
Paru::Filter.run do | ||
with 'Str' do |str| | ||
str.string = version(str.string) | ||
end | ||
|
||
with "CodeBlock" do |code| | ||
code.string = version(code.string) | ||
with 'CodeBlock' do |code| | ||
code.string = version(code.string) | ||
end | ||
|
||
with "Link" do |link| | ||
link.target.url = version(link.target.url) | ||
link.target.title = version(link.target.title) | ||
with 'Link' do |link| | ||
link.target.url = version(link.target.url) | ||
link.target.title = version(link.target.title) | ||
end | ||
|
||
end |
Oops, something went wrong.