Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/44 updated media #45

Merged
merged 8 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .run/Make vhs.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Make vhs" type="MAKEFILE_TARGET_RUN_CONFIGURATION" factoryName="Makefile">
<makefile filename="Makefile" target="vhs" workingDirectory="$PROJECT_DIR$/docs" arguments="">
<envs/>
</makefile>
<method v="2"/>
</configuration>
</component>
21 changes: 21 additions & 0 deletions .run/Sphinx Build.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Sphinx Build" type="docs" factoryName="Sphinx task">
<module name="ItsPrompt"/>
<option name="ENV_FILES" value=""/>
<option name="INTERPRETER_OPTIONS" value=""/>
<option name="PARENT_ENVS" value="true"/>
<option name="SDK_HOME" value="$PROJECT_DIR$/venv/bin/python"/>
<option name="SDK_NAME" value="Python 3.11 (ItsPrompt)"/>
<option name="WORKING_DIRECTORY" value=""/>
<option name="IS_MODULE_SDK" value="false"/>
<option name="ADD_CONTENT_ROOTS" value="true"/>
<option name="ADD_SOURCE_ROOTS" value="true"/>
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py"/>
<option name="docutils_input_file" value="docs/source"/>
<option name="docutils_output_file" value="docs/build"/>
<option name="docutils_params" value=""/>
<option name="docutils_task" value="html"/>
<option name="docutils_open_in_browser" value="false"/>
<method v="2"/>
</configuration>
</component>
21 changes: 21 additions & 0 deletions .run/Sphinx Coverage .run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Sphinx Coverage " type="docs" factoryName="Sphinx task">
<module name="ItsPrompt"/>
<option name="ENV_FILES" value=""/>
<option name="INTERPRETER_OPTIONS" value=""/>
<option name="PARENT_ENVS" value="true"/>
<option name="SDK_HOME" value="$PROJECT_DIR$/venv/bin/python"/>
<option name="SDK_NAME" value="Python 3.11 (ItsPrompt)"/>
<option name="WORKING_DIRECTORY" value=""/>
<option name="IS_MODULE_SDK" value="false"/>
<option name="ADD_CONTENT_ROOTS" value="true"/>
<option name="ADD_SOURCE_ROOTS" value="true"/>
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py"/>
<option name="docutils_input_file" value="docs/source"/>
<option name="docutils_output_file" value="docs/build"/>
<option name="docutils_params" value=""/>
<option name="docutils_task" value="coverage"/>
<option name="docutils_open_in_browser" value="false"/>
<method v="2"/>
</configuration>
</component>
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ By participating in this project, you agree to abide by the [Code of Conduct](ht

There are many ways you can contribute to this project. Here are some guidelines to help you get started.

If you want to read more about development, please refer to
the [Development Guide](https://itsprompt.readthedocs.io/en/latest/development_guide/getting_started.html).

### Reporting Issues

If you encounter any problems or have any suggestions for improvement, please open an issue on GitHub using the
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![GitHub](https://img.shields.io/github/license/TheitsProjects/ItsPrompt)](https://github.com/TheItsProjects/ItsPrompt/blob/main/LICENSE)
[![Discord](https://img.shields.io/discord/1082381448624996514)](https://discord.gg/rP9Qke2jDs)

[![Read the Docs](https://img.shields.io/readthedocs/ItsPrompt)](http://itsprompt.readthedocs.io/)
[![Read the Docs](https://img.shields.io/readthedocs/itsprompt)](http://itsprompt.readthedocs.io/)

![Demonstration](https://raw.githubusercontent.com/TheItsProjects/ItsPrompt/main/media/ItsPrompt.gif)

Expand Down Expand Up @@ -85,7 +85,8 @@ This package is hosted on pypi, so the installation is as simple as it can get:
python3 -m pip install ItsPrompt
```

This will install `ItsPrompt` without pandas. If you want to use `TablePrompt` (see [table](https://WIP)) with
This will install `ItsPrompt` without pandas. If you want to use `TablePrompt`
(see [table](https://itsprompt.readthedocs.io/en/latest/guide/prompt_types.html#table)) with
`pandas.DataFrame`, you can install pandas support either by:

- installing pandas separately
Expand Down Expand Up @@ -114,13 +115,13 @@ You see how easy it is?

## Usage

To learn more about the usage, visit our [documentation](https://WIP).
To learn more about the usage, visit our [documentation](https://itsprompt.readthedocs.io).

---

## Further Information

Visit our [documentation](http://itsprompt.readthedocs.io/) to learn more about the usage of **ItsPrompt**!
Visit our [documentation](https://itsprompt.readthedocs.io/) to learn more about the usage of **ItsPrompt**!

If you need some easy examples, refer to [example.py](example.py)!

Expand Down
8 changes: 7 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ BUILDDIR = build
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile
# test command
vhs:
@echo "Creating VHS Media"
cd scripts/vhs && ./generate.sh


.PHONY: help Makefile vhs

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
Expand Down
14 changes: 14 additions & 0 deletions docs/scripts/vhs/checkbox.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# --- Set Up --------------------------
# Load Config
Source ./configuration/base_config.tape
Source ./configuration/small_window_config.tape

# --- Main ----------------------------
# run example.py
[email protected] "python3 demos/checkbox_demo.py" Enter Sleep 1s

Screenshot ../../source/media/checkbox.png

Sleep 1s

Ctrl+C
13 changes: 13 additions & 0 deletions docs/scripts/vhs/configuration/base_config.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# --- Settings ------------------------
# Font
Set FontFamily "Cascadia Mono"

# Behaviour
Set TypingSpeed 0.5s
Set Shell "bash"

# --- Set Up Prompt -------------------
Hide
Type@10ms ". ./configuration/config.sh" Enter
Sleep 5s
Show
22 changes: 22 additions & 0 deletions docs/scripts/vhs/configuration/big_window_config.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Configuration for big window tapes, like the demo
# These settings include a big window with gradient background, a colorful window bar, and a big font size

# --- Settings ------------------------
# Font
Set FontSize 20

# Terminal Size
Set Width 1200
Set Height 600

# Window
Set WindowBar "Colorful"
Set WindowBarSize 80
Set Padding 0

# Background
Set Margin 25
Set MarginFill ./configuration/gradient.png

# Window
Set BorderRadius 15
18 changes: 18 additions & 0 deletions docs/scripts/vhs/configuration/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Configure path and venv
cd ../../../
source venv/bin/activate

# Install Package
pip install -e .
cd examples/ || exit

# Configure Prompt Style
CYAN='\[\e[36m\]'
YELLOW='\[\e[33m\]'
BOLD='\[\e[1m\]'
RESET='\[\e[0m\]'

export PS1="${CYAN}${BOLD}user@itsprompt ${YELLOW}${BOLD}> ${RESET}"

# Clear the terminal
clear
Binary file added docs/scripts/vhs/configuration/gradient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions docs/scripts/vhs/configuration/small_window_config.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Configuration for small window tapes, like the ones used in prompt types
# These settings include a small window without margin and background, no window bar, and a small font size

# --- Settings ------------------------
# Font
Set FontSize 25

# Terminal Size
Set Width 900
Set Height 400

# Window
Set WindowBarSize 0
Set Padding 0

# Background
Set Margin 0

# Window
# Set BorderRadius 0
14 changes: 14 additions & 0 deletions docs/scripts/vhs/confirm.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# --- Set Up --------------------------
# Load Config
Source ./configuration/base_config.tape
Source ./configuration/small_window_config.tape

# --- Main ----------------------------
# run example.py
[email protected] "python3 demos/confirm_demo.py" Enter Sleep 1s

Screenshot ../../source/media/confirm.png

Sleep 1s

Ctrl+C
70 changes: 70 additions & 0 deletions docs/scripts/vhs/demo.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# --- Set Up --------------------------
# Load Config
Source ./configuration/base_config.tape
Source ./configuration/big_window_config.tape

# Set Output
Output ../../source/media/ItsPrompt.gif

# --- Main ----------------------------
# run example.py
[email protected] "python3 demo.py" Enter Sleep 1s

# Prompt 1
Up
Down 2
Enter
Sleep 1s

# Prompt 2
Up 2
Enter
Sleep 1s

# Prompt 3
Space
Enter
Down
Space
Enter
Sleep 1s

# Prompt 4
Type "h"
Type "m"
Enter
Sleep 1s

# Prompt 5
[email protected] "test" Enter
Sleep 1s

# Prompt 6
[email protected] "ItsNameless" Enter
Sleep 1s

# Prompt 7
[email protected] "Main"
Tab
Enter
Sleep 1s

# Prompt 8
[email protected] "1234" Enter
Sleep 1s

# Prompt 9
Type "y"
Sleep 1s

# Prompt 10
Right
Down
Backspace
Type "1" Enter
Sleep 1s

# Exit
Hide
Ctrl+C
Show
16 changes: 16 additions & 0 deletions docs/scripts/vhs/expand.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# --- Set Up --------------------------
# Load Config
Source ./configuration/base_config.tape
Source ./configuration/small_window_config.tape

# --- Main ----------------------------
# run example.py
[email protected] "python3 demos/expand_demo.py" Enter Sleep 1s

Type "h" Sleep 1s

Screenshot ../../source/media/expand.png

Sleep 1s

Ctrl+C
18 changes: 18 additions & 0 deletions docs/scripts/vhs/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# Run this file to create tapes for all .tape files in the directory.
# The tapes will be saved to source/media.
# To run this file, you need to have vhs installed. Read more in the development guide.

trap "echo 'Script interrupted by user'; exit 1" SIGINT SIGTERM

# Get the directory of the script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

# Iterate over all .tape files in the directory
for file in "$DIR"/*.tape
do
# Run the file with vhs
echo "--- Creating media for $file ---"
vhs "$file" 1> /dev/null
done
14 changes: 14 additions & 0 deletions docs/scripts/vhs/input.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# --- Set Up --------------------------
# Load Config
Source ./configuration/base_config.tape
Source ./configuration/small_window_config.tape

# --- Main ----------------------------
# run example.py
[email protected] "python3 demos/input_demo.py" Enter Sleep 1s

Screenshot ../../source/media/input.png

Sleep 1s

Ctrl+C
14 changes: 14 additions & 0 deletions docs/scripts/vhs/raw_select.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# --- Set Up --------------------------
# Load Config
Source ./configuration/base_config.tape
Source ./configuration/small_window_config.tape

# --- Main ----------------------------
# run example.py
[email protected] "python3 demos/raw_select_demo.py" Enter Sleep 1s

Screenshot ../../source/media/raw_select.png

Sleep 1s

Ctrl+C
14 changes: 14 additions & 0 deletions docs/scripts/vhs/select.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# --- Set Up --------------------------
# Load Config
Source ./configuration/base_config.tape
Source ./configuration/small_window_config.tape

# --- Main ----------------------------
# run example.py
[email protected] "python3 demos/select_demo.py" Enter Sleep 1s

Screenshot ../../source/media/select.png

Sleep 1s

Ctrl+C
14 changes: 14 additions & 0 deletions docs/scripts/vhs/table.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# --- Set Up --------------------------
# Load Config
Source ./configuration/base_config.tape
Source ./configuration/small_window_config.tape

# --- Main ----------------------------
# run example.py
[email protected] "python3 demos/table_demo.py" Enter Sleep 1s

Screenshot ../../source/media/table.png

Sleep 1s

Ctrl+C
Loading
Loading