Skip to content

Commit

Permalink
update nsgportal and sidebar mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
dungscout96 committed Aug 5, 2024
1 parent c6eadb6 commit f52d517
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 61 deletions.
25 changes: 19 additions & 6 deletions code/plugins/reformat_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,39 @@
def reformat_wiki_pages(filepath, filename, parent, output_file, wiki_input_dir=""):
append_text = '''---
layout: default
title: {filename}
long_title: {filename}
parent: {parent}
grand_parent: Plugins
'''.format(filename=filename, parent=parent)

print(f"Reformatting {filename}...")
print(f"Reformatting {filename} of {parent}...")
if parent in ["nsgportal", "limo"]:
pages = []
titles = []
# load _Sidebar.md and extract all links from markdown file
with open(os.path.join(wiki_input_dir, '_Sidebar.md')) as f:
lines = f.readlines()
for line in lines:
if '(' in line:
# extract text between square brackets
title = line[line.find('[')+1:line.find(']')]
page = line[line.find('(')+1:line.find(')')]
pages.append(page)
if filename in pages:
order = pages.index(filename)
append_text += 'nav_order: {order}\n'.format(order=order)
titles.append(title)
pages = list(map(str.lower, pages))
if filename.lower() in pages:
order = pages.index(filename.lower())
title = titles[order]
append_text += '''
title: {title}
long_title: {title}
'''.format(title=title)

append_text += 'nav_order: {order}\n'.format(order=order+1)
else:
append_text += '''
title: {filename}
long_title: {filename}
'''.format(filename=filename)

append_text += '---\n'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
layout: default
title: Creating-and-managing-a-job-from-pop_nsg-GUI
long_title: Creating-and-managing-a-job-from-pop_nsg-GUI
parent: nsgportal
grand_parent: Plugins

title: Tutorial 1-GUI job management
long_title: Tutorial 1-GUI job management
nav_order: 8
---
# Creating and managing a job from pop_nsg GUI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
layout: default
title: Creating-and-managing-an-NSG-job-using-pop_nsg-from-the-command-line
long_title: Creating-and-managing-an-NSG-job-using-pop_nsg-from-the-command-line
parent: nsgportal
grand_parent: Plugins

title: Tutorial 2-Command line management
long_title: Tutorial 2-Command line management
nav_order: 9
---
This tutorial describes in details the process of submitting and managing a job using the command line options in _pop_nsg_.
Expand Down

This file was deleted.

5 changes: 3 additions & 2 deletions plugins/nsgportal/EEGLAB-plug-ins-on-NSG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
layout: default
title: EEGLAB-plug-ins-on-NSG
long_title: EEGLAB-plug-ins-on-NSG
parent: nsgportal
grand_parent: Plugins

title: EEGLAB plug-ins on NSG
long_title: EEGLAB plug-ins on NSG
nav_order: 3
---
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
Expand Down
7 changes: 5 additions & 2 deletions plugins/nsgportal/Registering-at-NSG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
---
layout: default
title: Registering-at-NSG
long_title: Registering-at-NSG
parent: nsgportal
grand_parent: Plugins

title: Registering on NSG
long_title: Registering on NSG
nav_order: 1
---
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).

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).

<center>
Expand Down
8 changes: 0 additions & 8 deletions plugins/nsgportal/Registering-on-NSG-R.md

This file was deleted.

9 changes: 0 additions & 9 deletions plugins/nsgportal/Running-AMICA-on-NSG.md

This file was deleted.

6 changes: 4 additions & 2 deletions plugins/nsgportal/Scheme-of-plug-in-functions-call.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
layout: default
title: Scheme-of-plug-in-functions-call
long_title: Scheme-of-plug-in-functions-call
parent: nsgportal
grand_parent: Plugins

title: Scheme of plug-in functions call
long_title: Scheme of plug-in functions call
nav_order: 7
---
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.

