Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CodiMD export script
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
stgroup
misc
CodiMD export script
Commits
fb68d8cd
Commit
fb68d8cd
authored
Mar 2, 2023
by
Andreas Domanowski
Browse files
Options
Downloads
Patches
Plain Diff
Proceed import with non-existent history file
parent
9634364b
No related branches found
No related tags found
1 merge request
!1
Hedgedoc import
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
import_md/hedgedoc_import.py
+12
-4
12 additions, 4 deletions
import_md/hedgedoc_import.py
with
12 additions
and
4 deletions
import_md/hedgedoc_import.py
+
12
−
4
View file @
fb68d8cd
...
...
@@ -33,11 +33,19 @@ def import_into_hedgedoc(instance_url, session_id, export_folder, archive_file):
f
"
Checking existence of archive file (
{
archive_file
}
)
"
)
check_file_exists
(
archive_file
)
# get exported history map
with
open
(
os
.
path
.
join
(
export_folder
,
"
history.json
"
))
as
map_file
:
history_json_filename
=
"
history.json
"
history_dictionary
=
{}
try
:
with
open
(
os
.
path
.
join
(
export_folder
,
"
%s
"
%
history_json_filename
))
as
map_file
:
history_dictionary
=
json
.
load
(
map_file
)
except
FileNotFoundError
:
print_block_heading
(
f
"
INFO: could not find file
{
history_json_filename
}
. Continuing anyways with random generated paths for
"
f
"
documents
"
)
# mapping from title of a document (= filename without md extension in archive) to its id (= note url in CodiMD)
lookup_map
=
{}
if
"
history
"
in
history_dictionary
:
for
entry
in
history_dictionary
[
"
history
"
]:
lookup_map
[
entry
[
"
text
"
]]
=
entry
[
"
id
"
]
...
...
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