kash-shell 0.3.28__py3-none-any.whl → 0.3.30__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kash/actions/core/markdownify_html.py +1 -4
- kash/actions/core/minify_html.py +4 -5
- kash/actions/core/render_as_html.py +9 -7
- kash/actions/core/save_sidematter_meta.py +47 -0
- kash/actions/core/zip_sidematter.py +47 -0
- kash/commands/base/basic_file_commands.py +7 -4
- kash/commands/base/diff_commands.py +6 -4
- kash/commands/base/files_command.py +31 -30
- kash/commands/base/general_commands.py +3 -2
- kash/commands/base/logs_commands.py +6 -4
- kash/commands/base/reformat_command.py +3 -2
- kash/commands/base/search_command.py +4 -3
- kash/commands/base/show_command.py +9 -7
- kash/commands/help/assistant_commands.py +6 -4
- kash/commands/help/help_commands.py +7 -4
- kash/commands/workspace/selection_commands.py +18 -16
- kash/commands/workspace/workspace_commands.py +39 -26
- kash/config/setup.py +2 -27
- kash/docs/markdown/topics/a1_what_is_kash.md +26 -18
- kash/exec/action_decorators.py +2 -2
- kash/exec/action_exec.py +56 -50
- kash/exec/fetch_url_items.py +36 -9
- kash/exec/preconditions.py +2 -2
- kash/exec/resolve_args.py +4 -1
- kash/exec/runtime_settings.py +1 -0
- kash/file_storage/file_store.py +59 -23
- kash/file_storage/item_file_format.py +91 -26
- kash/help/help_types.py +1 -1
- kash/llm_utils/llms.py +6 -1
- kash/local_server/local_server_commands.py +2 -1
- kash/mcp/mcp_server_commands.py +3 -2
- kash/mcp/mcp_server_routes.py +1 -1
- kash/model/actions_model.py +31 -30
- kash/model/compound_actions_model.py +4 -3
- kash/model/exec_model.py +30 -3
- kash/model/items_model.py +114 -57
- kash/model/params_model.py +4 -4
- kash/shell/output/shell_output.py +1 -2
- kash/utils/file_formats/chat_format.py +7 -4
- kash/utils/file_utils/file_ext.py +1 -0
- kash/utils/file_utils/file_formats.py +4 -2
- kash/utils/file_utils/file_formats_model.py +12 -0
- kash/utils/text_handling/doc_normalization.py +1 -1
- kash/utils/text_handling/markdown_footnotes.py +224 -0
- kash/utils/text_handling/markdown_utils.py +532 -41
- kash/utils/text_handling/markdownify_utils.py +2 -1
- kash/web_gen/templates/components/tooltip_scripts.js.jinja +186 -1
- kash/web_gen/templates/components/youtube_popover_scripts.js.jinja +223 -0
- kash/web_gen/templates/components/youtube_popover_styles.css.jinja +150 -0
- kash/web_gen/templates/content_styles.css.jinja +53 -1
- kash/web_gen/templates/youtube_webpage.html.jinja +47 -0
- kash/web_gen/webpage_render.py +103 -0
- kash/workspaces/workspaces.py +0 -5
- kash/xonsh_custom/custom_shell.py +4 -3
- {kash_shell-0.3.28.dist-info → kash_shell-0.3.30.dist-info}/METADATA +33 -24
- {kash_shell-0.3.28.dist-info → kash_shell-0.3.30.dist-info}/RECORD +59 -54
- kash/llm_utils/llm_features.py +0 -72
- kash/web_gen/simple_webpage.py +0 -55
- {kash_shell-0.3.28.dist-info → kash_shell-0.3.30.dist-info}/WHEEL +0 -0
- {kash_shell-0.3.28.dist-info → kash_shell-0.3.30.dist-info}/entry_points.txt +0 -0
- {kash_shell-0.3.28.dist-info → kash_shell-0.3.30.dist-info}/licenses/LICENSE +0 -0
kash/web_gen/simple_webpage.py
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
from kash.model.items_model import Item
|
|
2
|
-
from kash.utils.file_utils.file_formats_model import Format
|
|
3
|
-
from kash.web_gen.template_render import render_web_template
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def simple_webpage_render(
|
|
7
|
-
item: Item,
|
|
8
|
-
page_template: str = "simple_webpage.html.jinja",
|
|
9
|
-
add_title_h1: bool = True,
|
|
10
|
-
show_theme_toggle: bool = False,
|
|
11
|
-
) -> str:
|
|
12
|
-
"""
|
|
13
|
-
Generate a simple web page from a single item.
|
|
14
|
-
If `add_title_h1` is True, the title will be inserted as an h1 heading above the body.
|
|
15
|
-
"""
|
|
16
|
-
return render_web_template(
|
|
17
|
-
template_filename=page_template,
|
|
18
|
-
data={
|
|
19
|
-
"title": item.pick_title(),
|
|
20
|
-
"add_title_h1": add_title_h1,
|
|
21
|
-
"content_html": item.body_as_html(),
|
|
22
|
-
"thumbnail_url": item.thumbnail_url,
|
|
23
|
-
"enable_themes": show_theme_toggle,
|
|
24
|
-
"show_theme_toggle": show_theme_toggle,
|
|
25
|
-
},
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## Tests
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def test_render():
|
|
33
|
-
import os
|
|
34
|
-
|
|
35
|
-
from kash.model.items_model import ItemType
|
|
36
|
-
|
|
37
|
-
# Create a test item
|
|
38
|
-
item = Item(
|
|
39
|
-
type=ItemType.doc,
|
|
40
|
-
format=Format.html,
|
|
41
|
-
title="A Simple Web Page",
|
|
42
|
-
body="<p>This is a simple web page with <b>HTML content</b>.</p>",
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
# Generate HTML
|
|
46
|
-
html = simple_webpage_render(item)
|
|
47
|
-
|
|
48
|
-
os.makedirs("tmp", exist_ok=True)
|
|
49
|
-
with open("tmp/simple_webpage.html", "w") as f:
|
|
50
|
-
f.write(html)
|
|
51
|
-
print("Rendered simple webpage to tmp/simple_webpage.html")
|
|
52
|
-
|
|
53
|
-
# Basic validation
|
|
54
|
-
assert item.title and item.title in html
|
|
55
|
-
assert "<b>HTML content</b>" in html
|
|
File without changes
|
|
File without changes
|
|
File without changes
|