Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jekyll-pandoc-multiple-formats
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edsl
jekyll-pandoc-multiple-formats
Commits
79b577b4
Unverified
Commit
79b577b4
authored
Feb 21, 2018
by
fauno
Browse files
Options
Downloads
Patches
Plain Diff
localized covers_dir and better error reporting
parent
e03735ad
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+4
-1
4 additions, 1 deletion
README.md
lib/jekyll-pandoc-multiple-formats/pandoc_file.rb
+18
-5
18 additions, 5 deletions
lib/jekyll-pandoc-multiple-formats/pandoc_file.rb
with
22 additions
and
6 deletions
README.md
+
4
−
1
View file @
79b577b4
...
...
@@ -87,7 +87,10 @@ regular jekyll site build.
*
`sheetsize`
is the page size for ready the print PDF. You can also
use this option on the front matter.
*
`covers_dir`
the directory where covers are stored
*
`covers_dir`
the directory where covers are stored. If you have a
`lang`
defined, it will append the language to the
`covers_dir`
when
looking for a category/full site cover, so you can have localized
covers.
*
`signature`
is the amount of pages per fold on the imposition version.
Specify
`0`
for a single fold of all the pages. You can also use this
...
...
This diff is collapsed.
Click to expand it.
lib/jekyll-pandoc-multiple-formats/pandoc_file.rb
+
18
−
5
View file @
79b577b4
...
...
@@ -186,8 +186,8 @@ module Jekyll
# Move to the source dir since everything will be relative to that
Dir
::
chdir
(
@site
.
config
[
'source'
])
do
# Do the stuff
puts
command
Open3
::
popen3
(
command
)
do
|
stdin
,
stdout
,
stderr
,
thread
|
Jekyll
.
logger
.
debug
command
e
=
Open3
::
popen3
(
command
)
do
|
stdin
,
stdout
,
stderr
,
thread
|
stdin
.
puts
yaml_metadata
stdin
.
puts
content
stdin
.
close
...
...
@@ -196,6 +196,8 @@ module Jekyll
# Wait for the process to finish
thread
.
value
end
Jekyll
.
logger
.
warn
'Pandoc:'
,
"Failed generating
#{
path
}
"
if
e
.
to_i
>
0
end
File
.
exists?
(
path
)
...
...
@@ -205,11 +207,19 @@ module Jekyll
#
# It assumes covers are in PNG format
def
cover
cover_path
=
[
@site
.
config
[
'source'
]
]
if
single_post?
&&
single_post
.
data
[
'cover'
]
File
.
join
(
@site
.
config
[
'source'
],
single_post
.
data
[
'cover'
])
cover_path
<<
single_post
.
data
[
'cover'
]
elsif
site_lang?
cover_path
<<
@config
[
'covers_dir'
]
cover_path
<<
site_lang
cover_path
<<
"
#{
@slug
}
.png"
else
File
.
join
(
@site
.
config
[
'source'
],
@config
[
'covers_dir'
],
"
#{
@slug
}
.png"
)
cover_path
<<
@config
[
'covers_dir'
]
cover_path
<<
"
#{
@slug
}
.png"
end
File
.
join
(
cover_path
)
end
# Returns a PDF cover
...
...
@@ -296,7 +306,10 @@ module Jekyll
end
def
has_cover?
File
.
exists?
cover
e
=
File
.
exists?
cover
Jekyll
.
logger
.
warn
"Cover:"
,
"
#{
cover
}
missing for
#{
relative_path
}
"
unless
e
e
end
def
papersize
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment