kash-shell 0.3.27__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.
Files changed (62) hide show
  1. kash/actions/core/markdownify_html.py +1 -4
  2. kash/actions/core/minify_html.py +4 -5
  3. kash/actions/core/render_as_html.py +9 -7
  4. kash/actions/core/save_sidematter_meta.py +47 -0
  5. kash/actions/core/zip_sidematter.py +47 -0
  6. kash/commands/base/basic_file_commands.py +7 -4
  7. kash/commands/base/diff_commands.py +6 -4
  8. kash/commands/base/files_command.py +31 -30
  9. kash/commands/base/general_commands.py +3 -2
  10. kash/commands/base/logs_commands.py +6 -4
  11. kash/commands/base/reformat_command.py +3 -2
  12. kash/commands/base/search_command.py +4 -3
  13. kash/commands/base/show_command.py +9 -7
  14. kash/commands/help/assistant_commands.py +6 -4
  15. kash/commands/help/help_commands.py +7 -4
  16. kash/commands/workspace/selection_commands.py +18 -16
  17. kash/commands/workspace/workspace_commands.py +39 -26
  18. kash/config/setup.py +2 -27
  19. kash/docs/markdown/topics/a1_what_is_kash.md +26 -18
  20. kash/exec/action_decorators.py +2 -2
  21. kash/exec/action_exec.py +56 -50
  22. kash/exec/fetch_url_items.py +36 -9
  23. kash/exec/preconditions.py +2 -2
  24. kash/exec/resolve_args.py +4 -1
  25. kash/exec/runtime_settings.py +1 -0
  26. kash/file_storage/file_store.py +59 -23
  27. kash/file_storage/item_file_format.py +91 -26
  28. kash/help/help_types.py +1 -1
  29. kash/llm_utils/llms.py +6 -1
  30. kash/local_server/local_server_commands.py +2 -1
  31. kash/mcp/mcp_server_commands.py +3 -2
  32. kash/mcp/mcp_server_routes.py +1 -1
  33. kash/model/actions_model.py +31 -30
  34. kash/model/compound_actions_model.py +4 -3
  35. kash/model/exec_model.py +30 -3
  36. kash/model/items_model.py +114 -57
  37. kash/model/params_model.py +4 -4
  38. kash/shell/output/shell_output.py +1 -2
  39. kash/utils/file_formats/chat_format.py +7 -4
  40. kash/utils/file_utils/file_ext.py +1 -0
  41. kash/utils/file_utils/file_formats.py +4 -2
  42. kash/utils/file_utils/file_formats_model.py +12 -0
  43. kash/utils/text_handling/doc_normalization.py +1 -1
  44. kash/utils/text_handling/markdown_footnotes.py +224 -0
  45. kash/utils/text_handling/markdown_utils.py +532 -41
  46. kash/utils/text_handling/markdownify_utils.py +2 -1
  47. kash/web_gen/templates/components/tooltip_scripts.js.jinja +186 -1
  48. kash/web_gen/templates/components/youtube_popover_scripts.js.jinja +223 -0
  49. kash/web_gen/templates/components/youtube_popover_styles.css.jinja +150 -0
  50. kash/web_gen/templates/content_styles.css.jinja +53 -1
  51. kash/web_gen/templates/youtube_webpage.html.jinja +47 -0
  52. kash/web_gen/webpage_render.py +103 -0
  53. kash/workspaces/workspaces.py +0 -5
  54. kash/xonsh_custom/custom_shell.py +4 -3
  55. kash/xonsh_custom/shell_load_commands.py +3 -9
  56. {kash_shell-0.3.27.dist-info → kash_shell-0.3.30.dist-info}/METADATA +34 -24
  57. {kash_shell-0.3.27.dist-info → kash_shell-0.3.30.dist-info}/RECORD +60 -55
  58. kash/llm_utils/llm_features.py +0 -72
  59. kash/web_gen/simple_webpage.py +0 -55
  60. {kash_shell-0.3.27.dist-info → kash_shell-0.3.30.dist-info}/WHEEL +0 -0
  61. {kash_shell-0.3.27.dist-info → kash_shell-0.3.30.dist-info}/entry_points.txt +0 -0
  62. {kash_shell-0.3.27.dist-info → kash_shell-0.3.30.dist-info}/licenses/LICENSE +0 -0
@@ -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