Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
docs.it4i.cz
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Petr Strakos
docs.it4i.cz
Commits
31b51a52
Commit
31b51a52
authored
8 years ago
by
Lukáš Krupčík
Browse files
Options
Downloads
Patches
Plain Diff
edit html_md.sh
parent
0a412f7c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
html_md.sh
+7
-7
7 additions, 7 deletions
html_md.sh
with
7 additions
and
7 deletions
html_md.sh
+
7
−
7
View file @
31b51a52
...
@@ -31,7 +31,7 @@ if [ "$1" = "-w" ]; then
...
@@ -31,7 +31,7 @@ if [ "$1" = "-w" ]; then
# test exists file -> yes - kill process wget
# test exists file -> yes - kill process wget
until
test
-f
$FILE
until
test
-f
"
$FILE
"
do
do
if
[
!
-f
"
$FILE
"
]
;
then
if
[
!
-f
"
$FILE
"
]
;
then
echo
"Download..."
echo
"Download..."
...
@@ -40,7 +40,7 @@ if [ "$1" = "-w" ]; then
...
@@ -40,7 +40,7 @@ if [ "$1" = "-w" ]; then
done
done
echo
"Download complete..."
echo
"Download complete..."
kill
$pid
kill
"
$pid
"
find
.
-name
"@@s*"
|
find
.
-name
"@@s*"
|
while
read
i
;
while
read
i
;
...
@@ -82,7 +82,7 @@ if [ "$1" = "-c" ]; then
...
@@ -82,7 +82,7 @@ if [ "$1" = "-c" ]; then
do
do
# filtering html
# filtering html
echo
"
$i
"
;
echo
"
$i
"
;
echo
"
\t\t
filtering html files..."
;
printf
"
\t\t
filtering html files...
\n
"
;
HEAD
=
$(
cat
"
$i
"
|
grep
-n
-m1
'<h1'
|cut
-f1
-d
: |
tr
--delete
'\n'
)
HEAD
=
$(
cat
"
$i
"
|
grep
-n
-m1
'<h1'
|cut
-f1
-d
: |
tr
--delete
'\n'
)
END
=
$(
cat
"
$i
"
|
grep
-n
-m1
'<!-- <div tal:content='
|cut
-f1
-d
: |
tr
--delete
'\n'
)
END
=
$(
cat
"
$i
"
|
grep
-n
-m1
'<!-- <div tal:content='
|cut
-f1
-d
: |
tr
--delete
'\n'
)
...
@@ -92,7 +92,7 @@ if [ "$1" = "-c" ]; then
...
@@ -92,7 +92,7 @@ if [ "$1" = "-c" ]; then
cat
"
$i
"
|
sed
'1,'
"
$((
HEAD-1
))
"
'd'
|
sed
-n
-e
:a
-e
'1,'
"
$DOWN
"
'!{P;N;D;};N;ba'
>
"
${
i
%.*
}
TMP.html"
cat
"
$i
"
|
sed
'1,'
"
$((
HEAD-1
))
"
'd'
|
sed
-n
-e
:a
-e
'1,'
"
$DOWN
"
'!{P;N;D;};N;ba'
>
"
${
i
%.*
}
TMP.html"
# converted .html to .md
# converted .html to .md
echo
"
\t\t
.html -> .md"
printf
"
\t\t
.html -> .md
\n
"
pandoc
-f
html
-t
markdown+pipe_tables-grid_tables
"
${
i
%.*
}
TMP.html"
-o
"
${
i
%.*
}
.md"
;
pandoc
-f
html
-t
markdown+pipe_tables-grid_tables
"
${
i
%.*
}
TMP.html"
-o
"
${
i
%.*
}
.md"
;
rm
"
${
i
%.*
}
TMP.html"
;
rm
"
${
i
%.*
}
TMP.html"
;
...
@@ -113,7 +113,7 @@ if [ "$1" = "-c" ]; then
...
@@ -113,7 +113,7 @@ if [ "$1" = "-c" ]; then
done
done
# text filtering of html, css, ...
# text filtering of html, css, ...
echo
"
\t\t
automatic filter..."
printf
"
\t\t
automatic filter...
\n
"
cat
filter_auto |
cat
filter_auto |
while
read
y
;
while
read
y
;
do
do
...
@@ -122,7 +122,7 @@ if [ "$1" = "-c" ]; then
...
@@ -122,7 +122,7 @@ if [ "$1" = "-c" ]; then
cat
"
${
i
%.*
}
TMP.md"
>
"
${
i
%.*
}
.md"
;
cat
"
${
i
%.*
}
TMP.md"
>
"
${
i
%.*
}
.md"
;
done
done
#echo
"\t\tother filter..."
printf
"
\t\t
other filter...
\n
"
cat
filter_other |
cat
filter_other |
while
read
a
;
while
read
a
;
do
do
...
@@ -137,4 +137,4 @@ if [ "$1" = "-c" ]; then
...
@@ -137,4 +137,4 @@ if [ "$1" = "-c" ]; then
done
done
rm
filter_autoTMP
rm
filter_autoTMP
rm
filter_auto
rm
filter_auto
fi
fi
\ No newline at end of file
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