Skip to content

Commit

Permalink
Add external refs in acquisition docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lochhh committed Oct 17, 2024
1 parent 5b456b2 commit 31a7187
Showing 1 changed file with 150 additions and 53 deletions.
203 changes: 150 additions & 53 deletions src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,56 +73,25 @@ def get_current_release_tag():
"sphinx_csharp",
]

# Configure Breathe
breathe_projects = {
"aeon_acquisition_xml": "xml",
}
breathe_projects_source = {
"aeon_acquisition": ("../aeon_acquisition/src/Aeon.Acquisition/", ["AeonAudio.cs"]),
}
breathe_default_project = "aeon_acquisition_xml"
breathe_show_define_initializer = True
breathe_show_enumvalue_initializer = True
breathe_default_members = ("members", "undoc-members", "protected-members")

# Configure C# domain
sphinx_csharp_multi_language = True
sphinx_csharp_test_links = False

# Configure myst parser to enable cool markdown features
# See https://sphinx-design.readthedocs.io
myst_enable_extensions = [
"colon_fence",
"linkify",
"deflist",
"attrs_inline",
]

# Automatically add anchors to markdown headings
myst_heading_anchors = 3

# Set the Markdown format to myst
myst_render_markdown_format = "myst"

# Disable notebook execution
nb_execution_mode = "off"

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

autosummary_generate = True
autodoc_default_options = {
"members": True,
"inherited-members": True,
"show-inheritance": True,
"undoc-members": True,
}

# 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 = ["_templates"]

# linkcheck will skip checking these URLs entirely
linkcheck_ignore = [
r"https://wiki\.ucl\.ac\.uk/.*", # This is the UCL internal wiki
]
# linkcheck will treat redirections from these source URI:canonical URI
# mappings as "working".
linkcheck_allowed_redirects = {
r"https://doi\.org/10\.5281/zenodo\..*": r"https://zenodo\.org/records/.*",
r"https://zenodo\.org/doi/.*": r"https://zenodo\.org/records/.*",
}

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand Down Expand Up @@ -164,20 +133,136 @@ def get_current_release_tag():
"css/custom.css",
]

# linkcheck will skip checking these URLs entirely
linkcheck_ignore = [
r"https://wiki\.ucl\.ac\.uk/.*", # This is the UCL internal wiki
r"http://SubjectExpressionBuilder.Name", # Broken URL
]
# -- Extensions configuration ---------------------------------------------------

