Skip to content

Commit

Permalink
Added contribution guidlines and updated Readme
Browse files Browse the repository at this point in the history
* commented programs.md in parseJson.py
* working on test functionality for new pages
  • Loading branch information
mt-empty committed Mar 21, 2020
1 parent 8ff914e commit 63bc6dd
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 12 deletions.
16 changes: 10 additions & 6 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ Currently the collection also includes non-GUI cheatsheets(extra):
* Programming languages
* Other

All shortcut/cheatsheet pages have been cloned from [DuckDuckgo repository]().
All shortcut/cheatsheet pages were cloned from [DuckDuckgo repository](https://github.com/duckduckgo/zeroclickinfo-goodies).


## Why shortcut
How many times have you have you had to use you mouse after installing that new shiny GUI application?
You probably had to look for shortcuts online.
How many times did you have to use your mouse after installing the new shiny GUI application?

You probably had to navigate a menu or look online for shortcuts.

Well you no longer have to, as you can get the shortcuts right from you terminal.
Well you no longer have to, as you can get the shortcuts right from your terminal.

This project was started as an attempt to `Never leave my keyboard`, as well as a learning experience.

Expand All @@ -35,9 +37,11 @@ Contributions are most welcome!

Bugs: open an issue here.

New shortcut-page: open an issue here, or send a pull request with the included page.
New features: open an issue here or feel free to send a pull request with the included feature.

Please refer to [contribution page](/contribution/Readme.md) for pull request.

## Further inspired by theses useful projects

* [tldr](): A collection of simplified and community-driven man pages.
* [cheat](): Interactive cheatsheets on the command-line
* [cheat](): Interactive cheatsheets on the command-line.
9 changes: 9 additions & 0 deletions contribution/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Conribution

Send a pull request with the included page.

1. Fill this [template](template.json), refer to [virtual box Example](virtual-box.json)

2. Run [parseJson.py yourPage](/parseJSON.py) to test for any errors.

3. `shortcut yourPage` for more information.
38 changes: 38 additions & 0 deletions contribution/template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name":"Program name",
"description": "Program description",
"metadata":{
"sourceUrl":"https://shortcut.url"
},
"aliases": [
"Alias one",
"Alias two"
],
"isGUI": true or false,
"section_order":[
"Section one",
"Section two"
],
"sections":{
"Section one":[
{
"val":"Description",
"key":"Shortcut one"
},
{
"val":"Description",
"key":"Shortcut two"
}
],
"Section two":[
{
"val":"Description",
"key":"Shortcut one"
},
{
"val":"Description",
"key":"Shortcut two"
}
]
}
}
87 changes: 87 additions & 0 deletions contribution/virtual-box.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"name": "Oracle VirtualBox",
"description": "Keyboard shortcuts for VirtualBox",
"metadata": {
"sourceUrl": "http://kbmode.com/windows/virtualbox-keyboard-shortcuts"
},
"aliases": [
"virtualbox",
"oracle virtualbox",
"vbox"
],
"isGUI": true,
"section_order": [
"Commands",
"Appliance Options"
],
"sections": {
"Commands": [
{
"val": "Add",
"key": "Ctrl A"
},
{
"val": "Clone",
"key": "Ctrl O"
},
{
"val": "Exit",
"key": "Ctrl Q"
},
{
"val": "Export Appliance",
"key": "Ctrl E"
},
{
"val": "Discard Saved State",
"key": "Ctrl J"
},
{
"val": "Group",
"key": "Ctrl U"
},
{
"val": "Import Appliance",
"key": "Ctrl I"
},
{
"val": "New",
"key": "Ctrl N"
},
{
"val": "Pause",
"key": "Ctrl P"
}
],
"Appliance Options": [
{
"val": "Preferences",
"key": "Ctrl G"
},
{
"val": "Remove",
"key": "Ctrl R"
},
{
"val": "Reset",
"key": "Ctrl T"
},
{
"val": "Settings",
"key": "Ctrl S"
},
{
"val": "Show Log",
"key": "Ctrl L"
},
{
"val": "Virtual Media Manager",
"key": "Ctrl D"
},
{
"val": "Help",
"key": "F1"
}
]
}
}
12 changes: 6 additions & 6 deletions parseJSON.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""
(?<!\\)[\[\{\]\}]|\\(?={|\]|}|\[)
match [ or { or ] or } if not preceeded by /
match [ or { or ] or } if not preceded by /
or
match \ if not followed by [ or { or } or ]
Expand All @@ -17,7 +17,7 @@
REGEX = r'(?<!\\)[\[\{\]\}]|\\(?={|\]|}|\[)'


# regexp for special charachters in aliases
# regexp for special characters in aliases
aliasREGEX = r"[+<>\\/:*#$%&{}!'`\"@=|]"

TITLE_TAG = "# "
Expand All @@ -30,7 +30,7 @@


def parse(args):
"""parses json into approperiate md pretty format
"""parses json into appropriate md pretty format
Arguments:
args {array} --
Expand All @@ -50,8 +50,8 @@ def parse(args):
def upperSection():
outfile.write(TITLE_TAG + data["name"] + "\n\n")

with open("programs.md", "a") as prgs:
prgs.write(program_name + ", ")
# with open("programs.md", "a") as prgs:
# prgs.write(program_name + ", ")

try:
outfile.write(
Expand Down Expand Up @@ -91,7 +91,7 @@ def middleSection():
"", shortcut, description))
except:
with open("parseLog.md", "a") as log:
# log.write("Discription error " + json_path+"\n")
# log.write("Description error " + json_path+"\n")
log.write(json_path+"\n")
quit()
outfile.write("\n")
Expand Down

0 comments on commit 63bc6dd

Please sign in to comment.