Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gcc-cobol
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
Container 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
COBOLworx
gcc-cobol
Commits
c909a4af
Commit
c909a4af
authored
2 years ago
by
Martin Liska
Browse files
Options
Downloads
Patches
Plain Diff
Revert "sphinx: add update_web_docs_git.py script"
This reverts commit
6373b1fd
.
parent
50b2e0fc
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
maintainer-scripts/update_web_docs_git.py
+0
-81
0 additions, 81 deletions
maintainer-scripts/update_web_docs_git.py
with
0 additions
and
81 deletions
maintainer-scripts/update_web_docs_git.py
deleted
100755 → 0
+
0
−
81
View file @
50b2e0fc
#!/usr/bin/env python3
# Generate documentation from Sphinx files.
import
argparse
import
os
import
shutil
import
subprocess
import
tempfile
from
pathlib
import
Path
GITROOT
=
'
/git/gcc.git
'
BUGURL
=
'
https://gcc.gnu.org/bugs/
'
parser
=
argparse
.
ArgumentParser
(
description
=
'
Update web documentation.
'
)
parser
.
add_argument
(
'
output_folder
'
,
help
=
'
Output folder
'
)
parser
.
add_argument
(
'
--gitrepo
'
,
help
=
f
'
Git repository (default:
{
GITROOT
}
)
'
,
default
=
GITROOT
)
parser
.
add_argument
(
'
--sphinx-build
'
,
help
=
'
Path to sphinx-build binary
'
)
parser
.
add_argument
(
'
-v
'
,
'
--verbose
'
,
action
=
'
store_true
'
,
help
=
'
Verbose output
'
)
args
=
parser
.
parse_args
()
def
find_configs
():
for
root
,
_
,
files
in
os
.
walk
(
'
.
'
):
for
f
in
files
:
full
=
os
.
path
.
join
(
root
,
f
)
if
f
==
'
conf.py
'
:
# find name of the documentation
lines
=
open
(
full
).
read
().
splitlines
()
docname
=
None
for
line
in
lines
:
if
line
.
startswith
(
'
name =
'
):
docname
=
line
.
split
()[
-
1
].
strip
(
"'"
)
break
assert
docname
yield
(
Path
(
root
).
resolve
(),
docname
)
with
tempfile
.
TemporaryDirectory
()
as
folder
:
print
(
f
'
Using
{
folder
}
as temporary directory
'
)
os
.
chdir
(
folder
)
subprocess
.
check_output
(
f
'
git clone
{
args
.
gitrepo
}
--depth=1
'
,
shell
=
True
)
os
.
chdir
(
'
gcc
'
)
configs
=
list
(
find_configs
())
# Prepare folders
output
=
Path
(
args
.
output_folder
)
if
not
output
.
exists
():
output
.
mkdir
()
temp
=
Path
(
'
tmp
'
).
resolve
()
temp
.
mkdir
()
# Prepare default env. variables
childenv
=
os
.
environ
.
copy
()
childenv
[
'
BUGURL
'
]
=
BUGURL
# Build and copy the documentation
for
i
,
(
config_folder
,
docname
)
in
enumerate
(
sorted
(
configs
)):
print
(
f
'
=== building
{
i
+
1
}
/
{
len
(
configs
)
}
:
{
docname
}
===
'
)
# Build HTML
cmd
=
f
'
make -C doc html SOURCEDIR=
{
config_folder
}
BUILDDIR=
{
temp
}
/
{
docname
}
'
if
args
.
sphinx_build
:
cmd
+=
f
'
SPHINXBUILD=
{
args
.
sphinx_build
}
'
subprocess
.
run
(
cmd
,
shell
=
True
,
env
=
childenv
,
check
=
True
,
capture_output
=
not
args
.
verbose
)
os
.
unlink
(
f
'
{
temp
}
/
{
docname
}
/html/.buildinfo
'
)
shutil
.
copytree
(
f
'
{
temp
}
/
{
docname
}
/html
'
,
f
'
{
output
}
/
{
docname
}
'
,
dirs_exist_ok
=
True
)
# Build PDF
cmd
=
f
'
make -C doc latexpdf SOURCEDIR=
{
config_folder
}
BUILDDIR=
{
temp
}
/pdf/
{
docname
}
'
if
args
.
sphinx_build
:
cmd
+=
f
'
SPHINXBUILD=
{
args
.
sphinx_build
}
'
subprocess
.
run
(
cmd
,
shell
=
True
,
env
=
childenv
,
check
=
True
,
capture_output
=
not
args
.
verbose
)
shutil
.
copyfile
(
f
'
{
temp
}
/pdf/
{
docname
}
/latex/
{
docname
}
.pdf
'
,
f
'
{
output
}
/
{
docname
}
.pdf
'
)
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