Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lecture materials
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
generic software skills
lecture materials
Commits
7833c5d1
Commit
7833c5d1
authored
1 year ago
by
Florian Ziemen
Browse files
Options
Downloads
Patches
Plain Diff
extract summary from all lectures
parent
5eb63b3b
Branches
summarizer
No related tags found
1 merge request
!5
extract summary from all lectures
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
summarize
+29
-0
29 additions, 0 deletions
summarize
with
29 additions
and
0 deletions
summarize
0 → 100755
+
29
−
0
View file @
7833c5d1
#!/usr/bin/env python3
import
glob
import
logging
logging
.
basicConfig
()
logging
.
getLogger
().
setLevel
(
logging
.
DEBUG
)
# But you can use your content.
def
parse_file
(
filename
):
logging
.
debug
(
f
'
opening
{
filename
}
'
)
with
open
(
filename
)
as
f
:
lines
=
f
.
readlines
()
titles
=
[
f
"
##
{
x
[
6
:
].
strip
()[
1
:
-
1
]
}
\n
"
for
x
in
lines
if
x
.
startswith
(
"
title:
"
)]
entries
=
titles
+
[
f
"
##
{
x
}
"
for
x
in
lines
if
x
[
0
]
==
"
#
"
]
entries
=
[
f
'
*
{
x
[
4
:
]
}
'
if
x
[:
4
]
==
"
####
"
else
x
for
x
in
entries
]
return
entries
files
=
glob
.
glob
(
"
[01]*/index.qmd
"
)
all_entries
=
[
]
for
x
in
files
:
all_entries
.
extend
(
parse_file
(
x
))
with
open
(
"
summary.md
"
,
"
w
"
)
as
outfile
:
outfile
.
write
(
"
# Overview of all lectures
\n
"
)
outfile
.
writelines
(
all_entries
)
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