Skip to content

Commit f48661e

Browse files
authored
Fixing Asciinemas, Logo Position, and adding SCI-F Apps Documentation (#107)
* fixing logo to be in sidebar, and adding apps page * fixing asciinema to allow ? in titles
1 parent bc1f2af commit f48661e

11 files changed

Lines changed: 40 additions & 22 deletions

File tree

_data/sidebars/user_docs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ entries:
5959
url: /docs-docker
6060
output: web, pdf
6161

62+
- title: Reproducible SCI-F Apps
63+
url: /docs-scif-apps
64+
output: web, pdf
65+
6266
- title: Troubleshooting
6367
url: /faq#troubleshooting
6468
output: web, pdf

_includes/asciicast-custom.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<button style='color:white;margin-top:5px' class="btn btn-primary btn-lg asciinema-button" id="{{ include.title | replace:' ','-' }}">Show Video Tutorial</button>
2-
<div class="hidden" id="asciinema-{{ include.title | replace:' ','-' }}">
2+
<div class="hidden" id="asciinema-{{ include.uid }}">
33
<asciinema-player
44
src="assets/asciicast/{{include.source}}"
55
poster="data:text/plain,{{include.title}}"

_includes/asciicast.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<button style='color:white;margin-top:5px' class="btn btn-primary btn-lg asciinema-button" id="{{ include.title | replace:' ','-' }}">Show Video Tutorial</button>
2-
<div class="hidden" id="asciinema-{{ include.title | replace:' ','-' }}">
1+
<button style='color:white;margin-top:5px' class="btn btn-primary btn-lg asciinema-button" data-id="asciinema-{{ include.uid }}">Show Video Tutorial</button>
2+
<div class="hidden" id="asciinema-{{ include.uid }}">
33
<asciinema-player
44
src="assets/asciicast/{{include.source}}"
55
poster="data:text/plain,{{include.title}}"

_includes/asciinema.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<script>
66
$( document ).ready(function() {
77
$(".asciinema-button").click(function(){
8-
var asciinemaVideo = "#asciinema-" + $(this).attr('id');
9-
8+
console.log('rawwwr!')
9+
var asciinemaVideo = "#" + $(this).attr('data-id');
1010
if ($(asciinemaVideo).hasClass('hidden')){
1111
$(asciinemaVideo).removeClass('hidden');
1212
$(this).text('Hide Tutorial')

_includes/sidebar.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{% include custom/sidebarconfigs.html %}
22

3-
{% if site.logo %}
4-
<div class="shiny"><a href="\"><figure><img src="{{ site.logo }}" class="sidebar-logo"/></figure></a></div>
5-
{% endif %}
6-
73
<ul id="mysidebar" class="nav">
4+
5+
{% if site.logo %}
6+
<div class="shiny"><a href="\"><figure><img src="{{ site.logo }}" class="sidebar-logo"/></figure></a></div>
7+
{% endif %}
8+
89
<li class="sidebarTitle">{{sidebar[0].title}}</li>
910
{% for entry in sidebar %}
1011
{% for folder in entry.folders %}

assets/css/theme-blue.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,8 @@ li.sidebarTitle {
101101
margin-left: 5px;
102102

103103
}
104+
105+
.shiny a:hover {
106+
background-color: white !important;
107+
color: #f5f5f5;
108+
}

pages/docs/contributing/contributing-docs.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,17 @@ echo -e "lines\ncols"|tput -S
127127
Once you've generated an asciicast, you should drop the file (e.g., `demo-asciicast.js`) into the `assets/asciicast` folder. Since we will have many asciicasts here, please name it meaningfully. Then include the following in the page or post:
128128

129129
```bash
130-
{{ "{% include asciicast.html source='demo-asciicast.js' title='How to make demos' author='email@domain.com'" }}%}
130+
{{ "{% include asciicast.html source='demo-asciicast.js' uid='how-to-make-demos' title='How to make demos' author='email@domain.com'" }}%}
131131
```
132132

133+
The fields are important!
134+
135+
- *source* is the name of the file. It's expected to be in the `assets/asciicast` folder, you just need to put the filename here (or the subfolder, if you created one).
136+
- *uid* is the name for the id of the div for the asciicast. It should generally be lowercase, no spaces, and long enough to be unique for the page. It will automatically have `asciicast-` added as a prefix, to put the ids for asciicasts in the same namespace in the DOM.
137+
- *title* is what the user will see before clicking it. This can be a question ("How do I bootstrap a container?") or a statement ("How to bootstrap a container").
138+
- *author* is your contact email.
139+
140+
133141
## Adding a Release
134142

135143
The releases, akin to the news, are done via a feed. The only difference is that they are rendered on the site in the <a href="/releases" target="_blank">releases section</a>. It is also done very simply - you just add a new markdown file to the folder `_posts/releases`. The same naming convention follows, however the title of the post should correspond to the release, e.g.:

pages/docs/install/install-linux.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ sudo make install
3939

4040
note: The 'make install' is required to be run as root to get a properly installed Singularity implementation. If you do not run it as root, you will only be able to launch Singularity as root due to permission limitations.
4141

42-
{% include asciicast.html source='install-singularity.js' title='Install Singularity' author='vsochat@stanford.edu' %}
42+
{% include asciicast.html source='install-singularity.js' uid='install-singularity' title='Install Singularity' author='vsochat@stanford.edu' %}
4343

4444

4545
### Updating

pages/docs/user-docs/docs-bootstrap-image.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ The main content of the bootstrap file is broken into sections.
125125
#### %setup
126126
Setup is where you might perform actions on the host before we move into the container. For versions earlier than 2.3, or if you need files during `%post`, you should copy files from your host to `$SINGULARITY_ROOTFS` to move them into the container. For 2.3 and cases when you don't need the files until after `%post`, we recommend you use `%files`. We can see the difference between `%setup` and `%post` in the following asciicast:
127127

128-
{% include asciicast.html source='docs-bootstrap-setup-vs-post.json' title='How the container sees setup vs post' author='vsochat@stanford.edu'%}
128+
{% include asciicast.html source='docs-bootstrap-setup-vs-post.json' uid='container-setup-vs-post' title='How does the container see setup vs post?' author='vsochat@stanford.edu'%}
129129

130130
In the above, we see that copying something to `$SINGULARITY_ROOTFS` during `%setup` was successful to move the file into the container, but copying during `%post` was not.
131131

pages/docs/user-docs/docs-create-an-image.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ $ ls -lh container*.img
7575
-rwxr-xr-x 1 user group 769M Apr 15 11:11 container.img
7676
```
7777

78-
{% include asciicast.html source='docs-create-create.js' title='How to create images' author='davidgodlove@gmail.com'%}
78+
{% include asciicast.html source='docs-create-create.js' uid='how-to-create-images' title='How to create images' author='davidgodlove@gmail.com'%}
7979

8080
## Increasing the size of an existing image
8181
You can increase the size of an image after it has been instantiated by using the `expand` Singularity sub-command as follows:
@@ -110,7 +110,7 @@ $ ls -lh container.img
110110

111111
Similar to the create sub-command, you can override the default size increase (which is 768MiB) by using the `--size` option.
112112

113-
{% include asciicast.html source='docs-create-expand.js' title='How to expand images' author='davidgodlove@gmail.com'%}
113+
{% include asciicast.html source='docs-create-expand.js' uid='how-to-expand-images' title='How to expand images' author='davidgodlove@gmail.com'%}
114114

115115
## Mounting an image
116116
Once an image has been created and an OS has been added with the [`import`](/docs-import) or [`bootstrap`](/docs-bootstrap) commands, you can use the [`shell`](/docs-shell) command to start an interactive shell within the container. But this is not possible when an image does not yet contain a functional OS or shell. For debugging, development, or simply inspecting an image that lacks a functional shell you can use the `mount` command like so:
@@ -133,7 +133,7 @@ Singularity: \w> ls -a
133133
. .. lost+found
134134
```
135135

136-
{% include asciicast.html source='docs-create-mount.js' title='How to mount an image' author='davidgodlove@gmail.com'%}
136+
{% include asciicast.html source='docs-create-mount.js' uid='how-to-mount-an-image' title='How to mount an image' author='davidgodlove@gmail.com'%}
137137

138138
At this point the image just contains a bare file system because we haven't used something like the [`bootstrap`](docs-bootstrap) or [`import`](docs-import) commands to install an OS.
139139

@@ -147,7 +147,7 @@ $ sudo -i
147147
# singularity mount --writable /home/user/container.img /tmp/container
148148
```
149149

150-
{% include asciicast.html source='docs-create-rootmount.js' title='How to mount an image and copy files to it' author='davidgodlove@gmail.com'%}
150+
{% include asciicast.html source='docs-create-rootmount.js' uid='how-to-mount-and-copy' title='How to mount an image and copy files to it' author='davidgodlove@gmail.com'%}
151151

152152
## Copying, sharing, branching, and distributing your image
153153
A primary goal of Singularity is mobility. The single file image format makes mobility easy.

0 commit comments

Comments
 (0)