Skip to content

Commit f52d517

Browse files
committed
update nsgportal and sidebar mechanism
1 parent c6eadb6 commit f52d517

15 files changed

+54
-61
lines changed

code/plugins/reformat_plugin.py

+19-6
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,39 @@
66
def reformat_wiki_pages(filepath, filename, parent, output_file, wiki_input_dir=""):
77
append_text = '''---
88
layout: default
9-
title: {filename}
10-
long_title: {filename}
119
parent: {parent}
1210
grand_parent: Plugins
1311
'''.format(filename=filename, parent=parent)
1412

15-
print(f"Reformatting {filename}...")
13+
print(f"Reformatting {filename} of {parent}...")
1614
if parent in ["nsgportal", "limo"]:
1715
pages = []
16+
titles = []
1817
# load _Sidebar.md and extract all links from markdown file
1918
with open(os.path.join(wiki_input_dir, '_Sidebar.md')) as f:
2019
lines = f.readlines()
2120
for line in lines:
2221
if '(' in line:
2322
# extract text between square brackets
23+
title = line[line.find('[')+1:line.find(']')]
2424
page = line[line.find('(')+1:line.find(')')]
2525
pages.append(page)
26-
if filename in pages:
27-
order = pages.index(filename)
28-
append_text += 'nav_order: {order}\n'.format(order=order)
26+
titles.append(title)
27+
pages = list(map(str.lower, pages))
28+
if filename.lower() in pages:
29+
order = pages.index(filename.lower())
30+
title = titles[order]
31+
append_text += '''
32+
title: {title}
33+
long_title: {title}
34+
'''.format(title=title)
35+
36+
append_text += 'nav_order: {order}\n'.format(order=order+1)
37+
else:
38+
append_text += '''
39+
title: {filename}
40+
long_title: {filename}
41+
'''.format(filename=filename)
2942

3043
append_text += '---\n'
3144

plugins/nsgportal/Creating-and-managing-a-job-from-pop_nsg-GUI.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
layout: default
3-
title: Creating-and-managing-a-job-from-pop_nsg-GUI
4-
long_title: Creating-and-managing-a-job-from-pop_nsg-GUI
53
parent: nsgportal
64
grand_parent: Plugins
5+
6+
title: Tutorial 1-GUI job management
7+
long_title: Tutorial 1-GUI job management
78
nav_order: 8
89
---
910
# Creating and managing a job from pop_nsg GUI

plugins/nsgportal/Creating-and-managing-an-NSG-job-using-pop_nsg-from-the-command-line.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
layout: default
3-
title: Creating-and-managing-an-NSG-job-using-pop_nsg-from-the-command-line
4-
long_title: Creating-and-managing-an-NSG-job-using-pop_nsg-from-the-command-line
53
parent: nsgportal
64
grand_parent: Plugins
5+
6+
title: Tutorial 2-Command line management
7+
long_title: Tutorial 2-Command line management
78
nav_order: 9
89
---
910
This tutorial describes in details the process of submitting and managing a job using the command line options in _pop_nsg_.

plugins/nsgportal/EEGLAB-command-line-tools-to-RESTful-interface.md

-8
This file was deleted.

plugins/nsgportal/EEGLAB-plug-ins-on-NSG.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
layout: default
3-
title: EEGLAB-plug-ins-on-NSG
4-
long_title: EEGLAB-plug-ins-on-NSG
53
parent: nsgportal
64
grand_parent: Plugins
5+
6+
title: EEGLAB plug-ins on NSG
7+
long_title: EEGLAB plug-ins on NSG
78
nav_order: 3
89
---
910
The EEGLAB installation on NSG provides access to most of the EEGLAB plug-ins. See the table below for the list below of plug-in available from EEGLAB at NSG, as well as important links to the use of these plugins

