Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tissue Research JKU
Tissue Research Doc
Commits
a5369499
Commit
a5369499
authored
Dec 03, 2021
by
Sabina Köfler
Browse files
Closes
#6
parent
fbd2a592
Pipeline
#1126
passed with stage
in 2 minutes and 22 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
quick-start-guides/convert_to_pdf.sh
View file @
a5369499
...
@@ -8,7 +8,6 @@ replace_whitespaces() {
...
@@ -8,7 +8,6 @@ replace_whitespaces() {
}
}
# Create array to store all md files for later
# Create array to store all md files for later
# readarray -d '' array < <(find . -iname "*.md" -o -iname "*.mdown" -o -iname "*.markdown")
create_filearray
()
{
create_filearray
()
{
mapfile
-d
$'
\0
'
files < <
(
find
.
-iname
"*.md"
-print0
)
mapfile
-d
$'
\0
'
files < <
(
find
.
-iname
"*.md"
-print0
)
}
}
...
@@ -62,11 +61,11 @@ construct_filename() {
...
@@ -62,11 +61,11 @@ construct_filename() {
}
}
create_date_string
()
{
create_date_string
()
{
created_date
=
$(
stat
-c
%y
${
pdf_path
}
)
# Get file last modified date and time
created_date
=
$(
stat
-c
%y
${
pdf_path
}
)
# Get file last modified date and time
IFS
=
" "
read
-r
a b c
<<<
"
$created_date
"
# split the string into 3 parts (date time timezone_offset)
IFS
=
" "
read
-r
a b c
<<<
"
$created_date
"
# split the string into 3 parts (date time timezone_offset)
file_date
=
"
$a
"
# the first part is the date
file_date
=
"
$a
"
# the first part is the date
ftime
=
"
${
b
%.*
}
"
# the second part is the time (but its too exact, so strip everything after the .)
ftime
=
"
${
b
%.*
}
"
# the second part is the time (but its too exact, so strip everything after the .)
file_time
=
${
ftime
//
:
}
# remove the colons from the time stamp
file_time
=
${
ftime
//
:
}
# remove the colons from the time stamp
echo
"Constructed date string:
$file_date
and time string:
$file_time
"
echo
"Constructed date string:
$file_date
and time string:
$file_time
"
}
}
...
@@ -119,7 +118,7 @@ find ./$pdf_dir -iname "*.md" | while read -r file; do
...
@@ -119,7 +118,7 @@ find ./$pdf_dir -iname "*.md" | while read -r file; do
else
else
echo
-e
"File
$file
not the same as
$pdf_path
."
echo
-e
"File
$file
not the same as
$pdf_path
."
fi
fi
echo
-e
"Continuing with new file creation
\n
"
echo
-e
"
\n
Continuing with new file creation
\n
"
pandoc
-s
--toc
--template
=
my.latex
-f
gfm
"
$file
"
--pdf-engine
=
$option
-o
"
$pdf_path
"
# could add --variable font-family:sans-serif $variable
pandoc
-s
--toc
--template
=
my.latex
-f
gfm
"
$file
"
--pdf-engine
=
$option
-o
"
$pdf_path
"
# could add --variable font-family:sans-serif $variable
echo
-e
"File created
\n
"
echo
-e
"File created
\n
"
done
done
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment