Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Comment thread
arnoox marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<document source="<source>">
<target anonymous="" ids="IMPL_1" refid="IMPL_1">
<Need classes="need need-impl" ids="IMPL_1" refid="IMPL_1">
27 changes: 27 additions & 0 deletions tests/doc_test/cs_basic/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "source-tracing-demo"
copyright = "2025, useblocks"
author = "useblocks"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ["sphinx_needs", "sphinx_codelinks"]

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

src_trace_config_from_toml = "src_trace.toml"

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "alabaster"
html_static_path = ["_static"]
7 changes: 7 additions & 0 deletions tests/doc_test/cs_basic/dummy_src.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using System;

// @ title here, IMPL_1, impl
void SingleLineExample()
{
Console.WriteLine("Single-line comment example");
}
2 changes: 2 additions & 0 deletions tests/doc_test/cs_basic/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. src-trace::
:project: src
5 changes: 5 additions & 0 deletions tests/doc_test/cs_basic/src_trace.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[codelinks.projects.src]
remote_url_pattern = "https://github.com/useblocks/sphinx-codelinks/blob/{commit}/{path}#L{line}"

[codelinks.projects.src.source_discover]
comment_type = "cs"
4 changes: 4 additions & 0 deletions tests/test_src_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ def test_src_tracing_config_positive(make_app: Callable[..., SphinxTestApp], tmp
Path("doc_test") / "id_required",
Path("doc_test") / "id_required",
),
(
Path("doc_test") / "cs_basic",
Path("doc_test") / "cs_basic",
),
],
)
def test_build_html(
Expand Down
Loading