Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Peter Sherwood
athena
Commits
0c0f68e1
Commit
0c0f68e1
authored
6 years ago
by
Adam Edward Barton
Committed by
Emil Obreshkov
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Link Doxygen Front Page to GITLab
Former-commit-id:
325fe58f
parent
421afa7a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/TreeViewTemplate.html
+48
-0
48 additions, 0 deletions
docs/TreeViewTemplate.html
docs/createGrid.py
+215
-0
215 additions, 0 deletions
docs/createGrid.py
with
263 additions
and
0 deletions
docs/TreeViewTemplate.html
0 → 100644
+
48
−
0
View file @
0c0f68e1
<html>
<head>
<title></title>
<link
rel=
"stylesheet"
href=
"tree/screen.css"
>
<link
rel=
"stylesheet"
href=
"tree/jquery.treeview.css"
>
<script
src=
"tree/jquery.js"
type=
"text/javascript"
></script>
<script
src=
"tree/jquery.cookie.js"
type=
"text/javascript"
></script>
<script
src=
"tree/jquery.treeview.js"
type=
"text/javascript"
></script>
<script>
$
(
document
).
ready
(
function
(){
$
(
"
#browser
"
).
treeview
({
control
:
"
#tree_control_
"
,
collapsed
:
true
,
animated
:
100
});
});
</script>
<style>
body
{
margin
:
4px
8px
;}
a
{
text-decoration
:
none
;}
a
:link
,
a
:visited
{
color
:
blue
;}
a
:hover
{
color
:
red
;}
</style>
</head>
<body>
<table
border=
"0"
cellspacing=
"0"
style=
"font-size: 11px;"
>
<tr>
<td>
<div
id=
"tree_control_"
style=
"padding:5px"
>
<a
title=
"Collapse the entire tree below"
href=
"#"
>
Collapse All
</a>
<a
title=
"Expand the entire tree below"
href=
"#"
>
Expand All
</a>
</div>
</td>
<!-- <td><a target="_blank" href="" id="twiki" style="vertical-align: middle;"><img src="tree/twiki.gif" /></a></td> -->
</tr>
</table>
<!-- Tree -->
<ul
id=
"browser"
class=
"filetree treeview"
>
%s
</ul>
<!-- Tree -->
</body>
</html>
This diff is collapsed.
Click to expand it.
docs/createGrid.py
0 → 100644
+
215
−
0
View file @
0c0f68e1
import
os
indexfile
=
"
html/index.html
"
docsfile
=
"
html/doxygen.css
"
rootdir
=
os
.
path
.
abspath
(
'
./
'
)
rootdir
+=
'
/
'
print
rootdir
path
=
rootdir
+
'
/docs/
'
def
ReadFile
(
fileName
,
pathFlag
=
True
):
# """This method reads file directly or from path."""
if
pathFlag
:
print
(
"
Read:
"
,
path
+
fileName
)
f
=
open
(
path
+
fileName
)
else
:
f
=
open
(
path
+
fileName
)
print
(
"
Read:
"
,
path
+
fileName
)
data
=
f
.
read
()
f
.
close
()
return
data
def
HTMLTreeBegin
(
title
,
links
=
{}):
html
=
'
\n
<li>
\n
<div class=
"
hitarea expandable-hitarea
"
></div>
\n
'
html
=
html
+
'
<span class=
"
folder
"
>%s
\n
'
%
title
for
i
in
links
.
keys
():
html
=
html
+
'
<a target=
"
_blank
"
href=
"
%s
"
>[%s]</a>
\n
'
%
(
links
[
i
],
i
)
html
=
html
+
'
</span>
\n
'
html
=
html
+
'
<ul style=
"
display: block;
"
>
\n
'
return
html
def
WriteFile
(
fileName
,
data
):
# This method writes data
print
(
"
Write:
"
,
path
+
fileName
)
f
=
open
(
path
+
fileName
,
"
w
"
)
f
.
write
(
data
)
f
.
close
()
def
HTMLTreeEnd
():
return
'
</li></ul>
\n\n
'
def
Fixcssfile
(
filename
):
addition
=
"""
/** atlas insert **/
.doxyTable{
border-collapse:collapse;
border:1px solid lightBlue;
width: 70%;
margin:0 auto;
}
.doxyTable tr:not(:first-child) {
background: #eeeeff;
border-spacing: 0px;
padding: 0px;
border-bottom: 1px solid #c1c1dc;
}
.doxyTable tr:hover {
background: #cde4ec;
}
.doxyTable td {
padding:8px;
cursor:pointer;
}
.accordion {
display: none;
width: 100%;
}
div.content {}
div.content h1, h2 {
text-align: center;
}
"""
text
=
ReadFile
(
filename
)
if
(
"
/** atlas insert **/
"
in
text
):
print
"
Skipping rewriting css
"
return
text
+=
addition
WriteFile
(
filename
,
text
)
def
__NewTreePage
(
domain
,
package
):
content
=
''
content
+=
HTMLTreeBegin
(
domain
)
for
i
in
package
[
domain
]:
content
+=
HTMLTreeAddItem
(
i
,
'
https://gitlab.cern.ch/atlas/athena/tree/master/
'
+
domain
+
'
/
'
+
i
,
folder
=
True
)
content
+=
HTMLTreeEnd
()
temp
=
treePageTamplate
%
(
content
)
WriteFile
(
"
html/iframes/%s.html
"
%
domain
.
lower
().
replace
(
'
'
,
'
_
'
),
temp
)
def
CreateNewMainPage
(
outputFileName
,
packagemap
):
contents
=
"""
<script>function changeState(item) {
item.slideToggle(
"
slow
"
);
}
$( document ).ready(function() {
$(
"
.doxyTable > tbody > tr
"
).each(function(){
var row = $(this);
// skip first row (header), you dont need to assing it accordion
// trigger function. it is also the same for rows which doesn
'
t have
// id attribute. if a row doesn
'
t have id attr, that means it is
// accordion row
if(row.attr(
'
id
'
) ==
'
header
'
|| !row.attr(
'
id
'
)) return;
// if it has id attribute, assign trigger function
row.click(function(){
$(
'
div#
'
+row.attr(
'
id
'
)).slideToggle(256);
// we dont want to load whole iframes before they are showed
var iframe = $(
'
div#
'
+row.attr(
'
id
'
)).find(
'
iframe
'
);
// no need to set the source again again if already set
if(iframe.attr(
'
src
'
)) return;
iframe.attr(
'
src
'
, iframe.attr(
'
data-src
'
));
});
});
});</script>
<table class=
"
doxyTable
"
border=
"
0
"
cellpadding=
"
0
"
cellspacing=
"
0
"
>
<tr class=
"
top
"
valign=
"
top
"
>
<th class=
"
domain
"
>Domain</th>
</tr>
"""
keysI
=
sorted
(
packagemap
.
keys
())
for
i
in
keysI
:
if
i
==
''
:
continue
# contents = contents + '\n<tr class="DCRow">\n' ######### TAG: TR1
# contents = contents + """<td width="50%%" style="padding:8px;cursor:pointer" onclick="toggleHoba('hoba_%s', 'iframes/%s.html')" id="hoba_%s"><a>%s</a></td>\n""" % (i.replace(' ', '_'), i.lower().replace(' ', '_'), i.replace(' ', '_'), i)
# contents = contents + '</td>\n'
# contents = contents + '</tr>\n\n' ######### TAG: TR1
# contents = contents + """<tr><td colspan="2" style="background:#d7dbe3">
# <div style="display:none;" id="hoba_%s_div"><iframe width="100%%" frameborder="0"></iframe></div>
# </td></tr>""" % (i.replace(' ', '_'))
tagsafe
=
i
.
replace
(
'
'
,
'
_
'
)
tagsafelc
=
i
.
lower
().
replace
(
'
'
,
'
_
'
)
basic
=
"""
<tr id=
"
{0}
"
><td width=
"
50%
"
>{0}</td></tr><tr style=
"
padding:0
"
><td colspan=
"
2
"
style=
"
padding:0
"
>
<div class=
"
accordion
"
id=
"
{0}
"
>
<iframe width=
"
100%
"
height=
"
250px
"
frameborder=
"
0
"
data-src=
"
iframes/{1}.html
"
> </iframe>
</div></td></tr>
"""
basic
=
basic
.
format
(
tagsafe
,
tagsafelc
)
contents
+=
basic
contents
+=
"
</table>
"
stamp
=
"
</div></div><!-- contents -->
"
contents
+=
stamp
mainPageTemplate
=
ReadFile
(
indexfile
)
# print mainPageTemplate
WriteFile
(
outputFileName
,
mainPageTemplate
.
replace
(
stamp
,
contents
))
def
HTMLTreeAddItem
(
title
,
links
=
None
,
endNode
=
False
,
folder
=
False
):
if
endNode
:
html
=
'
\t
<li class=
"
last
"
>
'
else
:
html
=
'
\t
<li>
'
if
isinstance
(
links
,
str
)
or
isinstance
(
links
,
type
(
u
''
)):
if
folder
:
html
=
html
+
'
\t
<a href=
"
%s
"
target=
"
_blank
"
class=
""
><span class=
"
emptyFolder
"
>%s</span></a>
\n
'
%
(
links
,
title
)
else
:
html
=
html
+
'
\t
<a href=
"
%s
"
target=
"
_blank
"
class=
""
><span class=
"
file
"
>%s</span></a>
\n
'
%
(
links
,
title
)
elif
isinstance
(
links
,
dict
):
if
folder
:
html
=
html
+
'
<span class=
"
emptyFolder
"
>%s
'
%
title
else
:
html
=
html
+
'
<span class=
"
file
"
>%s
'
%
title
for
i
in
links
.
keys
():
html
=
html
+
'
<a target=
"
_blank
"
href=
"
%s
"
>[%s]</a>
\n
'
%
(
links
[
i
],
i
)
html
=
html
+
'
</span>
'
else
:
html
=
html
+
'
\t
<span class=
"
file
"
>%s</span>
\n
'
%
title
return
html
+
'
\t
</li>
\n
'
#packagelist=[]
packagemap
=
{}
for
subdir
,
dirs
,
files
in
os
.
walk
(
rootdir
):
if
'
CMakeLists.txt
'
in
files
:
# packagelist.append(subdir);
package
=
subdir
[
len
(
rootdir
):]
i
=
package
.
find
(
'
/
'
)
if
i
<
0
:
i
=
0
category
=
package
[
0
:
i
]
if
category
in
packagemap
:
packagemap
[
category
].
append
(
package
[
i
+
1
:])
else
:
packagemap
[
category
]
=
[
package
[
i
+
1
:]]
# print package
#for st in packagelist:
# print st;
#print packagemap
#print treePageTamplate
framesdir
=
path
+
'
html/iframes
'
if
not
os
.
path
.
exists
(
framesdir
):
os
.
makedirs
(
framesdir
)
#category =
treePageTamplate
=
ReadFile
(
"
TreeViewTemplate.html
"
,
pathFlag
=
True
)
for
k
in
packagemap
.
keys
():
__NewTreePage
(
str
(
k
),
packagemap
);
CreateNewMainPage
(
indexfile
,
packagemap
)
Fixcssfile
(
docsfile
)
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