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

Lines changed: 19 additions & 6 deletions
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

Lines changed: 3 additions & 2 deletions
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

Lines changed: 3 additions & 2 deletions
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

Lines changed: 0 additions & 8 deletions
This file was deleted.

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

Lines changed: 3 additions & 2 deletions
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

Lines changed: 5 additions & 2 deletions
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

Lines changed: 0 additions & 8 deletions
This file was deleted.

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

Lines changed: 0 additions & 9 deletions
This file was deleted.

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

Lines changed: 4 additions & 2 deletions
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

Lines changed: 3 additions & 2 deletions
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

0 commit comments

Comments
 (0)