Expand Down
5 changes: 3 additions & 2 deletions plugins/nsgportal/Setting-up-the-plug-in.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
layout: default
title: Setting-up-the-plug-in
long_title: Setting-up-the-plug-in
parent: nsgportal
grand_parent: Plugins

title: Setting up the plug-in
long_title: Setting up the plug-in
nav_order: 4
---
# Setting up the plug-in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
layout: default
title: Using-pop_nsg-command-line-tools-in-your-EEGLAB-plug-in
long_title: Using-pop_nsg-command-line-tools-in-your-EEGLAB-plug-in
parent: nsgportal
grand_parent: Plugins

title: Tutorial 3-Using in other EEGLAB plug-ins
long_title: Tutorial 3-Using in other EEGLAB plug-ins
nav_order: 10
---
# Using pop_nsg command line tools in your EEGLAB plug-in
Expand Down
5 changes: 3 additions & 2 deletions plugins/nsgportal/Using-the-Open-EEGLAB-Portal.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
layout: default
title: Using-the-Open-EEGLAB-Portal
long_title: Using-the-Open-EEGLAB-Portal
parent: nsgportal
grand_parent: Plugins

title: Using the Open EEGLAB Portal
long_title: Using the Open EEGLAB Portal
nav_order: 2
---
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.
Expand Down
14 changes: 5 additions & 9 deletions plugins/nsgportal/_Sidebar.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
---
layout: default
title: _Sidebar
long_title: _Sidebar
parent: nsgportal
grand_parent: Plugins
---
# EEGLAB on NSG
* [EEGLAB on NSG](Home)
* [Registering on NSG](Registering-at-NSG)
* [Using the Open EEGLAB Portal](Using-the-Open-EEGLAB-Portal)
* [EEGLAB plug-ins on NSG](EEGLAB-plug-ins-on-NSG)
# EEGLAB plug in to NSG: nsportal
# EEGLAB plug in to NSG
* [Setting up the plug-in](Setting-up-the-plug-in)
* [Nsgportal plug-in GUI](nsgportal-graphical-user-interface:-pop_nsg)
* [Nsgportal plug-in GUI](https://github.com/sccn/nsgportal/wiki/nsgportal-graphical-user-interface:-pop_nsg)
* [Nsgportal command line tools](nsgportal-command-line-tools)
* [Scheme of plug-in functions call](scheme-of-plug-in-functions-call)
# Tutorials
* [Tutorial 1: Creating and managing an NSG job from the _pop_nsg_ GUI](Creating-and-managing-a-job-from-pop_nsg-GUI)
* [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)
* [Tutorial 3: Using _pop_nsg_ in an EEGLAB plug-in](Using-pop_nsg-command-line-tools-in-your-EEGLAB-plug-in)
* [Tutorial 4: Running AMICA on NSG](Running-AMICA-on-NSG)
* [Tutorial 1-GUI job management](Creating-and-managing-a-job-from-pop_nsg-GUI)
* [Tutorial 2-Command line management](Creating-and-managing-an-NSG-job-using-pop_nsg-from-the-command-line)
* [Tutorial 3-Using in other EEGLAB plug-ins](Using-pop_nsg-command-line-tools-in-your-EEGLAB-plug-in)
5 changes: 3 additions & 2 deletions plugins/nsgportal/nsgportal-command-line-tools.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
layout: default
title: nsgportal-command-line-tools
long_title: nsgportal-command-line-tools
parent: nsgportal
grand_parent: Plugins

title: Nsgportal command line tools
long_title: Nsgportal command line tools
nav_order: 6
---
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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
---
layout: default
title: nsgportal-graphical-user-interface:-pop_nsg
long_title: nsgportal-graphical-user-interface:-pop_nsg
parent: nsgportal
grand_parent: Plugins
nav_order: 5
---

# *nsgportal* graphical user interface: pop_nsg
Expand Down

0 comments on commit f52d517

Please sign in to comment.