plugins/nsgportal/Registering-at-NSG.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
---
22
layout: default
3-
title: Registering-at-NSG
4-
long_title: Registering-at-NSG
53
parent: nsgportal
64
grand_parent: Plugins
5+
6+
title: Registering on NSG
7+
long_title: Registering on NSG
78
nav_order: 1
89
---
10+
There are two ways to access to NSG: via NSG portal and through the command line interface NSG-R. The latter one uses its core curl commands to communicate with NSG and is the interface used by the nsgportal plug-in. Since both ways are interfaces to NSG, If you have already registered to NSG, you can use the same login and password for NSG-R. For the REST interface, refer to the [NSG REST documentation](https://nsgr.sdsc.edu:8443/restusers/documentation).
11+
912
The first step to using the Open EEGLAB Portal is to create an NSG account [HERE](https://www.nsgportal.org/gest/reg.php) (or by clicking on "Register account" on the NSG home page).
1013

1114
<center>

plugins/nsgportal/Registering-on-NSG-R.md

-8
This file was deleted.

plugins/nsgportal/Running-AMICA-on-NSG.md

-9
This file was deleted.

plugins/nsgportal/Scheme-of-plug-in-functions-call.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
22
layout: default
3-
title: Scheme-of-plug-in-functions-call
4-
long_title: Scheme-of-plug-in-functions-call
53
parent: nsgportal
64
grand_parent: Plugins
5+
6+
title: Scheme of plug-in functions call
7+
long_title: Scheme of plug-in functions call
8+
nav_order: 7
79
---
810
The figure below shows a scheme of function calls in _nsgportal_. In the plug-in there are two main sets, or layers, of functions designated by the prefix _pop__ and _nsg__. The _pop__ functions open a parameter entry window when called with fewer than the required arguments, else run directly without opening a window. The second class of nsgportal functions with prefix _nsg__ can be called directly from MATLAB command line or from other MATLAB scripts or functions. These functions perform lower-level processing than the pop_ functions. A plug-in function (_eegplugin_nsgportal_) manages the inclusion and appearance of an nsgportal item in the main EEGLAB window menu.
911

plugins/nsgportal/Setting-up-the-plug-in.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
layout: default
3-
title: Setting-up-the-plug-in
4-
long_title: Setting-up-the-plug-in
53
parent: nsgportal
64
grand_parent: Plugins
5+
6+
title: Setting up the plug-in
7+
long_title: Setting up the plug-in
78
nav_order: 4
89
---
910
# Setting up the plug-in

plugins/nsgportal/Using-pop_nsg-command-line-tools-in-your-EEGLAB-plug-in.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
layout: default
3-
title: Using-pop_nsg-command-line-tools-in-your-EEGLAB-plug-in
4-
long_title: Using-pop_nsg-command-line-tools-in-your-EEGLAB-plug-in
53
parent: nsgportal
64
grand_parent: Plugins
5+
6+
title: Tutorial 3-Using in other EEGLAB plug-ins
7+
long_title: Tutorial 3-Using in other EEGLAB plug-ins
78
nav_order: 10
89
---
910
# Using pop_nsg command line tools in your EEGLAB plug-in

plugins/nsgportal/Using-the-Open-EEGLAB-Portal.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
layout: default
3-
title: Using-the-Open-EEGLAB-Portal
4-
long_title: Using-the-Open-EEGLAB-Portal
53
parent: nsgportal
64
grand_parent: Plugins
5+
6+
title: Using the Open EEGLAB Portal
7+
long_title: Using the Open EEGLAB Portal
78
nav_order: 2
89
---
910
There will be two approaches to using the Open EEGLAB Portal: either, through its NSG web interface (http://www.NSGportal.org), or by making use of the NSG command line RESTful interface (NSG-R). This section describes the use of the web interface.

plugins/nsgportal/_Sidebar.md

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
---
22
layout: default
3-
title: _Sidebar
4-
long_title: _Sidebar
53
parent: nsgportal
64
grand_parent: Plugins
75
---
86
# EEGLAB on NSG
9-
* [EEGLAB on NSG](Home)
107
* [Registering on NSG](Registering-at-NSG)
118
* [Using the Open EEGLAB Portal](Using-the-Open-EEGLAB-Portal)
129
* [EEGLAB plug-ins on NSG](EEGLAB-plug-ins-on-NSG)
13-
# EEGLAB plug in to NSG: nsportal
10+
# EEGLAB plug in to NSG
1411
* [Setting up the plug-in](Setting-up-the-plug-in)
15-
* [Nsgportal plug-in GUI](nsgportal-graphical-user-interface:-pop_nsg)
12+
* [Nsgportal plug-in GUI](https://github.com/sccn/nsgportal/wiki/nsgportal-graphical-user-interface:-pop_nsg)
1613
* [Nsgportal command line tools](nsgportal-command-line-tools)
1714
* [Scheme of plug-in functions call](scheme-of-plug-in-functions-call)
1815
# Tutorials
19-
* [Tutorial 1: Creating and managing an NSG job from the _pop_nsg_ GUI](Creating-and-managing-a-job-from-pop_nsg-GUI)
20-
* [Tutorial 2: Creating and managing an NSG job using _pop_nsg_ from the command line](Creating-and-managing-an-NSG-job-using-pop_nsg-from-the-command-line)
21-
* [Tutorial 3: Using _pop_nsg_ in an EEGLAB plug-in](Using-pop_nsg-command-line-tools-in-your-EEGLAB-plug-in)
22-
* [Tutorial 4: Running AMICA on NSG](Running-AMICA-on-NSG)
16+
* [Tutorial 1-GUI job management](Creating-and-managing-a-job-from-pop_nsg-GUI)
17+
* [Tutorial 2-Command line management](Creating-and-managing-an-NSG-job-using-pop_nsg-from-the-command-line)
18+
* [Tutorial 3-Using in other EEGLAB plug-ins](Using-pop_nsg-command-line-tools-in-your-EEGLAB-plug-in)

plugins/nsgportal/nsgportal-command-line-tools.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
layout: default
3-
title: nsgportal-command-line-tools
4-
long_title: nsgportal-command-line-tools
53
parent: nsgportal
64
grand_parent: Plugins
5+
6+
title: Nsgportal command line tools
7+
long_title: Nsgportal command line tools
78
nav_order: 6
89
---
910
Just like many other EEGLAB functions, users can interact with *nsgportal* through either the graphic user interface or using command line tools. The command line tools allow users to largely automate their analysis and make the process easy to reproduce. In this section, we introduce the *nsgportal* command line tools to NSG.

plugins/nsgportal/nsgportal-graphical-user-interface:-pop_nsg.md

-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
---
22
layout: default
3-
title: nsgportal-graphical-user-interface:-pop_nsg
4-
long_title: nsgportal-graphical-user-interface:-pop_nsg
53
parent: nsgportal
64
grand_parent: Plugins
7-
nav_order: 5
85
---
96

107
# *nsgportal* graphical user interface: pop_nsg

0 commit comments

Comments
 (0)