add support for warnings

Reviewed-by: Goncharov, Artem <artem.goncharov@t-systems.com>
Co-authored-by: gtema <artem.goncharov@gmail.com>
Co-committed-by: gtema <artem.goncharov@gmail.com>
This commit is contained in:
gtema 2022-09-05 08:49:15 +00:00 committed by zuul
parent 9763fd5f91
commit 4d20aa52ba
2 changed files with 15 additions and 3 deletions

View File

@ -329,7 +329,7 @@ categories:
title: User Guide
type: umn
pdf_name: sfs-umn
repository: docs/scalable-file-system
repository: docs/scalable-file-service
- service_title: Volume Backup Service
service_type: vbs
docs:
@ -358,7 +358,7 @@ categories:
title: User Guide
type: umn
pdf_name: cce-umn
repository: docs/cloud-container-service
repository: docs/cloud-container-engine
- service_title: Software Repository for Containers
service_type: swr
docs:

View File

@ -104,6 +104,17 @@ class OTCDocConvertor:
title['class'] = 'title'
title.string = 'Note:'
notetitle.replace_with(title)
elif "warning" in i.get('class', []):
# Warnings
del i['id']
if i.img:
i.img.decompose()
eltitle = i.find('span', class_='warningtitle')
if eltitle:
title = soup.new_tag('div')
title['class'] = 'title'
title.string = 'Warning:'
eltitle.replace_with(title)
elif "notice" in i.get('class', []):
# Notices
del i['id']
@ -491,7 +502,8 @@ class OTCDocConvertor:
for img in self.doc_images:
shutil.copyfile(
pathlib.Path(self.args.path, img).resolve(strict=False),
pathlib.Path(img_dest, img).resolve(strict=False)
pathlib.Path(
img_dest, os.path.basename(img)).resolve(strict=False)
)
context = dict(