# linkcheck will treat redirections from these source URI:canonical URI
# mappings as "working".
linkcheck_allowed_redirects = {
r"https://doi\.org/10\.5281/zenodo\..*": r"https://zenodo\.org/records/.*",
r"https://zenodo\.org/doi/.*": r"https://zenodo\.org/records/.*",
r"https://learn.microsoft.com/dotnet/api/.*": r"https://learn.microsoft.com/en-us/dotnet/api/.*",
# Configure Breathe
breathe_projects = {
"aeon_acquisition_xml": "xml",
}
breathe_default_project = "aeon_acquisition_xml"
breathe_show_define_initializer = True
breathe_show_enumvalue_initializer = True
# breathe_default_members = ("members", "undoc-members", "protected-members")

# Configure C# domain
sphinx_csharp_multi_language = True
sphinx_csharp_test_links = False # This will be handled by linkcheck
sphinx_csharp_ext_search_pages = {
"bonsai": ("https://bonsai-rx.org/docs/api/%s",),
"bonsai-sleap": ("https://bonsai-rx.org/sleap/api/Bonsai.Sleap.%s",),
"harp": ("https://harp-tech.org/api/%s",),
"mathdotnet": ("https://numerics.mathdotnet.com/api/%s.htm",),
"msdn": ("https://learn.microsoft.com/en-us/dotnet/api/%s",),
"mysqlconnector": ("https://mysqlconnector.net/api/%s",),
"opencv.net": ("https://horizongir.github.io/opencv.net/api/%s",),
"reactive": ("https://horizongir.github.io/reactive/api/%s",),
}
sphinx_csharp_ext_type_map = {
"bonsai": {
"Bonsai": ["Combinator", "INamedElement", "Source"],
"Bonsai.Audio": ["AudioCapture"],
"Bonsai.Design": ["DialogTypeVisualizer"],
"Bonsai.Expressions": [
"FormatBuilder",
"SingleArgumentExpressionBuilder",
"SubjectBuilder",
"TypeMapping",
"UnitBuilder",
],
"Bonsai.Vision": ["ConnectedComponent", "ConnectedComponentCollection"],
},
"bonsai-sleap": {
"": ["Pose", "PoseCollection", "PoseIdentity", "PoseIdentityCollection"],
},
"harp": {
"Bonsai.Harp": ["HarpMessage", "Timestamped"],
},
"mathdotnet": {
"MathNet.Numerics": ["IInterpolation"],
},
"msdn": {
"System": [
"Action",
"Attribute",
"DateTime",
"Exception",
"Func",
"IObservable",
"IObserver",
"IServiceProvider",
"TimeSpan",
"Type",
],
"System.Collections": ["IEnumerator"],
"System.Collections.Generic": ["IDictionary", "List"],
"System.Collections.ObjectModel": ["KeyedCollection"],
"System.ComponentModel": [
"CustomTypeDescriptor",
"ExpandableObjectConverter",
"IComponent",
"IContainer",
"ICustomTypeDescriptor",
"ISite",
"ITypeDescriptorContext",
"PropertyDescriptor",
"PropertyDescriptorCollection",
"StringConverter",
"TypeDescriptionProvider",
],
"System.ComponentModel.TypeConverter": ["StandardValuesCollection"],
"System.Globalization": ["CultureInfo"],
"System.Linq.Expressions": ["Expression"],
"System.Windows.Forms": ["UserControl"],
},
"mysqlconnector": {
"": ["MySqlConnection", "MySqlDataReader"],
},
"opencv.net": {
"OpenCV.Net": ["IplImage", "Mat", "Point", "Point2f"],
},
"reactive": {
"System.Reactive": ["Unit"],
"System.Reactive.Subjects": ["ISubject"],
},
}
sphinx_csharp_external_type_rename = {
"Func": "Func-1",
"IInterpolation": "Interpolation/IInterpolation",
"IDictionary": "IDictionary-2",
"IObservable": "IObservable-1",
"IObserver": "IObserver-1",
"ISubject": "ISubject-1",
"KeyedCollection": "KeyedCollection-2",
"List": "List-1",
"MySqlConnection": "mysqlconnector/mysqlconnectiontype",
"MySqlDataReader": "mysqlconnector/mysqldatareadertype",
"Source": "Source-1",
}
# Do not create cross references for these standard/build-in/undocumented types
sphinx_csharp_ignore_xref = [
"Bonsai.Pylon.PylonCapture",
"Bonsai.Spinnaker.SpinnakerCapture",
"IGroupedObservable",
"IManagedCamera",
"IRepository",
"T",
"TMetadata",
"TRecord",
"TSource",
"TState",
]

# Configure myst parser to enable cool markdown features
# See https://sphinx-design.readthedocs.io
myst_enable_extensions = [
"colon_fence",
"linkify",
"deflist",
"attrs_inline",
]
# Automatically add anchors to markdown headings
myst_heading_anchors = 3
myst_render_markdown_format = "myst"
myst_url_schemes = {
"http": None,
"https": None,
Expand All @@ -194,3 +279,15 @@ def get_current_release_tag():
"python-pep": "https://peps.python.org/pep-{{path}}",
"niu-howto": "https://howto.neuroinformatics.dev/programming/SSH-SWC-cluster#{{fragment}}",
}

# Disable notebook execution
nb_execution_mode = "off"

# Configure autosummary and autodoc
autosummary_generate = True
autodoc_default_options = {
"members": True,
"inherited-members": True,
"show-inheritance": True,
"undoc-members": True,
}

0 comments on commit 31a7187

Please sign in to comment.