diff --git a/.gitignore b/.gitignore index 85b0293..00f728d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ .vscode venv -venv38 +venv* htmlcov .coverage __pycache__ diff --git a/CHANGELOG.md b/CHANGELOG.md index 07dd47b..55a947c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.5] 2024-02-01 :mage: + +- Show event description in Gantt diagrams, by @changbowen +- Add possibility to configure months time format in Gantt diagrams, by @yasamoka + ## 2023-12-24 - Adds support for running tests using Python 3.12, and adds Python 3.12 to the diff --git a/neoteroi/mkdocs/__init__.py b/neoteroi/mkdocs/__init__.py index 92192ee..68cdeee 100644 --- a/neoteroi/mkdocs/__init__.py +++ b/neoteroi/mkdocs/__init__.py @@ -1 +1 @@ -__version__ = "1.0.4" +__version__ = "1.0.5" diff --git a/neoteroi/mkdocs/cards/__init__.py b/neoteroi/mkdocs/cards/__init__.py index c44210f..6d283a4 100644 --- a/neoteroi/mkdocs/cards/__init__.py +++ b/neoteroi/mkdocs/cards/__init__.py @@ -6,6 +6,7 @@ MIT License Copyright (c) 2022 to present, Roberto Prevato """ + from markdown import Extension from neoteroi.mkdocs.markdown.images import Image diff --git a/neoteroi/mkdocs/contribs/__init__.py b/neoteroi/mkdocs/contribs/__init__.py index 6983222..37b736e 100644 --- a/neoteroi/mkdocs/contribs/__init__.py +++ b/neoteroi/mkdocs/contribs/__init__.py @@ -6,6 +6,7 @@ - the Git CLI can be used during the build. """ + import logging from datetime import datetime from fnmatch import fnmatch diff --git a/neoteroi/mkdocs/contribs/git.py b/neoteroi/mkdocs/contribs/git.py index af1093c..d5d296e 100644 --- a/neoteroi/mkdocs/contribs/git.py +++ b/neoteroi/mkdocs/contribs/git.py @@ -4,6 +4,7 @@ history rewrites or files renamed without keeping contributor's history. For this reason, it should be used together with a """ + import re import subprocess from datetime import datetime diff --git a/neoteroi/mkdocs/contribs/html.py b/neoteroi/mkdocs/contribs/html.py index 1eb817e..c52274c 100644 --- a/neoteroi/mkdocs/contribs/html.py +++ b/neoteroi/mkdocs/contribs/html.py @@ -1,6 +1,7 @@ """ This module contains methods to render the contributions stats. """ + import xml.etree.ElementTree as etree from dataclasses import dataclass from datetime import datetime diff --git a/neoteroi/mkdocs/markdown/__init__.py b/neoteroi/mkdocs/markdown/__init__.py index c6d770a..149ce5c 100644 --- a/neoteroi/mkdocs/markdown/__init__.py +++ b/neoteroi/mkdocs/markdown/__init__.py @@ -2,6 +2,7 @@ This package contains common utilities for markdown used across the various plugins for Markdown. """ + import re from typing import Dict, Tuple diff --git a/neoteroi/mkdocs/markdown/align.py b/neoteroi/mkdocs/markdown/align.py index 72a599a..28c2745 100644 --- a/neoteroi/mkdocs/markdown/align.py +++ b/neoteroi/mkdocs/markdown/align.py @@ -1,6 +1,7 @@ """ Objects to describe alignment of elements. """ + import logging from enum import Enum diff --git a/neoteroi/mkdocs/markdown/data/source.py b/neoteroi/mkdocs/markdown/data/source.py index 30dad06..73ad544 100644 --- a/neoteroi/mkdocs/markdown/data/source.py +++ b/neoteroi/mkdocs/markdown/data/source.py @@ -1,6 +1,7 @@ """ This module defines a base class for types that can read text from a source. """ + from abc import ABC, abstractmethod from typing import Any diff --git a/neoteroi/mkdocs/markdown/data/text.py b/neoteroi/mkdocs/markdown/data/text.py index 2c86957..3a5a19f 100644 --- a/neoteroi/mkdocs/markdown/data/text.py +++ b/neoteroi/mkdocs/markdown/data/text.py @@ -2,6 +2,7 @@ This module defines a base class for types that can deserialize text into Python objects, and implementations for common formats. """ + import csv import json from abc import ABC, abstractmethod diff --git a/neoteroi/mkdocs/markdown/utils.py b/neoteroi/mkdocs/markdown/utils.py index 1de4a13..9a530ab 100644 --- a/neoteroi/mkdocs/markdown/utils.py +++ b/neoteroi/mkdocs/markdown/utils.py @@ -1,6 +1,7 @@ """ Common utilities for the whole package. """ + from dataclasses import fields, is_dataclass _FIELDS = {} diff --git a/neoteroi/mkdocs/oad/__init__.py b/neoteroi/mkdocs/oad/__init__.py index 587c06b..3657f6c 100644 --- a/neoteroi/mkdocs/oad/__init__.py +++ b/neoteroi/mkdocs/oad/__init__.py @@ -8,6 +8,7 @@ neoteroi.mkdocs.oad """ + import re from mkdocs.config.config_options import Type diff --git a/neoteroi/mkdocs/projects/__init__.py b/neoteroi/mkdocs/projects/__init__.py index 22e514e..09fd1b8 100644 --- a/neoteroi/mkdocs/projects/__init__.py +++ b/neoteroi/mkdocs/projects/__init__.py @@ -6,6 +6,7 @@ MIT License Copyright (c) 2022 to present, Roberto Prevato """ + from markdown import Extension from .gantt import register_extension diff --git a/neoteroi/mkdocs/projects/domain.py b/neoteroi/mkdocs/projects/domain.py index c7f13df..ef9ad35 100644 --- a/neoteroi/mkdocs/projects/domain.py +++ b/neoteroi/mkdocs/projects/domain.py @@ -183,9 +183,11 @@ def from_obj(cls, obj, preceding_date: Optional[date] = None): start, end, description=description, - activities=list(_resolve_activities(child_activities, end or start)) - if child_activities - else None, + activities=( + list(_resolve_activities(child_activities, end or start)) + if child_activities + else None + ), events=[Event.from_obj(item) for item in events] if events else None, hidden=hidden, ) @@ -213,8 +215,10 @@ def from_obj(cls, obj): return cls( title=obj.get("title") or "Plan", - activities=[Activity.from_obj(item, plan_start) for item in activities] - if activities - else [], + activities=( + [Activity.from_obj(item, plan_start) for item in activities] + if activities + else [] + ), events=[Event.from_obj(item) for item in events] if events else [], ) diff --git a/neoteroi/mkdocs/projects/gantt/__init__.py b/neoteroi/mkdocs/projects/gantt/__init__.py index f6565cd..bb2babb 100644 --- a/neoteroi/mkdocs/projects/gantt/__init__.py +++ b/neoteroi/mkdocs/projects/gantt/__init__.py @@ -6,6 +6,7 @@ MIT License Copyright (c) 2022 to present, Roberto Prevato """ + from neoteroi.mkdocs.markdown.processors import ( EmbeddedBlockProcessor, SourceBlockProcessor, diff --git a/neoteroi/mkdocs/projects/gantt/html.py b/neoteroi/mkdocs/projects/gantt/html.py index 5788de8..aee3ac1 100644 --- a/neoteroi/mkdocs/projects/gantt/html.py +++ b/neoteroi/mkdocs/projects/gantt/html.py @@ -411,9 +411,11 @@ def build_event(self, parent, event: Event): { "class": "nt-timeline-dot bigger", "title": f"{event.title} {self._format_time(event.time)}", - "style": f"left: {self._calc_time_left(event.time) - 4}px;" - if event.time - else "", + "style": ( + f"left: {self._calc_time_left(event.time) - 4}px;" + if event.time + else "" + ), }, ) @@ -425,7 +427,7 @@ def build_event(self, parent, event: Event): des = etree.fromstring(event.description) except etree.ParseError: des = etree.fromstring(f"{event.description}") - + des.set("class", f"description {des.get('class') or ''}") dot_element.append(des) diff --git a/neoteroi/mkdocs/spantable/__init__.py b/neoteroi/mkdocs/spantable/__init__.py index db7e898..9aed034 100644 --- a/neoteroi/mkdocs/spantable/__init__.py +++ b/neoteroi/mkdocs/spantable/__init__.py @@ -6,6 +6,7 @@ MIT License Copyright (c) 2022 to present, Roberto Prevato """ + import logging import re import xml.etree.ElementTree as etree diff --git a/neoteroi/mkdocs/timeline/__init__.py b/neoteroi/mkdocs/timeline/__init__.py index bbbdf52..6bfcfee 100644 --- a/neoteroi/mkdocs/timeline/__init__.py +++ b/neoteroi/mkdocs/timeline/__init__.py @@ -7,6 +7,7 @@ MIT License Copyright (c) 2022 to present, Roberto Prevato """ + from markdown import Extension from neoteroi.mkdocs.markdown.align import aligment_from_props