Skip to content

Commit

Permalink
Convert readme for package
Browse files Browse the repository at this point in the history
  • Loading branch information
Acly committed Sep 13, 2023
1 parent 2564f7c commit d893235
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ai_diffusion/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Generative AI plugin for Krita using Stable Diffusion"""

__version__ = "0.2.0"
__version__ = "0.3.0"

from . import util
from .settings import Settings, Setting, settings, PerformancePreset, ServerBackend, ServerMode
Expand Down
11 changes: 10 additions & 1 deletion scripts/package.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
from markdown import markdown
from shutil import rmtree, copy, copytree, ignore_patterns, make_archive
from pathlib import Path
from zipfile import ZipFile
Expand All @@ -13,6 +14,14 @@
package_name = f"krita_ai_diffusion-{version}"


def convert_markdown_to_html(markdown_file: Path, html_file: Path):
with open(markdown_file, "r") as f:
text = f.read()
html = markdown(text, extensions=["fenced_code", "codehilite"])
with open(html_file, "w") as f:
f.write(html)


def build_package():
rmtree(package_dir, ignore_errors=True)
package_dir.mkdir()
Expand All @@ -29,8 +38,8 @@ def ignore(path, names):
return filtered

copytree(plugin_src, plugin_dst, ignore=ignore)
copy(root / "README.md", plugin_dst)
copy(root / "LICENSE", plugin_dst)
convert_markdown_to_html(root / "README.md", plugin_dst / "manual.html")

make_archive(root / package_name, "zip", package_dir)

Expand Down

0 comments on commit d893235

Please sign in to comment.