Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
software-project-WS25
Github Team
Commits
b4c53206
Unverified
Commit
b4c53206
authored
Nov 03, 2025
by
Noé Lopez
Browse files
Support subdirectories in document writer
parent
6fa89a1e
Changes
1
Show whitespace changes
Inline
Side-by-side
document_writer.py
View file @
b4c53206
...
@@ -10,10 +10,12 @@ class DocumentWriter():
...
@@ -10,10 +10,12 @@ class DocumentWriter():
def
write_document
(
self
,
document
:
Document
)
->
None
:
def
write_document
(
self
,
document
:
Document
)
->
None
:
main_file_name
=
os
.
path
.
join
(
self
.
target
,
document
.
get_name
())
main_file_name
=
os
.
path
.
join
(
self
.
target
,
document
.
get_name
())
os
.
makedirs
(
os
.
path
.
dirname
(
main_file_name
),
exist_ok
=
True
)
with
open
(
main_file_name
,
"w"
)
as
f
:
with
open
(
main_file_name
,
"w"
)
as
f
:
f
.
write
(
document
.
get_main_content
())
f
.
write
(
document
.
get_main_content
())
meta_file_name
=
os
.
path
.
join
(
self
.
target
,
".meta"
,
document
.
get_name
()
+
".json"
)
meta_file_name
=
os
.
path
.
join
(
self
.
target
,
".meta"
,
document
.
get_name
()
+
".json"
)
os
.
makedirs
(
os
.
path
.
dirname
(
meta_file_name
),
exist_ok
=
True
)
with
open
(
meta_file_name
,
"w"
)
as
f
:
with
open
(
meta_file_name
,
"w"
)
as
f
:
f
.
write
(
json
.
dumps
({
f
.
write
(
json
.
dumps
({
"title"
:
document
.
get_title
(),
"title"
:
document
.
get_title
(),
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment