Skip to content

Commit d94e123

Browse files
committed
Fixed documentation for SHELLMARKS_PATH. Updated sample scripts to work with syntax changes. Added php sample script.
1 parent ef53b9c commit d94e123

7 files changed

Lines changed: 76 additions & 21 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,9 @@ Shellmarks should run on any modern Windows, Linux, or Mac system.
150150

151151
## Documentation
152152

153-
- [CLI Usage](https://github.com/shannah/shellmarks/wiki/CLI-Usage)
154-
- [GUI Form Configuration](https://github.com/shannah/shellmarks/wiki/Shellmarks-GUI-Form-Configuration)
153+
- [Users Manual](https://shannah.github.io/shellmarks/manual)
154+
- [CLI Usage](https://shannah.github.io/shellmarks/manual/#cli)
155+
- [GUI Form Configuration](https://shannah.github.io/shellmarks/manual/#config)
155156
- [Sample Scripts](sample-scripts)
156157
-
157158

docs/manual/index.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,19 +455,19 @@ __tags__="#custom-tag1 #custom-tag2"
455455

456456
Shellmarks stores all scripts in the `$HOME/.shellmarks/scripts` directory, where `$HOME` refers to the user's home directory.
457457

458-
This location can be overridden via the `SHELLMARKS_HOME` environment variable, whose default value is `$HOME/.shellmarks`.
458+
This location can be overridden via the `SHELLMARKS_PATH` environment variable, whose default value is `$HOME/.shellmarks/scripts`.
459459

460460
=== Can I run multiple shellmarks instances with different catalogs?
461461

462-
Yes, by launching different instances of shellmarks with different values for the `SHELLMARKS_HOME` environment variable.
462+
Yes, by launching different instances of shellmarks with different values for the `SHELLMARKS_PATH` environment variable.
463463

464464
E.g.
465465

466466
[source, bash]
467467
----
468468
shellmarks #launch with default catalog
469469
470-
SHELLMARKS_HOME=/tmp/temp_catalog shellmarks #launch with scripts in /tmp/temp_catalog/scripts
470+
SHELLMARKS_PATH=/tmp/temp_catalog shellmarks #launch with scripts in /tmp/temp_catalog
471471
----
472472

473473
=== Can I organize my scripts into categories?

docs/manual/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,13 +1148,13 @@ <h3 id="_where_are_the_scripts_in_the_catalog_stored">5.1. Where are the scripts
11481148
<p>Shellmarks stores all scripts in the <code>$HOME/.shellmarks/scripts</code> directory, where <code>$HOME</code> refers to the user&#8217;s home directory.</p>
11491149
</div>
11501150
<div class="paragraph">
1151-
<p>This location can be overridden via the <code>SHELLMARKS_HOME</code> environment variable, whose default value is <code>$HOME/.shellmarks</code>.</p>
1151+
<p>This location can be overridden via the <code>SHELLMARKS_PATH</code> environment variable, whose default value is <code>$HOME/.shellmarks/scripts</code>.</p>
11521152
</div>
11531153
</div>
11541154
<div class="sect2">
11551155
<h3 id="_can_i_run_multiple_shellmarks_instances_with_different_catalogs">5.2. Can I run multiple shellmarks instances with different catalogs?</h3>
11561156
<div class="paragraph">
1157-
<p>Yes, by launching different instances of shellmarks with different values for the <code>SHELLMARKS_HOME</code> environment variable.</p>
1157+
<p>Yes, by launching different instances of shellmarks with different values for the <code>SHELLMARKS_PATH</code> environment variable.</p>
11581158
</div>
11591159
<div class="paragraph">
11601160
<p>E.g.</p>
@@ -1163,7 +1163,7 @@ <h3 id="_can_i_run_multiple_shellmarks_instances_with_different_catalogs">5.2. C
11631163
<div class="content">
11641164
<pre class="highlight"><code class="language-bash" data-lang="bash">shellmarks #launch with default catalog
11651165

1166-
SHELLMARKS_HOME=/tmp/temp_catalog shellmarks #launch with scripts in /tmp/temp_catalog/scripts</code></pre>
1166+
SHELLMARKS_PATH=/tmp/temp_catalog shellmarks #launch with scripts in /tmp/temp_catalog</code></pre>
11671167
</div>
11681168
</div>
11691169
</div>
@@ -1584,7 +1584,7 @@ <h3 id="_editing_a_script">7.4. Editing a Script</h3>
15841584
</div>
15851585
<div id="footer">
15861586
<div id="footer-text">
1587-
Last updated 2021-12-20 15:18:20 -0800
1587+
Last updated 2021-12-20 15:26:24 -0800
15881588
</div>
15891589
</div>
15901590
</body>

sample-scripts/hello.php

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/usr/bin/php
2+
<?php
3+
$firstName = @$_ENV['firstName'];
4+
$lastName = @$_ENV['lastName'];
5+
$option1 = @$_ENV['option1'];
6+
$option2 = @$_ENV['option2'];
7+
$selectedFile = @$_ENV['selectedFile'];
8+
9+
echo "Hello ${firstName} ${lastName}";
10+
echo "You selected ${selectedFile}";
11+
if ($option1) {
12+
echo "Option1 was selected";
13+
}
14+
if ($option2) {
15+
echo "Option2 was selected";
16+
}
17+
exit(0);
18+
?>
19+
---
20+
# The script title
21+
__title__="hello-php.php"
22+
23+
# Script description in Asciidoc format
24+
__description__='''
25+
This description will be displayed at the top of the form.
26+
27+
It can be multiline and include https://example.com[Links]
28+
'''
29+
30+
# Doc string. In asciidoc format. Displayed in Shellmarks catalog
31+
__doc__='''
32+
This will be displayed in the shellmarks catalog.
33+
34+
You can include _asciidoc_ markup, as well as https://www.example.com[links].
35+
'''
36+
37+
# Tags used to place script into one or more sections of the catalog
38+
__tags__="#samples #php"
39+
40+
[firstName]
41+
label="First Name"
42+
required=true
43+
44+
[lastName]
45+
label="Last Name"
46+
47+
[selectedFile]
48+
label="Please select a file"
49+
type="file"
50+
51+
[option1]
52+
label="Option 1"
53+
type="checkbox"
54+
55+
[option2]
56+
label="Option 2"
57+
type="checkbox"
58+

sample-scripts/hello.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#!/bin/bash
22
echo "Hello ${name}"
33
exit 0
4-
<shellmarks>
4+
---
55
[name]
66
type="text"
77
label="Please enter your name"
88
required=true
9-
</shellmarks>

sample-scripts/ipa-util.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ if [ ! -z "$showProvisioningProfile" ]; then
2020
security cms -D -i "Payload/${appname}/embedded.mobileprovision"
2121
fi
2222
exit 0
23-
<shellmarks>
24-
title="IPA Entitlements"
25-
description='''
26-
<asciidoc>
23+
__title__="IPA Entitlements"
24+
__description__='''
2725
This script will print out the entitlements and provisioning profile for given .ipa file.
2826
2927
See https://developer.apple.com/library/archive/qa/qa1798/_index.html[Apple Tech Article] for more information.
30-
</asciidoc>
3128
'''
29+
__tags__="#ios"
30+
3231
[file]
3332
type="file"
3433
label="Select ipa file"
@@ -47,4 +46,3 @@ See https://developer.apple.com/library/archive/qa/qa1798/_index.html[Apple Tech
4746
default="true"
4847
help="Check this to show the ipa provisioning profile details."
4948

50-
</shellmarks>

sample-scripts/test-script.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
22

33
exit 0
4-
<shellmarks>
5-
__category__="Samples/CoolScripts"
6-
label="Cool Script"
4+
---
5+
__tags__="#samples"
6+
__title__="Cool Script"
77
__doc__='''
88
This is a really cool script
99
@@ -12,4 +12,3 @@ This is a really cool script
1212
It will do a bunch of stuff
1313
'''
1414
[name]
15-
</shellmarks>

0 commit comments

Comments
 (0)