changed from txt file to a MD format for the CLI display

This commit is contained in:
focus_ed 2025-05-14 22:12:35 -06:00
parent 9a2ef14320
commit 2c667c07d4
4 changed files with 12 additions and 11 deletions

View File

@ -1 +1 @@
include kpr_docs/kpr_docs.txt include kpr_docs/kpr_docs.md

View File

@ -1,12 +1,13 @@
#!/usr/bin/env python3 ~#!/usr/bin/env python3
from rich.console import Console from rich.console import Console
from rich.markdown import Markdown from rich.markdown import Markdown
import importlib.resources import importlib.resources
def main(): def main():
console = Console
try: try:
with importlib.resources.open_text('kpr_docs', 'kpr_docs.txt') as f: with importlib.resources.open_text('kpr_docs', 'kpr_docs.md') as f:
print(f.read()) md = Markdown(f.read())
console.print(md)
except FileNotFoundError: except FileNotFoundError:
print("Documentation file not found.") console.print("[bold red]Documentation file not found.[/bold red]")

View File

@ -1,12 +1,12 @@
KPR_Man User Manuals KPR_Man KPR_Man User Manuals KPR_Man
NAME ## NAME
KPR Man - display helpful information about my tool **KPR Man** - display helpful information about my tool
SYNOPSIS ## SYNOPSIS
Test Test
DESCRIPTION ## DESCRIPTION
This is a fake man page to demonstrate packaging a CLI app. This is a fake man page to demonstrate packaging a CLI app.
It can be extended to show multiple pages, handle arguments, etc. It can be extended to show multiple pages, handle arguments, etc.

View File

@ -4,7 +4,7 @@ setup(
name='kpr_docs', name='kpr_docs',
version='0.2', version='0.2',
packages=find_packages(), packages=find_packages(),
package_data={'kpr_docs': ['kpr_docs.txt']}, package_data={'kpr_docs': ['kpr_docs.md']},
include_package_data=True, include_package_data=True,
install_requires=[ install_requires=[
'rich>=13.0.0' 'rich>=13.0.0'