diff --git a/common/schema/types.js b/common/schema/types.js
index 68e259b4..62540709 100644
--- a/common/schema/types.js
+++ b/common/schema/types.js
@@ -61,6 +61,9 @@ export class Schema {
tagHasAttribute(tag, tagAttribute) {}
}
+/**
+ * Hed2Schema class
+ */
export class Hed2Schema extends Schema {
/**
* The description of tag attributes.
@@ -91,6 +94,9 @@ export class Hed2Schema extends Schema {
}
}
+/**
+ * Hed3Schema class
+ */
export class Hed3Schema extends Schema {
/**
* The collection of schema entries.
diff --git a/converter/splitHedString.js b/converter/splitHedString.js
index 3993e86d..c499047d 100644
--- a/converter/splitHedString.js
+++ b/converter/splitHedString.js
@@ -7,7 +7,7 @@ const tagDelimiters = new Set([',', '(', ')', '~'])
* @returns {Array[]} A list of string parts. The boolean is true if the part is
* a tag and false if it is a delimiter. The numbers are the bounds of the part.
*/
-export default function splitHedString(hedString) {
+export function splitHedString(hedString) {
const resultPositions = []
let currentSpacing = 0
let insideDelimiter = true
@@ -62,3 +62,5 @@ export default function splitHedString(hedString) {
return resultPositions
}
+
+export default splitHedString
diff --git a/docs/Makefile b/docs/Makefile
index 92dd33a1..b8808422 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -1,5 +1,26 @@
-# Minimal makefile for Sphinx documentation
-#
+# We avoid $(CURDIR) because it spits out /cygdrive/c/... on Windows Cygwin
+# installs and leads to things that don't work.
+VIRTUAL_ENV = venv
+PYTHON3 ?= python3
+
+# Let us find jsdoc and sphinx:
+export PATH := node_modules/.bin:$(VIRTUAL_ENV)/bin:$(VIRTUAL_ENV)/Scripts:$(PATH)
+
+# I'm not entirely sure why this line is needed yet...
+.PHONY: js
+
+# Verify venv exists
+.PHONY: venv
+venv: $(VIRTUAL_ENV)/pyvenv.cfg
+
+$(VIRTUAL_ENV)/pyvenv.cfg:
+ $(PYTHON3) -m venv $(VIRTUAL_ENV)
+ PATH="$(PATH)" pip3 install -r requirements.txt
+
+# Not sure if this is needed...
+# .npm_installed: ../package.json
+# npm install
+# touch $@
# You can set these variables from the command line, and also
# from the environment for the first two.
@@ -18,3 +39,12 @@ help:
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
+
+
+# Delete just the built docs, not the whole venv, which is expensive to
+# reconstitute:
+.PHONY: clean
+clean:
+ rm -rf $(BUILDDIR)
+ rm -rf node_modules .npm_installed
\ No newline at end of file
diff --git a/docs/source/bids.rst b/docs/source/bids.rst
new file mode 100644
index 00000000..1b5f8076
--- /dev/null
+++ b/docs/source/bids.rst
@@ -0,0 +1,13 @@
+bids
+====
+
+Bids functionality
+
+.. toctree::
+ :maxdepth: 8
+
+ bids.schema.rst
+ bids.tsvParser.rst
+ bids.types.rst
+ bids.utils.rst
+ bids.validate.rst
diff --git a/docs/source/api2.rst b/docs/source/bids.schema.rst
similarity index 50%
rename from docs/source/api2.rst
rename to docs/source/bids.schema.rst
index ec25fbcd..cc7a1cbd 100644
--- a/docs/source/api2.rst
+++ b/docs/source/bids.schema.rst
@@ -1,3 +1,4 @@
-HED API reference (Auto style)
+Schema
==============================
+Intentionally Blank
diff --git a/docs/source/bids.tsvParser.rst b/docs/source/bids.tsvParser.rst
new file mode 100644
index 00000000..10e8635e
--- /dev/null
+++ b/docs/source/bids.tsvParser.rst
@@ -0,0 +1,5 @@
+tsvParse
+==============================
+
+.. js:autofunction:: parseTSV
+
diff --git a/docs/source/bids.types.rst b/docs/source/bids.types.rst
new file mode 100644
index 00000000..7936bcbc
--- /dev/null
+++ b/docs/source/bids.types.rst
@@ -0,0 +1,23 @@
+types
+==============================
+
+.. js:autoclass:: BidsData
+ :members:
+
+.. js:autoclass:: BidsFile
+ :members:
+
+.. js:autoclass:: BidsJsonFile
+ :members:
+
+.. js:autoclass:: BidsTsvFile
+ :members:
+
+.. js:autoclass:: BidsEventFile
+ :members:
+
+.. js:autoclass:: BidsTabularFile
+ :members:
+
+.. js:autoclass:: BidsSidecar
+ :members:
diff --git a/docs/source/bids.utils.rst b/docs/source/bids.utils.rst
new file mode 100644
index 00000000..659ed160
--- /dev/null
+++ b/docs/source/bids.utils.rst
@@ -0,0 +1,5 @@
+utils
+==============================
+
+.. js:autofunction:: sidecarValueHasHed
+
diff --git a/docs/source/bids.validate.rst b/docs/source/bids.validate.rst
new file mode 100644
index 00000000..f864dee6
--- /dev/null
+++ b/docs/source/bids.validate.rst
@@ -0,0 +1,22 @@
+validate
+==============================
+
+.. js:autofunction:: sidecarValueHasHed
+
+.. js:autofunction:: validateBidsDataset
+
+.. js:autofunction:: validateFullDataset
+
+.. js:autofunction:: validateBidsTsvFile
+
+.. js:autofunction:: validateSidecars
+
+.. js:autofunction:: validateHedColumn
+
+.. js:autofunction:: parseTsvHed
+
+.. js:autofunction:: validateCombinedDataset
+
+.. js:autofunction:: validateStrings
+
+.. js:autofunction:: convertHedIssuesToBidsIssues
diff --git a/docs/source/common.issues.data.rst b/docs/source/common.issues.data.rst
new file mode 100644
index 00000000..66992cc7
--- /dev/null
+++ b/docs/source/common.issues.data.rst
@@ -0,0 +1,4 @@
+data
+======
+
+Intentionally blank for now
\ No newline at end of file
diff --git a/docs/source/common.issues.issues.rst b/docs/source/common.issues.issues.rst
new file mode 100644
index 00000000..d9842b32
--- /dev/null
+++ b/docs/source/common.issues.issues.rst
@@ -0,0 +1,8 @@
+issues
+======
+
+.. js:autoclass:: Issue
+ :members:
+
+.. js:autofunction:: generateIssue
+
diff --git a/docs/source/common.issues.rst b/docs/source/common.issues.rst
new file mode 100644
index 00000000..0d27171d
--- /dev/null
+++ b/docs/source/common.issues.rst
@@ -0,0 +1,8 @@
+issues
+======
+
+.. toctree::
+ :maxdepth: 8
+
+ common.issues.issues
+ common.issues.data
\ No newline at end of file
diff --git a/docs/source/common.rst b/docs/source/common.rst
new file mode 100644
index 00000000..5554cf43
--- /dev/null
+++ b/docs/source/common.rst
@@ -0,0 +1,8 @@
+common
+======
+
+.. toctree::
+ :maxdepth: 8
+
+ common.schema
+ common.issues
\ No newline at end of file
diff --git a/docs/source/common.schema.config.rst b/docs/source/common.schema.config.rst
new file mode 100644
index 00000000..0be67493
--- /dev/null
+++ b/docs/source/common.schema.config.rst
@@ -0,0 +1,4 @@
+config
+======
+
+Intentionally blank for now
\ No newline at end of file
diff --git a/docs/source/common.schema.loader.rst b/docs/source/common.schema.loader.rst
new file mode 100644
index 00000000..fc13df03
--- /dev/null
+++ b/docs/source/common.schema.loader.rst
@@ -0,0 +1,18 @@
+loader
+======
+
+.. js:autofunction:: loadSchema
+
+.. js:autofunction:: loadSchemaFromSpec
+
+.. js:autofunction:: loadPromise
+
+.. js:autofunction:: loadRemoteSchema
+
+.. js:autofunction:: loadLocalSchema
+
+.. js:autofunction:: loadBundledSchema
+
+.. js:autofunction:: loadSchemaFile
+
+.. js:autofunction:: parseSchemaXML
diff --git a/docs/source/common.schema.rst b/docs/source/common.schema.rst
new file mode 100644
index 00000000..783e8233
--- /dev/null
+++ b/docs/source/common.schema.rst
@@ -0,0 +1,9 @@
+schema
+======
+
+.. toctree::
+ :maxdepth: 8
+
+ common.schema.types
+ common.schema.loader
+ common.schema.config
\ No newline at end of file
diff --git a/docs/source/common.schema.types.rst b/docs/source/common.schema.types.rst
new file mode 100644
index 00000000..332a4842
--- /dev/null
+++ b/docs/source/common.schema.types.rst
@@ -0,0 +1,20 @@
+types
+======
+
+.. js:autoclass:: Schema
+ :members:
+
+.. js:autoclass:: Hed2Schema
+ :members:
+
+.. js:autoclass:: Hed3Schema
+ :members:
+
+.. js:autoclass:: Schemas
+ :members:
+
+.. js:autoclass:: SchemaSpec
+ :members:
+
+.. js:autoclass:: SchemasSpec
+ :members:
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 32c49374..632ec4ff 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -14,7 +14,7 @@
import sys
import sphinx_rtd_theme
from datetime import date
-import subprocess
+
sys.path.insert(0, os.path.abspath('../../../'))
@@ -42,30 +42,29 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
- "myst_parser",
- "sphinx.ext.autodoc",
- "sphinx.ext.autosummary",
- "sphinx.ext.autosectionlabel",
- "sphinx.ext.intersphinx",
- "sphinx.ext.coverage",
- "sphinx.ext.mathjax",
- "sphinx.ext.viewcode",
- "sphinx.ext.githubpages",
- "sphinx.ext.napoleon",
- "sphinx.ext.extlinks",
- "sphinx_js"
+ # 'sphinx.ext.autodoc',
+ # 'sphinx.ext.viewcode',
+ # 'sphinx_click.ext',
+ 'sphinx_js'
]
-js_source_path = '../../'
+root_for_relative_js_paths = "../../"
+base_folders = ["../../bids", "../../validator", "../../converter", "../../common", "../../utils"]
-primary_domain = 'js'
+def find_all_folders(directory):
+ all_folders = [directory]
+
+ for root, dirs, _ in os.walk(directory):
+ for d in dirs:
+ all_folders.append(os.path.join(root, d))
-autosummary_generate = True
-autodoc_default_flags = ['members', 'inherited-members']
-add_module_names = False
-myst_all_links_external = False
-myst_heading_anchors = 2
-myst_enable_extensions = ["deflist"]
+ return all_folders
+
+js_source_path = []
+for folder in base_folders:
+ js_source_path += find_all_folders(folder)
+print(js_source_path)
+primary_domain = 'js'
# Add any paths that contain templates here, relative to this directory.
@@ -76,7 +75,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
-exclude_patterns = ['_build', '_templates', 'Thumbs.db', '.DS_Store']
+exclude_patterns = ['_build', '_templates', 'Thumbs.db', '.DS_Store', 'venv']
# -- Options for HTML output -------------------------------------------------
@@ -100,29 +99,14 @@
# Toc options
'collapse_navigation': False,
'sticky_navigation': True,
- 'navigation_depth': 4,
+ 'navigation_depth': 6,
'includehidden': True,
'titles_only': False
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
-
-
-def run_jsdoc(app):
- source_dir = app.builder.srcdir
- jsdoc_output_dir = os.path.join(source_dir, 'jsdoc_output')
- jsdoc_command = [
- 'npx', # Use npx to run locally installed npm packages
- 'jsdoc',
- '-c', os.path.join(source_dir, 'path/to/jsdoc/config.json'), # Adjust the path to your JSDoc config
- '-d', jsdoc_output_dir,
- 'path/to/javascript/files', # Adjust the path to your JavaScript files
- ]
- subprocess.call(jsdoc_command)
-
+import sphinx_rtd_theme
+html_static_path = [os.path.join(sphinx_rtd_theme.get_html_theme_path(), 'sphinx_rtd_theme', 'static')]
-def setup(app):
- app.connect('builder-inited', run_jsdoc)
diff --git a/docs/source/converter.converter.rst b/docs/source/converter.converter.rst
new file mode 100644
index 00000000..60f17848
--- /dev/null
+++ b/docs/source/converter.converter.rst
@@ -0,0 +1,18 @@
+converter
+=========
+
+.. js:autofunction:: removeSlashesAndSpaces
+
+.. js:autofunction:: convertTagToLong
+
+.. js:autofunction:: convertTagToShort
+
+.. js:autofunction:: convertPartialHedStringToLong
+
+.. This one is not marked for export
+ .. js:autofunction:: convertHedString
+
+.. js:autofunction:: convertHedStringToLong
+
+.. js:autofunction:: convertHedStringToShort
+
diff --git a/docs/source/converter.issues.rst b/docs/source/converter.issues.rst
new file mode 100644
index 00000000..a4ee0e3b
--- /dev/null
+++ b/docs/source/converter.issues.rst
@@ -0,0 +1,4 @@
+issues
+======
+
+Intentionally blank for now
\ No newline at end of file
diff --git a/docs/source/converter.rst b/docs/source/converter.rst
new file mode 100644
index 00000000..f35eb0c3
--- /dev/null
+++ b/docs/source/converter.rst
@@ -0,0 +1,11 @@
+converter
+=========
+
+.. toctree::
+ :maxdepth: 8
+
+ converter.types
+ converter.schema
+ converter.issues
+ converter.splitHedString
+ converter.converter
diff --git a/docs/source/converter.schema.rst b/docs/source/converter.schema.rst
new file mode 100644
index 00000000..b693b11e
--- /dev/null
+++ b/docs/source/converter.schema.rst
@@ -0,0 +1,7 @@
+schema
+=========
+
+.. js:autofunction:: buildMappingObject
+
+.. js:autofunction:: schema.buildSchema
+
diff --git a/docs/source/converter.splitHedString.rst b/docs/source/converter.splitHedString.rst
new file mode 100644
index 00000000..5fc0b30e
--- /dev/null
+++ b/docs/source/converter.splitHedString.rst
@@ -0,0 +1,6 @@
+splitHedString
+==============
+
+.. js:autofunction:: splitHedString
+
+
diff --git a/docs/source/converter.types.rst b/docs/source/converter.types.rst
new file mode 100644
index 00000000..5af60b33
--- /dev/null
+++ b/docs/source/converter.types.rst
@@ -0,0 +1,10 @@
+types
+=========
+
+.. js:autoclass:: TagEntry
+ :members:
+
+.. js:autoclass:: Mapping
+ :members:
+
+
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 2555732c..e031bb49 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -1,36 +1,40 @@
-Hierarchical Event Descriptor (HED) JavaScript Tools
-====================================================
-
-.. image:: _static/images/croppedWideLogo.png
- :width: 220
- :alt: HedLogo
-
-.. sidebar:: **Links**
-
- * `PDF docs `_
-
- * `Source code `_
-
-Note: this is a work in progress. More information is coming.
-
-.. toctree::
- :maxdepth: 5
- :caption: Contents:
-
- introduction.md
- user_guide.rst
-
-.. toctree::
- :maxdepth: 5
- :caption: HED JavaScript API:
-
- api2.rst
-
-
-Indices and tables
-====================
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
-
+Hierarchical Event Descriptor (HED) JavaScript Tools
+====================================================
+
+.. image:: _static/images/croppedWideLogo.png
+ :width: 220
+ :alt: HedLogo
+
+.. sidebar:: **Links**
+
+ * `PDF docs `_
+
+ * `Source code `_
+
+Note: this is a work in progress. More information is coming.
+
+.. toctree::
+ :maxdepth: 8
+ :caption: Contents:
+
+ introduction.md
+ user_guide.rst
+
+.. toctree::
+ :maxdepth: 8
+ :caption: HED JavaScript API:
+
+ bids.rst
+ common.rst
+ converter.rst
+ utils.rst
+ validator.rst
+
+
+Indices and tables
+====================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
diff --git a/docs/source/introduction.rst b/docs/source/introduction.rst
deleted file mode 100644
index 71f63261..00000000
--- a/docs/source/introduction.rst
+++ /dev/null
@@ -1,50 +0,0 @@
-.. _introduction:
-
-=====================================================
-Introduction to HED
-=====================================================
-
-.. contents:: **Contents**
- :local:
- :depth: 1
-
-Why HED?
-========
-
-.. topic:: Why use HED?
-
- HED (Hierarchical Event Descriptors) is an infrastructure and
- a controlled vocabulary that allows researchers to annotate
- their experimental data, especially events,
- so that tools can automatically use this information in analysis.
-
-For more information on using Hierarchical Event Descriptors (HED)
-visit `HED examples `_:
-
-
-Installing hed-javascript
-=========================
-The hed-javascript tools are available on npm and can be installed using
-using the following command:
-
->>> npm install hed-validator
-
-
-Finding help
-============
-
-:Documentation:
-
- See `HED resources `_ for user documentation and tutorials.
-
-
-:Mailing lists and forums:
-
- * Don't hesitate to ask questions about the python hedtools on `NeuroStars
- `_.
-
-:Issues and problems:
- * If you notice a bug in the python hedtools code or encounter other problems using the tools, please `open an issue`_ in the
- hed-javascript repository on github.
-
-.. _open an issue: https://github.com/hed-standard/hed-javascript/issues
diff --git a/docs/source/utils.array.rst b/docs/source/utils.array.rst
new file mode 100644
index 00000000..97a67206
--- /dev/null
+++ b/docs/source/utils.array.rst
@@ -0,0 +1,9 @@
+array
+=========
+
+.. js:autofunction:: getElementCount
+
+.. js:autofunction:: asArray
+
+.. js:autofunction:: recursiveMap
+
diff --git a/docs/source/utils.files.rst b/docs/source/utils.files.rst
new file mode 100644
index 00000000..bd33db28
--- /dev/null
+++ b/docs/source/utils.files.rst
@@ -0,0 +1,6 @@
+files
+=========
+.. js:autofunction:: readFile
+
+.. js:autofunction:: readHTTPSFile
+
diff --git a/docs/source/utils.hedData.rst b/docs/source/utils.hedData.rst
new file mode 100644
index 00000000..8e1a5a35
--- /dev/null
+++ b/docs/source/utils.hedData.rst
@@ -0,0 +1,10 @@
+hedData
+=========
+
+.. js:autofunction:: getGenerationForSchemaVersion
+
+.. No documentation yet
+ .. js:autofunction:: mergeParsingIssues
+
+.. js:autofunction:: getParsedParentTags
+
diff --git a/docs/source/utils.hedStrings.rst b/docs/source/utils.hedStrings.rst
new file mode 100644
index 00000000..4fb6face
--- /dev/null
+++ b/docs/source/utils.hedStrings.rst
@@ -0,0 +1,18 @@
+hedStrings
+=========
+.. js:autofunction:: replaceTagNameWithPound
+
+.. no documentation yet
+# .. js:autofunction:: getTagSlashIndices
+
+.. js:autofunction:: getTagLevels
+
+.. js:autofunction:: hedStrings.getTagName
+
+.. js:autofunction:: hedStrings.getParentTag
+
+.. js:autofunction:: hedStringIsAGroup
+
+.. js:autofunction:: loadSchemaFile
+
+.. js:autofunction:: removeGroupParentheses
diff --git a/docs/source/utils.map.rst b/docs/source/utils.map.rst
new file mode 100644
index 00000000..0cceb576
--- /dev/null
+++ b/docs/source/utils.map.rst
@@ -0,0 +1,6 @@
+map
+===
+
+Intentionally blank for now
+# .. js:autofunction:: filterNonEqualDuplicates
+
diff --git a/docs/source/utils.rst b/docs/source/utils.rst
new file mode 100644
index 00000000..902978ef
--- /dev/null
+++ b/docs/source/utils.rst
@@ -0,0 +1,15 @@
+utils
+=====
+
+.. toctree::
+ :maxdepth: 8
+
+ utils.xml2js
+ utils.map
+ utils.types
+ utils.files
+ utils.xpath
+ utils.string
+ utils.hedData
+ utils.array
+ utils.hedStrings
\ No newline at end of file
diff --git a/docs/source/utils.string.rst b/docs/source/utils.string.rst
new file mode 100644
index 00000000..818b4492
--- /dev/null
+++ b/docs/source/utils.string.rst
@@ -0,0 +1,16 @@
+string
+======
+
+.. js:autofunction:: stringIsEmpty
+
+.. js:autofunction:: getCharacterCount
+
+.. js:autofunction:: capitalizeString
+
+.. js:autofunction:: isClockFaceTime
+
+.. js:autofunction:: isDateTime
+
+.. js:autofunction:: isNumber
+
+.. js:autofunction:: stringTemplate
diff --git a/docs/source/utils.types.rst b/docs/source/utils.types.rst
new file mode 100644
index 00000000..1e747d2a
--- /dev/null
+++ b/docs/source/utils.types.rst
@@ -0,0 +1,8 @@
+types
+=========
+
+.. js:autoclass:: MemoizerMixin
+ :members:
+
+.. js:autoclass:: Memoizer
+ :members:
diff --git a/docs/source/utils.xml2js.rst b/docs/source/utils.xml2js.rst
new file mode 100644
index 00000000..f4523835
--- /dev/null
+++ b/docs/source/utils.xml2js.rst
@@ -0,0 +1,7 @@
+xml2js
+=========
+
+.. not exported
+ .. js:autofunction:: setNodeParent
+
+.. js:autofunction:: setParent
diff --git a/docs/source/utils.xpath.rst b/docs/source/utils.xpath.rst
new file mode 100644
index 00000000..a31f97bf
--- /dev/null
+++ b/docs/source/utils.xpath.rst
@@ -0,0 +1,8 @@
+xpath
+=========
+
+.. js:autofunction:: find
+
+.. js:autofunction:: parseXPath
+
+.. js:autofunction:: search
diff --git a/docs/source/validator.dataset.rst b/docs/source/validator.dataset.rst
new file mode 100644
index 00000000..b48d62bc
--- /dev/null
+++ b/docs/source/validator.dataset.rst
@@ -0,0 +1,16 @@
+dataset
+=========
+
+.. js:autofunction:: parseDefinitions
+
+.. js:autofunction:: checkGroupForTemporalOrder
+
+.. js:autofunction:: validateTemporalOrder
+
+.. js:autofunction:: validateDataset
+
+.. js:autofunction:: validateHedEvents
+
+.. js:autofunction:: validateHedDataset
+
+.. js:autofunction:: validateHedDatasetWithContext
diff --git a/docs/source/validator.event.hed3.rst b/docs/source/validator.event.hed3.rst
new file mode 100644
index 00000000..36563f9c
--- /dev/null
+++ b/docs/source/validator.event.hed3.rst
@@ -0,0 +1,5 @@
+hed3
+=========
+
+.. js:autoclass:: Hed3Validator
+ :members:
\ No newline at end of file
diff --git a/docs/source/validator.event.init.rst b/docs/source/validator.event.init.rst
new file mode 100644
index 00000000..20d1d613
--- /dev/null
+++ b/docs/source/validator.event.init.rst
@@ -0,0 +1,10 @@
+init
+=========
+
+.. js:autofunction:: initiallyValidateHedString
+
+.. js:autofunction:: validateHedString
+
+.. js:autofunction:: validateHedEvent
+
+.. js:autofunction:: validateHedEventWithDefinitions
\ No newline at end of file
diff --git a/docs/source/validator.event.rst b/docs/source/validator.event.rst
new file mode 100644
index 00000000..a77be92a
--- /dev/null
+++ b/docs/source/validator.event.rst
@@ -0,0 +1,9 @@
+event
+=====
+
+.. toctree::
+ :maxdepth: 8
+
+ validator.event.init
+ validator.event.validator
+ validator.event.hed3
\ No newline at end of file
diff --git a/docs/source/validator.event.validator.rst b/docs/source/validator.event.validator.rst
new file mode 100644
index 00000000..3e0eeaef
--- /dev/null
+++ b/docs/source/validator.event.validator.rst
@@ -0,0 +1,4 @@
+validator
+=========
+.. js:autoclass:: HedValidator
+ :members:
\ No newline at end of file
diff --git a/docs/source/validator.hed2.event.hed2Validator.rst b/docs/source/validator.hed2.event.hed2Validator.rst
new file mode 100644
index 00000000..623a93f2
--- /dev/null
+++ b/docs/source/validator.hed2.event.hed2Validator.rst
@@ -0,0 +1,5 @@
+hed2Validator
+=============
+
+.. js:autoclass:: Hed2Validator
+ :members:
diff --git a/docs/source/validator.hed2.event.rst b/docs/source/validator.hed2.event.rst
new file mode 100644
index 00000000..c94f5857
--- /dev/null
+++ b/docs/source/validator.hed2.event.rst
@@ -0,0 +1,8 @@
+event
+=====
+
+.. toctree::
+ :maxdepth: 8
+
+ validator.hed2.event.hed2Validator
+ validator.hed2.event.units
\ No newline at end of file
diff --git a/docs/source/validator.hed2.event.units.rst b/docs/source/validator.hed2.event.units.rst
new file mode 100644
index 00000000..a0353dcf
--- /dev/null
+++ b/docs/source/validator.hed2.event.units.rst
@@ -0,0 +1,10 @@
+units
+=========
+
+.. js:autofunction:: units.validateUnits
+
+.. js:autofunction:: isPrefixUnit
+
+.. js:autofunction:: getValidDerivativeUnits
+
+.. js:autofunction:: getAllUnits
\ No newline at end of file
diff --git a/docs/source/validator.hed2.parser.parsedHed2Tag.rst b/docs/source/validator.hed2.parser.parsedHed2Tag.rst
new file mode 100644
index 00000000..ed9c633c
--- /dev/null
+++ b/docs/source/validator.hed2.parser.parsedHed2Tag.rst
@@ -0,0 +1,5 @@
+parsedHed2Tag
+=========
+
+.. js:autoclass:: ParsedHed2Tag
+ :members:
diff --git a/docs/source/validator.hed2.parser.rst b/docs/source/validator.hed2.parser.rst
new file mode 100644
index 00000000..c1235721
--- /dev/null
+++ b/docs/source/validator.hed2.parser.rst
@@ -0,0 +1,7 @@
+parser
+======
+
+.. toctree::
+ :maxdepth: 8
+
+ validator.hed2.parser.parsedHed2Tag
\ No newline at end of file
diff --git a/docs/source/validator.hed2.rst b/docs/source/validator.hed2.rst
new file mode 100644
index 00000000..8d1170d0
--- /dev/null
+++ b/docs/source/validator.hed2.rst
@@ -0,0 +1,9 @@
+hed2
+====
+
+.. toctree::
+ :maxdepth: 8
+
+ validator.hed2.schema
+ validator.hed2.event
+ validator.hed2.parser
\ No newline at end of file
diff --git a/docs/source/validator.hed2.schema.hed2SchemaParser.rst b/docs/source/validator.hed2.schema.hed2SchemaParser.rst
new file mode 100644
index 00000000..71b26067
--- /dev/null
+++ b/docs/source/validator.hed2.schema.hed2SchemaParser.rst
@@ -0,0 +1,5 @@
+hed2SchemaParser
+================
+
+.. js:autoclass:: Hed2SchemaParser
+ :members:
diff --git a/docs/source/validator.hed2.schema.rst b/docs/source/validator.hed2.schema.rst
new file mode 100644
index 00000000..7e969611
--- /dev/null
+++ b/docs/source/validator.hed2.schema.rst
@@ -0,0 +1,8 @@
+schema
+======
+
+.. toctree::
+ :maxdepth: 8
+
+ validator.hed2.schema.schemaAttributes
+ validator.hed2.schema.hed2SchemaParser
\ No newline at end of file
diff --git a/docs/source/validator.hed2.schema.schemaAttributes.rst b/docs/source/validator.hed2.schema.schemaAttributes.rst
new file mode 100644
index 00000000..636ac687
--- /dev/null
+++ b/docs/source/validator.hed2.schema.schemaAttributes.rst
@@ -0,0 +1,5 @@
+schemaAttributes
+================
+
+.. js:autoclass:: SchemaAttributes
+ :members:
\ No newline at end of file
diff --git a/docs/source/validator.parser.main.rst b/docs/source/validator.parser.main.rst
new file mode 100644
index 00000000..2f0fae59
--- /dev/null
+++ b/docs/source/validator.parser.main.rst
@@ -0,0 +1,16 @@
+main
+=========
+
+.. js:autofunction:: substituteCharacters
+
+.. js:autofunction:: countTagGroupParentheses
+
+.. js:autofunction:: isCommaMissingAfterClosingParenthesis
+
+.. js:autofunction:: findDelimiterIssuesInHedString
+
+.. js:autofunction:: validateFullUnparsedHedString
+
+.. js:autofunction:: parseHedString
+
+.. js:autofunction:: parseHedStrings
diff --git a/docs/source/validator.parser.parsedHedGroup.rst b/docs/source/validator.parser.parsedHedGroup.rst
new file mode 100644
index 00000000..218d5efa
--- /dev/null
+++ b/docs/source/validator.parser.parsedHedGroup.rst
@@ -0,0 +1,5 @@
+parsedHedGroup
+==============
+
+.. js:autoclass:: ParsedHedGroup
+ :members:
\ No newline at end of file
diff --git a/docs/source/validator.parser.parsedHedString.rst b/docs/source/validator.parser.parsedHedString.rst
new file mode 100644
index 00000000..1fbfa09a
--- /dev/null
+++ b/docs/source/validator.parser.parsedHedString.rst
@@ -0,0 +1,5 @@
+parsedHedString
+===============
+
+.. js:autoclass:: ParsedHedString
+ :members:
\ No newline at end of file
diff --git a/docs/source/validator.parser.parsedHedSubstring.rst b/docs/source/validator.parser.parsedHedSubstring.rst
new file mode 100644
index 00000000..e2e017e8
--- /dev/null
+++ b/docs/source/validator.parser.parsedHedSubstring.rst
@@ -0,0 +1,5 @@
+parsedHedSubstring
+==================
+
+.. js:autoclass:: ParsedHedSubstring
+ :members:
\ No newline at end of file
diff --git a/docs/source/validator.parser.parsedHedTag.rst b/docs/source/validator.parser.parsedHedTag.rst
new file mode 100644
index 00000000..f6ac6486
--- /dev/null
+++ b/docs/source/validator.parser.parsedHedTag.rst
@@ -0,0 +1,8 @@
+parsedHedTag
+===============
+
+.. js:autoclass:: ParsedHedTag
+ :members:
+
+.. js:autoclass:: ParsedHed3Tag
+ :members:
\ No newline at end of file
diff --git a/docs/source/validator.parser.rst b/docs/source/validator.parser.rst
new file mode 100644
index 00000000..676d7570
--- /dev/null
+++ b/docs/source/validator.parser.rst
@@ -0,0 +1,12 @@
+parser
+======
+
+.. toctree::
+ :maxdepth: 8
+
+ validator.parser.parsedHedTag
+ validator.parser.splitHedString
+ validator.parser.parsedHedString
+ validator.parser.parsedHedSubstring
+ validator.parser.parsedHedGroup
+ validator.parser.main
\ No newline at end of file
diff --git a/docs/source/validator.parser.splitHedString.rst b/docs/source/validator.parser.splitHedString.rst
new file mode 100644
index 00000000..b7fdec82
--- /dev/null
+++ b/docs/source/validator.parser.splitHedString.rst
@@ -0,0 +1,11 @@
+splitHedString
+===============
+
+.. js:autoclass:: HedStringTokenizer
+ :members:
+
+.. js:autofunction:: checkForInvalidCharacters
+
+.. js:autofunction:: createParsedTags
+
+.. js:autofunction:: splitHedString
diff --git a/docs/source/validator.rst b/docs/source/validator.rst
new file mode 100644
index 00000000..e4434167
--- /dev/null
+++ b/docs/source/validator.rst
@@ -0,0 +1,11 @@
+validator
+=========
+
+.. toctree::
+ :maxdepth: 8
+
+ validator.dataset
+ validator.schema
+ validator.event
+ validator.parser
+ validator.hed2
\ No newline at end of file
diff --git a/docs/source/validator.schema.hed3.rst b/docs/source/validator.schema.hed3.rst
new file mode 100644
index 00000000..270170d8
--- /dev/null
+++ b/docs/source/validator.schema.hed3.rst
@@ -0,0 +1,3 @@
+hed3
+====
+Intentionally blank for now
\ No newline at end of file
diff --git a/docs/source/validator.schema.init.rst b/docs/source/validator.schema.init.rst
new file mode 100644
index 00000000..20c41991
--- /dev/null
+++ b/docs/source/validator.schema.init.rst
@@ -0,0 +1,12 @@
+init
+===============
+
+.. js:autofunction:: isHed3Schema
+
+.. js:autofunction:: buildSchemaAttributesObject
+
+.. js:autofunction:: buildSchemaObject
+
+ .. js:autofunction:: init.buildSchema
+
+.. js:autofunction:: buildSchemas
diff --git a/docs/source/validator.schema.parser.rst b/docs/source/validator.schema.parser.rst
new file mode 100644
index 00000000..bf9e57a9
--- /dev/null
+++ b/docs/source/validator.schema.parser.rst
@@ -0,0 +1,5 @@
+parser
+===============
+
+.. js:autoclass:: SchemaParser
+ :members:
diff --git a/docs/source/validator.schema.rst b/docs/source/validator.schema.rst
new file mode 100644
index 00000000..f453677b
--- /dev/null
+++ b/docs/source/validator.schema.rst
@@ -0,0 +1,10 @@
+schema
+======
+
+.. toctree::
+ :maxdepth: 8
+
+ validator.schema.init
+ validator.schema.types
+ validator.schema.parser
+ validator.schema.hed3
\ No newline at end of file
diff --git a/docs/source/validator.schema.types.rst b/docs/source/validator.schema.types.rst
new file mode 100644
index 00000000..a7c0ccb5
--- /dev/null
+++ b/docs/source/validator.schema.types.rst
@@ -0,0 +1,35 @@
+types
+===============
+
+.. js:autoclass:: SchemaEntries
+ :members:
+
+.. js:autoclass:: SchemaEntryManager
+ :members:
+
+.. js:autoclass:: SchemaEntry
+ :members:
+
+.. js:autoclass:: SchemaProperty
+ :members:
+
+.. js:autoclass:: SchemaAttribute
+ :members:
+
+.. js:autoclass:: SchemaEntryWithAttributes
+ :members:
+
+.. js:autoclass:: SchemaUnit
+ :members:
+
+.. js:autoclass:: SchemaUnitClass
+ :members:
+
+.. js:autoclass:: SchemaUnitModifier
+ :members:
+
+.. js:autoclass:: SchemaValueClass
+ :members:
+
+.. js:autoclass:: SchemaTag
+ :members:
diff --git a/readthedocs.yml b/readthedocs.yml
index 88c876e6..4354290b 100644
--- a/readthedocs.yml
+++ b/readthedocs.yml
@@ -11,7 +11,6 @@ build:
nodejs: '18'
jobs:
post_install:
- - pip install sphinx-js
- npm ci
- npm install -g jsdoc
diff --git a/utils/types.js b/utils/types.js
index 58394024..facb7eec 100644
--- a/utils/types.js
+++ b/utils/types.js
@@ -33,4 +33,7 @@ export const MemoizerMixin = (Base) => {
}
}
+/**
+ * Memoizer class
+ */
export class Memoizer extends MemoizerMixin(Object) {}
diff --git a/validator/dataset.js b/validator/dataset.js
index 15285420..05549be9 100644
--- a/validator/dataset.js
+++ b/validator/dataset.js
@@ -110,7 +110,7 @@ export const validateDataset = function (definitions, hedStrings, hedSchemas) {
/**
* Validate a group of HED strings.
*
- * @param {(string|ParsedHedString)[]} parsedHedStrings The dataset's parsed HED strings.
+ * @param {(string[]|ParsedHedString[])} parsedHedStrings The dataset's parsed HED strings.
* @param {Schemas} hedSchemas The HED schema container object.
* @param {Map} definitions The dataset's parsed definitions.
* @param {Object} settings The configuration settings for validation.
diff --git a/validator/event/hed3.js b/validator/event/hed3.js
index 74ca3b6b..a71c01dc 100644
--- a/validator/event/hed3.js
+++ b/validator/event/hed3.js
@@ -12,6 +12,9 @@ import { HedValidator } from './validator'
const tagGroupType = 'tagGroup'
const topLevelTagGroupType = 'topLevelTagGroup'
+/**
+ * Hed3Validator class
+ */
export class Hed3Validator extends HedValidator {
/**
* The parsed definitions.
diff --git a/validator/event/validator.js b/validator/event/validator.js
index e47605ed..652f0894 100644
--- a/validator/event/validator.js
+++ b/validator/event/validator.js
@@ -9,7 +9,9 @@ const requiredType = 'required'
const requireChildType = 'requireChild'
// Validation tests
-
+/**
+ * HedValidator class
+ */
export class HedValidator {
/**
* The parsed HED string to be validated.
diff --git a/validator/hed2/event/hed2Validator.js b/validator/hed2/event/hed2Validator.js
index 770f59f4..e043f888 100644
--- a/validator/hed2/event/hed2Validator.js
+++ b/validator/hed2/event/hed2Validator.js
@@ -6,6 +6,9 @@ const clockTimeUnitClass = 'clockTime'
const dateTimeUnitClass = 'dateTime'
const timeUnitClass = 'time'
+/**
+ * Hed2Validator class
+ */
export class Hed2Validator extends HedValidator {
constructor(parsedString, hedSchemas, options) {
super(parsedString, hedSchemas, options)
diff --git a/validator/hed2/parser/parsedHed2Tag.js b/validator/hed2/parser/parsedHed2Tag.js
index abcca974..08f21cb2 100644
--- a/validator/hed2/parser/parsedHed2Tag.js
+++ b/validator/hed2/parser/parsedHed2Tag.js
@@ -1,6 +1,9 @@
import { replaceTagNameWithPound } from '../../../utils/hedStrings'
import { ParsedHedTag } from '../../parser/parsedHedTag'
+/**
+ * ParsedHedTag class
+ */
export class ParsedHed2Tag extends ParsedHedTag {
/**
* Convert this tag to long form.
diff --git a/validator/hed2/schema/hed2SchemaParser.js b/validator/hed2/schema/hed2SchemaParser.js
index dd05dbb1..bc8cad6c 100644
--- a/validator/hed2/schema/hed2SchemaParser.js
+++ b/validator/hed2/schema/hed2SchemaParser.js
@@ -38,6 +38,9 @@ const unitModifierElement = 'unitModifier'
const lc = (str) => str.toLowerCase()
+/**
+ * Hed2SchemaParser class
+ */
export class Hed2SchemaParser extends SchemaParser {
parse() {
this.populateDictionaries()
diff --git a/validator/parser/parsedHedGroup.js b/validator/parser/parsedHedGroup.js
index c2d9b1e4..acb2da43 100644
--- a/validator/parser/parsedHedGroup.js
+++ b/validator/parser/parsedHedGroup.js
@@ -9,7 +9,7 @@ import { ParsedHedTag } from './parsedHedTag'
/**
* A parsed HED tag group.
*/
-export default class ParsedHedGroup extends ParsedHedSubstring {
+export class ParsedHedGroup extends ParsedHedSubstring {
static SPECIAL_SHORT_TAGS = new Set(['Definition', 'Def', 'Def-expand', 'Onset', 'Offset', 'Inset'])
/**
@@ -518,3 +518,5 @@ export default class ParsedHedGroup extends ParsedHedSubstring {
}
}
}
+
+export default ParsedHedGroup
diff --git a/validator/parser/parsedHedString.js b/validator/parser/parsedHedString.js
index 7db62204..aafb06e0 100644
--- a/validator/parser/parsedHedString.js
+++ b/validator/parser/parsedHedString.js
@@ -4,7 +4,7 @@ import ParsedHedGroup from './parsedHedGroup'
/**
* A parsed HED string.
*/
-export default class ParsedHedString {
+export class ParsedHedString {
/**
* The original HED string.
* @type {string}
@@ -63,3 +63,5 @@ export default class ParsedHedString {
})
}
}
+
+export default ParsedHedString
diff --git a/validator/parser/parsedHedSubstring.js b/validator/parser/parsedHedSubstring.js
index 15913ce9..6400a5a0 100644
--- a/validator/parser/parsedHedSubstring.js
+++ b/validator/parser/parsedHedSubstring.js
@@ -3,7 +3,7 @@ import { Memoizer } from '../../utils/types'
/**
* A parsed HED substring.
*/
-export default class ParsedHedSubstring extends Memoizer {
+export class ParsedHedSubstring extends Memoizer {
/**
* The original pre-parsed version of the HED tag.
* @type {string}
@@ -36,3 +36,5 @@ export default class ParsedHedSubstring extends Memoizer {
return this.originalTag
}
}
+
+export default ParsedHedSubstring
diff --git a/validator/parser/parsedHedTag.js b/validator/parser/parsedHedTag.js
index 1287b1f7..115e76ba 100644
--- a/validator/parser/parsedHedTag.js
+++ b/validator/parser/parsedHedTag.js
@@ -215,6 +215,9 @@ export class ParsedHedTag extends ParsedHedSubstring {
}
}
+/**
+ * A parsed HED3 tag.
+ */
export class ParsedHed3Tag extends ParsedHedTag {
/**
* Convert this tag to long form.
diff --git a/validator/parser/splitHedString.js b/validator/parser/splitHedString.js
index 6dfb6b71..c8216be8 100644
--- a/validator/parser/splitHedString.js
+++ b/validator/parser/splitHedString.js
@@ -51,6 +51,9 @@ class GroupSpec {
}
}
+/**
+ * Class for tokenizing hed strings
+ */
class HedStringTokenizer {
hedString
syntaxIssues
diff --git a/validator/schema/parser.js b/validator/schema/parser.js
index 4a7c5892..61380d98 100644
--- a/validator/schema/parser.js
+++ b/validator/schema/parser.js
@@ -5,6 +5,9 @@ import flattenDeep from 'lodash/flattenDeep'
// Temporary
import * as xpath from '../../utils/xpath'
+/**
+ * SchemaParser class
+ */
export class SchemaParser {
constructor(rootElement) {
this.rootElement = rootElement
diff --git a/validator/schema/types.js b/validator/schema/types.js
index 481bfe05..21f5468e 100644
--- a/validator/schema/types.js
+++ b/validator/schema/types.js
@@ -5,6 +5,9 @@ pluralize.addUncountableRule('hertz')
// Old-style types
+/**
+ * SchemaEntries class
+ */
export class SchemaEntries extends Memoizer {
/**
* The schema's properties.
@@ -165,6 +168,9 @@ export class SchemaEntryManager extends Memoizer {
}
}
+/**
+ * SchemaEntry class
+ */
export class SchemaEntry {
/**
* The name of this schema entry.
@@ -203,6 +209,9 @@ const categoryProperty = 'categoryProperty'
const typeProperty = 'typeProperty'
const roleProperty = 'roleProperty'
+/**
+ * A schema property.
+ */
export class SchemaProperty extends SchemaEntry {
/**
* The type of the property.
@@ -316,6 +325,9 @@ export class SchemaAttribute extends SchemaEntry {
}
}
+/**
+ * SchemaEntryWithAttributes class
+ */
class SchemaEntryWithAttributes extends SchemaEntry {
/**
* The set of boolean attributes this schema entry has.
@@ -412,6 +424,9 @@ class SchemaEntryWithAttributes extends SchemaEntry {
}
}
+/**
+ * SchemaUnit class
+ */
export class SchemaUnit extends SchemaEntryWithAttributes {
/**
* The legal derivatives of this unit.
@@ -461,6 +476,9 @@ export class SchemaUnit extends SchemaEntryWithAttributes {
}
}
+/**
+ * SchemaUnitClass class
+ */
export class SchemaUnitClass extends SchemaEntryWithAttributes {
/**
* The units for this unit class.
@@ -499,6 +517,9 @@ export class SchemaUnitClass extends SchemaEntryWithAttributes {
}
}
+/**
+ * SchemaUnitModifier class
+ */
export class SchemaUnitModifier extends SchemaEntryWithAttributes {
constructor(name, booleanAttributes, valueAttributes) {
super(name, booleanAttributes, valueAttributes)
@@ -513,6 +534,9 @@ export class SchemaUnitModifier extends SchemaEntryWithAttributes {
}
}
+/**
+ * SchemaValueClass class
+ */
export class SchemaValueClass extends SchemaEntryWithAttributes {
constructor(name, booleanAttributes, valueAttributes) {
super(name, booleanAttributes, valueAttributes)