# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           python 1.0
PortGroup           select 1.0

name                py-html2text
version             2025.4.15
revision            0

categories-append   textproc
platforms           {darwin any}
license             GPL-3+
supported_archs     noarch
maintainers         {khindenburg @kurthindenburg} openmaintainer

description         Script to turn HTML into equivalent Markdown-structured text.
long_description \
    html2text is a Python script that converts a page of HTML into clean, \
    easy-to-read plain ASCII text. Better yet, that ASCII also happens to be \
    valid Markdown (a text-to-HTML format).

homepage            https://pypi.python.org/pypi/${python.rootname}

checksums           rmd160  7f93c709d64ef2280f171d1d128de689dc5af538 \
                    sha256  948a645f8f0bc3abe7fd587019a2197a12436cd73d0d4908af95bfc8da337588 \
                    size    64316

python.versions     39 310 311 312 313

if {${name} ne ${subport}} {
    depends_build-append  port:py${python.version}-setuptools_scm

    depends_run-append  port:py-html2text_select

    select.group        py-html2text
    select.file         ${filespath}/py${python.version}-html2text

    test.run            yes

    notes "
To make the Python ${python.branch} version of py-html2text the one that is run\
when you execute the commands without a version suffix, e.g. 'html2text', run:

port select --set ${select.group} [file tail ${select.file}]
"
}
