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
0dd27c0b
Commit
0dd27c0b
authored
1 month ago
by
Andreas Kraft
Browse files
Options
Downloads
Patches
Plain Diff
Improved printing
parent
45b89e6a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
toMkdocs/gridTableFilter.py
+3
-1
3 additions, 1 deletion
toMkdocs/gridTableFilter.py
toMkdocs/gridTableTools.py
+3
-3
3 additions, 3 deletions
toMkdocs/gridTableTools.py
toMkdocs/markdownTools.py
+1
-0
1 addition, 0 deletions
toMkdocs/markdownTools.py
with
7 additions
and
4 deletions
toMkdocs/gridTableFilter.py
+
3
−
1
View file @
0dd27c0b
...
...
@@ -11,6 +11,8 @@
result to stdout.
"""
_print
=
print
# save the original print function
from
rich
import
print
import
argparse
,
sys
from
markdownTools
import
analyseMarkdown
,
setLoggers
...
...
@@ -27,7 +29,7 @@ def main() -> None:
error
=
lambda
m
:
print
(
f
'
[red]
{
m
}
'
,
file
=
sys
.
stderr
)
if
args
.
verbose
else
None
)
# Read the input from stdin and write the result to stdout
print
(
analyseMarkdown
(
inLines
=
sys
.
stdin
.
readlines
()),
file
=
sys
.
stdout
)
_
print
(
analyseMarkdown
(
inLines
=
sys
.
stdin
.
readlines
()),
file
=
sys
.
stdout
)
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
toMkdocs/gridTableTools.py
+
3
−
3
View file @
0dd27c0b
...
...
@@ -484,7 +484,7 @@ def parseGridTableWithSpans(gridTable:str) -> tuple[GridTableRowList, GridTableR
# Check if there are any data rows
if
not
dataRows
and
not
headerRows
:
raise
ValueError
(
'
No valid rows found in the provided grid table.
'
)
raise
ValueError
(
'
No valid rows found in the provided grid table.
Wrong format of line separator?
'
)
# Format text
for
gridRows
in
[
headerRows
,
dataRows
]:
...
...
@@ -538,7 +538,7 @@ def parseGridTableWithSpans(gridTable:str) -> tuple[GridTableRowList, GridTableR
colspan
+=
1
if
not
sum
==
numberOfColumns
:
raise
ValueError
(
'
Grid table not converted properly
'
)
raise
ValueError
(
f
'
Grid table not converted properly
. Number of columns in header row
{
idx
}
is
{
sum
}
instead of
{
numberOfColumns
}
'
)
# Checking the data rows
forwardRowspan
=
[]
...
...
@@ -561,7 +561,7 @@ def parseGridTableWithSpans(gridTable:str) -> tuple[GridTableRowList, GridTableR
colspan
+=
1
if
not
sum
==
numberOfColumns
:
raise
ValueError
(
'
Grid table not converted properly
'
)
raise
ValueError
(
f
'
Grid table not converted properly
. Number of columns in data row
{
idx
}
is
{
sum
}
instead of
{
numberOfColumns
}
'
)
return
headerRows
,
dataRows
...
...
This diff is collapsed.
Click to expand it.
toMkdocs/markdownTools.py
+
1
−
0
View file @
0dd27c0b
...
...
@@ -429,6 +429,7 @@ def analyseMarkdown(filename:Optional[str]=None, inLines:Optional[list[str]]=Non
printDebug
(
htmltable
)
except
Exception
as
e
:
printError
(
f
"
Error:
{
e
}
"
)
htmltable
=
f
'
<mark>Conversion error:
{
e
}
</mark>
\n
'
outClauses
[
-
1
].
append
(
Line
(
htmltable
,
LineType
.
RAWHTML
))
gridTable
=
''
...
...
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