Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Specification Tools
Scripts
Commits
d1a90d89
Commit
d1a90d89
authored
2 years ago
by
Miguel Angel Reina Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Adding dockerfile for pandocfilter image
parent
11136957
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+15
-1
15 additions, 1 deletion
.gitlab-ci.yml
pandocFilter/dockerfile
+7
-0
7 additions, 0 deletions
pandocFilter/dockerfile
pandocFilter/pandocFilter.py
+6
-5
6 additions, 5 deletions
pandocFilter/pandocFilter.py
pandocFilter/setup.py
+5
-1
5 additions, 1 deletion
pandocFilter/setup.py
with
33 additions
and
7 deletions
.gitlab-ci.yml
+
15
−
1
View file @
d1a90d89
...
@@ -8,12 +8,26 @@ workflow:
...
@@ -8,12 +8,26 @@ workflow:
rules
:
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
-
if
:
$CI_COMMIT_TAG
-
if
:
$CI_COMMIT_TAG
-
if
:
$CI_PIPELINE_SOURCE == "push"
variables
:
variables
:
stages
:
stages
:
-
generation
-
generation
-
publication
-
publication
-
build
Build pythonForPandocFilter docker image
:
stage
:
build
before_script
:
cd pandocFilter
script
:
docker build --tag pandocFilter:latest -f dockerfile .
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "push"
changes
:
-
pandocFilter/dockerfile
-
pandocFilter/setup.py
-
pandocFilter/requirements.txt
Word CR text
:
Word CR text
:
stage
:
generation
stage
:
generation
...
@@ -44,7 +58,7 @@ Publish spec:
...
@@ -44,7 +58,7 @@ Publish spec:
-
tags
-
tags
before_script
:
before_script
:
-
|
-
|
curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/publish_spec%2Esh/raw?ref=
publication
" >> publish_spec.sh
curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/publish_spec%2Esh/raw?ref=
master
" >> publish_spec.sh
-
chmod +x publish_spec.sh
-
chmod +x publish_spec.sh
#- |
#- |
# curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/onem2m_spec_template%2Edocx/raw?ref=master" >> onem2m_coversheet_template.docx
# curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/onem2m_spec_template%2Edocx/raw?ref=master" >> onem2m_coversheet_template.docx
...
...
This diff is collapsed.
Click to expand it.
pandocFilter/dockerfile
0 → 100644
+
7
−
0
View file @
d1a90d89
FROM
python:3.9-slim-bullseye
ADD
. /pandocFilter/
RUN
apt-get update
-y
&&
\
rm
-rf
/var/lib/apt/lists/
*
&&
\
pip
install
-e
pandocFilter/
&&
\
pip
install
-r
pandocFilter/requirements.txt
This diff is collapsed.
Click to expand it.
pandocFilter/pandocFilter.py
+
6
−
5
View file @
d1a90d89
...
@@ -86,8 +86,8 @@ def replaceTableCaptions(progress:Progress, mdLines:list[str]) -> list[str]:
...
@@ -86,8 +86,8 @@ def replaceTableCaptions(progress:Progress, mdLines:list[str]) -> list[str]:
_idx
=
len
(
_lines
)
-
1
_idx
=
len
(
_lines
)
-
1
while
_idx
>=
0
and
_lines
[
_idx
].
startswith
(
'
|
'
):
while
_idx
>=
0
and
_lines
[
_idx
].
startswith
(
'
|
'
):
_idx
-=
1
_idx
-=
1
if
_idx
>
0
:
#
if _idx > 0:
_lines
.
insert
(
_idx
+
1
,
f
'
Table:
{
matches
[
0
]
}
\n
'
)
#
_lines.insert(_idx+1, f'Table: {matches[0]}\n')
_lines
.
insert
(
_idx
+
1
,
f
'
Table:
{
matches
[
0
]
}
\n
'
)
_lines
.
insert
(
_idx
+
1
,
f
'
Table:
{
matches
[
0
]
}
\n
'
)
else
:
else
:
_lines
.
append
(
line
)
_lines
.
append
(
line
)
...
@@ -104,9 +104,7 @@ def process(document:str, outDirectory:str) -> None:
...
@@ -104,9 +104,7 @@ def process(document:str, outDirectory:str) -> None:
mdLines
=
replaceTableCaptions
(
progress
,
mdLines
)
mdLines
=
replaceTableCaptions
(
progress
,
mdLines
)
writeMDFile
(
progress
,
mdLines
,
document
,
outDirectory
)
writeMDFile
(
progress
,
mdLines
,
document
,
outDirectory
)
def
main
(
args
=
None
):
if
__name__
==
'
__main__
'
:
# Parse command line arguments
# Parse command line arguments
parser
=
argparse
.
ArgumentParser
(
formatter_class
=
argparse
.
ArgumentDefaultsHelpFormatter
)
parser
=
argparse
.
ArgumentParser
(
formatter_class
=
argparse
.
ArgumentDefaultsHelpFormatter
)
parser
.
add_argument
(
'
--outdir
'
,
'
-o
'
,
action
=
'
store
'
,
dest
=
'
outDirectory
'
,
default
=
'
out
'
,
metavar
=
'
<output directory>
'
,
help
=
'
specify output directory
'
)
parser
.
add_argument
(
'
--outdir
'
,
'
-o
'
,
action
=
'
store
'
,
dest
=
'
outDirectory
'
,
default
=
'
out
'
,
metavar
=
'
<output directory>
'
,
help
=
'
specify output directory
'
)
...
@@ -117,3 +115,6 @@ if __name__ == '__main__':
...
@@ -117,3 +115,6 @@ if __name__ == '__main__':
os
.
makedirs
(
args
.
outDirectory
,
exist_ok
=
True
)
os
.
makedirs
(
args
.
outDirectory
,
exist_ok
=
True
)
process
(
args
.
document
,
args
.
outDirectory
)
process
(
args
.
document
,
args
.
outDirectory
)
if
__name__
==
'
__main__
'
:
sys
.
exit
(
main
())
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pandocFilter/setup.py
+
5
−
1
View file @
d1a90d89
...
@@ -9,5 +9,9 @@ setup(
...
@@ -9,5 +9,9 @@ setup(
packages
=
find_packages
(),
packages
=
find_packages
(),
install_requires
=
[
install_requires
=
[
'
rich
'
,
'
rich
'
,
]
],
entry_points
=
{
'
console_scripts
'
:
[
'
pandocFilter=pandocFilter:main
'
]
}
)
)
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