Skip to content

Commit

Permalink
feat(prompt)!: Extra customization options
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Prompt now array containing all prompt settings

Prompt now contains multiple sections: core, separator, path and extra, this breakdown only adds extra layers of customization
and don't necessarily need to hold those settings, you can write anything in each section text as well as before and after.
Core: is the core part of the prompt contains before, boforeColor, text, textColor, after, afterColor settings
Path: is the path portion of the prompt, contains before, beforeColor, text, textColor, after, afterColor settings
Separator: separates Core and Path sections, contains text and color settings
Extra: Extra text that can be added after Path section. Contains Text and Color settings

See ExampleSite for more details
  • Loading branch information
coolapso committed Jun 30, 2024
1 parent b4810b4 commit 0fbf995
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ Live example at: https://coolapso.sh
* Custom Greeting
* Multi line text is respected
* Customizable prompt
* Custom before & after prompt text
* Custom before & after prompt colors
* Custom prompt text
* Custom prompt text Color
* custom separator text
* custom separator color
* custom before & after symbols text
* custom before & after symbols colors
* Custom symbols
* Custom symbols color
* Custom extra text
* Custom extra text color
* Multiple sections with individual commands:
* **Whois:** General information about the individual
* **social:** shows social networks
Expand Down
33 changes: 31 additions & 2 deletions exampleSite/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,46 @@ title: "terminalcv"
params:
version: '2.0.0'
description: "My terminal cv"
prompt: "newuser@terminalcv"
prompt:
core:
text: "user@terminalCV"
color: 'pink'
before: '['
beforeColor: 'red'
after: '\]'
afterColor: 'red'
# separator: '-'
separator:
text: "-"
# color:
path:
before: '['
beforeColor: 'red'
text: '~/terminalcv'
color: 'blue'
after: '\]'
afterColor: 'red'
extra:
text: ": "
color: 'orange'

# promptColor: grey
# promptSimbols: ":~$"
# promptSimbolsColor: grey
# startxLocation: https://example.com
# useLess: true
exitLocation: 'about:blank'
source: true
#use a ‎ (blank character) if your first character of the ascii art is a whitespace
greeting: |
Welcome to my online resume
‎ _ _ _ _______ __
| | (_) | |/ ____\ \ / /
| |_ ___ _ __ _ __ ___ _ _ __ __ _| | | \ \ / /
| __/ _ \ '__| '_ ` _ \| | '_ \ / _` | | | \ \/ /
| || __/ | | | | | | | | | | | (_| | | |____ \ /
\__\___|_| |_| |_| |_|_|_| |_|\__,_|_|\_____| \/
Welcome to my online resume
Type 'help' for a list of available commands
Expand Down
2 changes: 1 addition & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@
"please type 'help' or '?' for a list of available commands\n");
}
}, {
prompt: '[[;{{ .Site.Params.promptColor | default "grey" }};]{{ .Site.Params.prompt }}][[;{{ .Site.Params.promptSimbolsColor | default "grey" }};]{{.Site.Params.promptSimbols | default ":~$"}}]' + " ",
prompt: '{{ with .Site.Params.prompt }}{{ with .core }}[[;{{ .beforeColor | default "grey" }};]{{ .before }}][[;{{ .color | default "grey" }};]{{ .text }}][[;{{ .afterColor | default "gey" }};]{{ .after }}]{{ end }}{{ with .separator }}[[;{{ .separatorColor | default "grey" }};]{{ .text }}]{{ end }}{{ with .path }}[[;{{ .beforeColor | default "grey" }};]{{ .before }}][[;{{ .color | default "grey" }};]{{ .text | default ":~$" }}][[;{{ .afterColor | default "grey" }};]{{ .after }}]{{ end }}{{ with .extra }}[[;{{ .color | default "grey" }};]{{ .text }}]{{ end }}{{ end }}',
greetings: "[[b;{{ .Site.Params.greetingColor | default "white" }};]{{ .Site.Params.greeting }}]",

keydown: function(e, term) {
Expand Down

0 comments on commit 0fbf995

Please sign in to comment.