From eb44cef6d0c66c71e726c60b8ab66f2cf0026c95 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 22 Jul 2026 11:24:41 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20formatiertes=20Einf=C3=BCgen=20aus=20Wo?= =?UTF-8?q?rd=20unterst=C3=BCtzen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- netbox_documentation/__init__.py | 2 +- netbox_documentation/models.py | 5 ++++- .../templates/netbox_documentation/document_edit.html | 7 +++++++ pyproject.toml | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 232238b..6d458ee 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Ein in NetBox integriertes Markdown-Wiki für Betriebsdokumentationen und Anleit - Hierarchische Ordner und Unterordner für eine BookStack-ähnliche Struktur - Breite Editoransicht und Fokusmodus innerhalb des NetBox-Layouts - Bilder direkt vom eigenen Gerät in die Dokumentation hochladen +- Formatierte Word-Inhalte inklusive Tabellen und unterstützten Zwischenablage-Bildern einfügen - Eine Dokumentation mehreren Objekten zuordnen und umgekehrt - Unbegrenzt viele Objektzuordnungen pro Dokumentation; nur identische Doppelzuordnungen werden verhindert - Unterstützte Standardobjekte: Region, Standort, Location, Rack, Gerät, VM, VM-Cluster und Mandant/Kunde @@ -19,7 +20,7 @@ Ein in NetBox integriertes Markdown-Wiki für Betriebsdokumentationen und Anleit ## Kompatibilität -Die Version `0.3.1` zielt auf NetBox 4.x (mindestens 4.0). Vor einem produktiven Rollout sollte das Plugin gegen die konkret eingesetzte NetBox-Minor-Version in einer Testinstanz geprüft werden. +Die Version `0.3.2` zielt auf NetBox 4.x (mindestens 4.0). Vor einem produktiven Rollout sollte das Plugin gegen die konkret eingesetzte NetBox-Minor-Version in einer Testinstanz geprüft werden. ## Installation diff --git a/netbox_documentation/__init__.py b/netbox_documentation/__init__.py index fc434f3..e165d22 100644 --- a/netbox_documentation/__init__.py +++ b/netbox_documentation/__init__.py @@ -5,7 +5,7 @@ class DocumentationConfig(PluginConfig): name = "netbox_documentation" verbose_name = "Dokumentation" description = "Wiki und Office-Dokumentation direkt in NetBox" - version = "0.3.1" + version = "0.3.2" author = "NetBox Documentation Contributors" base_url = "documentation" min_version = "4.0.0" diff --git a/netbox_documentation/models.py b/netbox_documentation/models.py index 31c85f8..65786f8 100644 --- a/netbox_documentation/models.py +++ b/netbox_documentation/models.py @@ -52,7 +52,10 @@ class Document(NetBoxModel): css = CSSSanitizer(allowed_css_properties={ "background-color", "border", "border-color", "border-style", "border-width", "color", "font-family", "font-size", "font-style", "font-weight", "height", - "margin-left", "text-align", "text-decoration", "vertical-align", "width", + "border-collapse", "line-height", "list-style-type", "margin", "margin-bottom", + "margin-left", "margin-right", "margin-top", "padding", "padding-bottom", + "padding-left", "padding-right", "padding-top", "text-align", "text-decoration", + "text-indent", "vertical-align", "white-space", "width", }) return bleach.clean(value, tags=tags, attributes=attributes, protocols=("http", "https", "mailto"), css_sanitizer=css) diff --git a/netbox_documentation/templates/netbox_documentation/document_edit.html b/netbox_documentation/templates/netbox_documentation/document_edit.html index cfeb2db..33c085f 100644 --- a/netbox_documentation/templates/netbox_documentation/document_edit.html +++ b/netbox_documentation/templates/netbox_documentation/document_edit.html @@ -48,6 +48,13 @@ promotion: false, branding: false, convert_unsafe_embeds: true, + paste_data_images: true, + paste_merge_formats: false, + paste_webkit_styles: 'all', + paste_remove_styles_if_webkit: false, + paste_convert_word_fake_lists: true, + smart_paste: true, + images_reuse_filename: true, relative_urls: false {% if object.pk %}, images_file_types: 'jpg,jpeg,png,gif,webp', diff --git a/pyproject.toml b/pyproject.toml index c8e10cd..ea7e4cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "netbox-documentation" -version = "0.3.1" +version = "0.3.2" description = "Integrated Markdown wiki and office document importer for NetBox" readme = "README.md" requires-python = ">=3.10"