Gitlab is now using https://gitlab.lcsb.uni.lu as it's primary address. Please update your bookmarks. FAQ.

Commit 155ac5f7 authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

Generate search index

parent 1ab1eb62
#!/bin/bash
DIRECTORY=build
# Install lunr to build the index
npm install lunr@2.3.8
# Go to the directory...
cd $DIRECTORY
printf "Found the following build targets inside: \n$(ls -d */)\n\n"
# ...and loop through all the build targets
for branch in $(ls -d */); do
echo "Entering: $branch";
cd "$branch";
echo "Generating the index..."
cat documents.js | node $CI_PROJECT_DIR/build_index.js > index.js
rm documents.js build_index.js
echo "...should be completed. First 50 characters of the index: "
cat index.js | head -c50
echo ""
cd ..
done
rm $CI_PROJECT_DIR/build_index.js
mkdir -p public
mkdir -p build
artefact="latest"
# loop through all the branches
......@@ -14,14 +14,15 @@ for branch in $(git for-each-ref --format='%(refname:strip=3)' refs/remotes); do
echo $artefact;
git checkout -f $branch
git reset --hard $branch
git pull
# build the website
bundle install
bundle exec jekyll build --baseurl="howto-cards/$artefact" -d "public/$artefact"
bundle exec jekyll build --baseurl="howto-cards/$artefact" -d "build/$artefact"
if [[ $branch == "master" ]]; then
# set the 404
cp howto-cards/$artefact/404.html public/404.html
cp howto-cards/$artefact/404.html build/404.html
fi
done
......@@ -31,4 +32,4 @@ git checkout -f $CI_COMMIT_REF_NAME
git reset --hard origin/$CI_COMMIT_REF_NAME
# set the auto redirection
cp .ci/.autoRedirect public/index.html
cp .ci/.autoRedirect build/index.html
# In case something goes horribly wrong, you can fall back to `image: ruby:2.5`
image: git-r3lab.uni.lu:4567/r3/docker/jekyll-lcsb:1.1
variables:
JEKYLL_ENV: production
stages:
- build
- generate_index
- deploy
build_pages:
stage: build
before_script:
- apt-get -qq update
- apt-get install -y -qq git-lfs
- gem install bundler:2.0.2 && bundle install
script:
- bash .ci/deploy.sh
variables:
JEKYLL_ENV: production
artifacts:
expire_in: 1 day
paths:
- build
before_script:
- apt-get -qq update
- apt-get install -y -qq git-lfs
- gem install bundler:2.0.2 && bundle install
generate the search index:
stage: generate_index
image: node:13.8.0-slim
rules:
- if: $CI_COMMIT_BRANCH == "master"
- if: $CI_COMMIT_BRANCH == "develop"
script:
- bash .ci/build_indices.sh
- mv build processed_build
artifacts:
expire_in: 1 day
paths:
- processed_build
pages:
image: alpine:3.11.3
stage: deploy
only:
- develop
- master
rules:
- if: $CI_COMMIT_BRANCH == "master"
- if: $CI_COMMIT_BRANCH == "develop"
script:
- bash .ci/deploy.sh
- mv processed_build public
rules:
- if: $CI_COMMIT_BRANCH == "master"
- if: $CI_COMMIT_BRANCH == "develop"
artifacts:
expire_in: 1 week
paths:
......
......@@ -66,6 +66,7 @@ defaults:
path: "external/*"
values:
include_link: true
searchable: 1.0
# Exclude from processing. (no need to touch these)
......
var lunr = require('lunr'),
stdin = process.stdin,
stdout = process.stdout,
buffer = [];
stdin.resume();
stdin.setEncoding('utf8');
stdin.on('data', function (data) {
buffer.push(data);
});
stdin.on('end', function () {
var documents = JSON.parse(buffer.join(''))
var idx = lunr(function () {
this.ref('id')
this.field('title', { boost: 10 })
this.field('url')
this.field('content')
documents.forEach(function (doc) {
this.add(doc)
}, this)
})
stdout.write(JSON.stringify(idx))
});
---
---
{% assign the_cards = site.pages | where_exp:"card","card.searchable >= 1.0" %}
[ {% for card in the_cards %} {
"id": "{{ card.url | slugify }}",
"title": "{{ card.shortcut | xml_escape }}",
"content": {{ card.content | markdownify | strip_html | jsonify }},
"url": "{{ card.url | xml_escape | relative_url }}"
} {% unless forloop.last %},{% endunless %} {% endfor %}
]
......@@ -32,35 +32,24 @@ Markdown is a lightweight markup language with plain text formatting syntax whic
<img src="img/visual-code_img_10.png">
- **tips to write in markdown:**
<img src="img/visual-code_img_18.png">
**insert pictures:**
<img src="img/visual-code_img_19.png" width="1000">
**create a table**
<img src="img/visual-code_img_20.png">
## Syntax
## Tips to write in markdown:
<table>
<thead>
<tr>
<th>Markdown</th>
<th>Rendered Output</th>
</tr>
<tr>
<th>Markdown</th>
<th>Rendered Output</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
<pre>
# Header 1<br>
## Header 2<br>
### Header 3 <br>
#### Header 4
</code>
</pre>
</td>
<td>
<h1>Header 1</h1><br>
......@@ -68,107 +57,194 @@ Markdown is a lightweight markup language with plain text formatting syntax whic
<h3>Header 3</h3><br>
<h4>Header 4</h4>
</td>
</tr>
<tr>
<td>
<code>
To **bold** text, add **two asterisks** or __underscores__ before and after a word or phrase.</br>
To make text **italic** text, add *one asterisks* or _underscores_.
</code>
</td>
<td>
To make phrase <strong>bold</strong> text, add <strong>two asterisks</strong> or <strong>underscores</strong> before and after a word or phrase.</br>
To make text <i>italic</i>, add <i>one asterisks</i> or <i>underscores</i>.
</td>
</tr>
<tr>
<td>
<code>
Use numbers for ordered lists: <br />
1. First item<br />
2. Second item<br />
3. Third item<br />
&nbsp;&nbsp;&nbsp;&nbsp;1. Indented item<br />
&nbsp;&nbsp;&nbsp;&nbsp;2. Indented item<br />
4. Fourth item
</code>
</td>
<td>
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item
<ol>
<li>Indented item</li>
<li>Indented item</li>
</ol>
</li>
<li>Fourth item</li>
</ol>
</td>
</tr>
<tr>
<td>
<code>
For unordered lists
* First item<br />
* Second item<br />
* Third item<br />
* Fourth item
</code>
</td>
<td>
<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ul>
</td>
</tr>
<tr>
<td>
<code>
Include links referring to a web [page](https://www.markdownguide.org/)
</code>
</td>
<td>
Include links referring to a web <a href="https://www.markdownguide.org/">page</a>
</td>
</tr>
<tr>
<td>
<code>
Include local pictures: ![My awesome picture](img/r3_logo.png)
</code>
</td>
<td>
Include local pictures: <img src="img/img.png">
</td>
</tr>
<tr>
<td>
<code>
Include code blocks! </br>
```</br>
myAwesomeFunction <- function(x) x+1;</br>
# Apply function </br>
myAwesomeFunction(2);</br>
```
</code>
</td>
<td>
Include code blocks! </br>
</tr>
<tr>
<td>
<pre>
To make a text **bold**, use **double asterisk** or __underscores__ before and after a word or phrase.
To make a text **italic**, use *one asterisk* or _underscore_.
</pre>
</td>
<td>
To make a text <strong>bold</strong>, use <strong>double asterisk</strong> or <strong>underscores</strong> before and after a word or phrase.<br>
To make text <i>italic</i>, use <i>one asterisk</i> or <i>underscore</i>.
</td>
</tr>
<tr>
<td>
<pre>
Use numbers for ordered lists:
1. First item
2. Second item
3. Third item
&nbsp;&nbsp;&nbsp;&nbsp;1. Indented item
&nbsp;&nbsp;&nbsp;&nbsp;1. Indented item
4. Fourth item
</pre>
</td>
<td>
Use numbers for ordered lists:
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item
<ol>
<li>Indented item</li>
<li>Indented item</li>
</ol>
</li>
<li>Fourth item</li>
</ol>
</td>
</tr>
<tr>
<td>
<pre>
For unordered lists use asterisk, minus or plus
- First item
- Second item
* Third item
&nbsp;&nbsp;&nbsp;&nbsp;* Indented item
&nbsp;&nbsp;&nbsp;&nbsp;+ Indented item
* Fourth item
</pre>
</td>
<td>
For unordered lists use asterisk, minus or plus
<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<ul>
<li>Indented item</li>
<li>Indented item</li>
</ul>
<li>Fourth item</li>
</ul>
</td>
</tr>
<tr>
<td>
<pre>
Include links referring to a web [page](https://www.markdownguide.org/)
</pre>
</td>
<td>
Include links referring to a web <a href="https://www.markdownguide.org/">page</a>
</td>
</tr>
<tr>
<td>
<pre>
Include local pictures using markdown:
![My awesome picture](img/r3_logo.png)
</pre><br>
<pre>
Or use HTML tag allowing you to alter the image properties (e.g. size):
&lt;img src="img/r3_logo.png" width="40"&gt
</pre>
</td>
<td>
Include local pictures using markdown: <br>
<img src="img/r3_logo.png"> <br>
Or use HTML tag allowing you to alter the image properties (e.g. size):<br>
<img src="img/r3_logo.png" width="40">
</td>
</tr>
<tr>
<td>
<pre>
Include code blocks!
```
def myAwesomeFunction(x):
x+1
myAwesomeFunction(2)
```
</pre>
</td>
<td>
Include code blocks! <br>
<code>
myAwesomeFunction <- function(x) x+1;</br>
# Apply function</br>
myAwesomeFunction(2);
def myAwesomeFunction(x):<br>
x+1<br>
myAwesomeFunction(2)
</code>
</td>
</tr>
</td>
</tr>
<tr>
<td>
<pre>
Create table:
| Tables | Are | Cool |
|------------|:------:|:-----:|
| value one | blue | $1024 |
| value two | red | $256 |
| value three| green | $128 |
</pre>
</td>
<td>
Create table:
<div>
<table>
<thead>
<tr>
<th>
Tables
</th>
<th>
Are
</th>
<th>
Cool
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
value one
</td>
<td>
blue
</td>
<td>
$1024
</td>
</tr>
<tr>
<td>
value two
</td>
<td>
red
</td>
<td>
$256
</td>
</tr>
<tr>
<td>
value tree
</td>
<td>
green
</td>
<td>
$128
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
This is an overview of basic Markdown features. For more in-build features, please see various online [documentation](https://www.markdownguide.org/basic-syntax/).
### Advanced formatting
......@@ -185,55 +261,53 @@ Another big advantage of Markdown is that it can contain HTML tags, which makes
* **Blogging and tutorials** - structured document with chunks of code, pictures and results of the analyses can be easily converted to HTML format and posted on personal/team websites.
* **Notes and meeting minutes** - you can use following template for simple and nicely structured meeting notes:
<table>
<thead>
<tr>
<th>Markdown</th>
<th>Markdown template</th>
<th>Rendered Output</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
# DocTitle</br>
### Attendees:</br>
### Location:</br>
## Objective / Agenda</br>
## Meeting Notes</br>
* first note </br>
* second note </br>
* ...</br>
</br>
## Actions</br>
- [ ] Josh, Alice and Cindy will do this.</br>
- [x] Bob stops doing that.</br>
- [ ] Will and Tom will take care of those
</code>
</td>
<td>
<code>
<h1>DocTitle</h1></br>
<h3> Attendees:<h3></br>
<h3> Location:</h3></br>
<h2> Objective / Agenda</h2></br>
<h2> Meeting Notes</h2></br>
<ul>
<li> first note</li>
<li>second note</li>
<li>...</li>
</ul>
<h2> Actions</h2></br>
<input type="checkbox" > Josh, Alice and Cindy will do this.</input></br>
<input type="checkbox" checked="checked"> Bob stops doing that.</input></br>
<input type="checkbox" > Vanessa and Tom will take care of those</input></br>
</code>
</td>
</tr>
</tbody>
<tr>
<td>
<pre>
# DocTitle
### Attendees:
### Location:
## Objective / Agenda
## Meeting Notes
* first note
* second note
* ...
## Actions
- [ ] Josh, Alice and Cindy will do this.
- [x] Bob stops doing that.
- [ ] Will and Tom will take care of those
</pre>
</td>
<td>
<h1>DocTitle</h1><br>
<h3> Attendees:</h3><br>
<h3> Location:</h3><br>
<h2> Objective / Agenda</h2><br>
<h2> Meeting Notes</h2><br>
<ul>
<li> first note</li>
<li>second note</li>
<li>...</li>
</ul>
<h2> Actions</h2><br>
<input type="checkbox"> Josh, Alice and Cindy will do this.<br>
<input type="checkbox" checked="checked"> Bob stops doing that.<br>
<input type="checkbox"> Vanessa and Tom will take care of those<br>
</td>
</tr>
</tbody>
</table>
* **Analyses,reports and papers** - embedding [R markdown](https://rmarkdown.rstudio.com/) in an R project allows you to include executable code and related text in the very same document. This brings unprecedented level of consistency, shareability and reproducibility into the workflows.
* **Analyses, reports and papers** - embedding [R markdown](https://rmarkdown.rstudio.com/) in an R project allows you to include executable code and related text in the very same document. This brings unprecedented level of consistency, shareability and reproducibility into the workflows.
* **Online discussion forums** - many scientific and non-scientific discussion forums and social networks support Markdown for formatting the content of messages (e.g. [StackOverflow](https://stackoverflow.com/editing-help), [GitHub](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax), Reddit or even Facebook)
......
---
layout: page
permalink: /external/exchange-channels/duma/
shortcut: exchange-channels:duma
permalink: /external/exchange-channels/asperaweb/
shortcut: exchange-channels:asperaweb
redirect_from:
- /cards/exchange-channels:duma
- /external/cards/exchange-channels:duma
- /cards/exchange-channels:asperaweb
- /external/cards/exchange-channels:asperaweb
---
# AsperaWEB Quick Guide
......@@ -33,7 +33,7 @@ An access link can be reached via standard web browsers. Data can be transferred
* Through the web browser by visiting the link, which is our recommended way of data transfer, described in this [section of the guide](#ASPERAWEB_WEB)
* Through the use of a command line tool. If your data sits in an environment, where you can not launch a web browser, then you may use use a command line client tool to reach an access link. This process is described in this [section of this guide](#ASPERAWEB_CLI).