diff --git a/snakedoc/smk.py b/snakedoc/smk.py index ae5204c..502b644 100644 --- a/snakedoc/smk.py +++ b/snakedoc/smk.py @@ -149,7 +149,8 @@ def transform_content(self, contentnode: addnodes.desc_content) -> None: node[1][0] += default def handle_signature(self, sig, signode): - signode.insert(1, addnodes.desc_type(text=f"{self.rule_type.value.capitalize()} ")) + signode.insert(1, addnodes.desc_type(text=f"{self.rule_type.value.capitalize()}")) + signode += addnodes.desc_sig_space() signode += addnodes.desc_name(text=sig, source=self.options.get("source", "")) return sig diff --git a/tests/test_regressions/test_build.yml b/tests/test_regressions/test_build.yml index 5d64487..7dd8ffc 100644 --- a/tests/test_regressions/test_build.yml +++ b/tests/test_regressions/test_build.yml @@ -6,54 +6,55 @@ index: "\n \n\n
\n
¶\n
\n
\n
\n

Handwritten docs

\n
\n
\nRule handwritten
\n

This\ - \ is a handwritten docstring.

\n
\n
Input:
\n

a.txt

\n\ -
\n
Output:
\n

b.txt

\n
\n
Params:
\n
    \n
  • c\ - \ – set c

  • \n\ -
  • d – set d

  • \n
\n
\n
Conda:
\n
channels:\n  \nRule handwritten¶\n

This is a handwritten docstring.

\n
\n
Input:
\n

a.txt

\n
\n
Output:
\n

b.txt

\n
\n
Params:
\n
    \n
  • c – set c

  • \n
  • d – set d

  • \n\ +
\n
\n
Conda:
\n\ +
channels:\n  - conda-forge\n\
+  dependencies:\n  - pip:\n    - conda-forge\ndependencies:\n  - pip:\n    - test1\n    - test2\n
\n\ -
\n
\n
Resources:
\n\ -

mem_mb – 2

\n
\n
Config:
\n

handwritten.a – A dummy config parameter used in this rule

\n\ -
\n
\n
\n\n
\n
\n
\n
\n
\nCheckpoint hw_checkpoint
\n

This\ - \ is a handwritten docstring for a checkpoint.

\n
\n
Input:
\n\ -

a.txt

\n
\n
Output:
\n

b.txt

\n
\n\ -
\n
\n\n
\n
\n

Autodoc

\n
\n
\nRule alltest1\n - test2\n\ +
\n
\n\n
Resources:
\n

mem_mb – 2

\n
\n\ +
Config:
\n

handwritten.a – A dummy config parameter used in\ + \ this rule

\n
\n\n\n\n
\n

\n
\n
\n
\nCheckpoint hw_checkpoint
\n

This is a handwritten docstring for a checkpoint.

\n\ +
\n
Input:
\n

a.txt

\n
\n
Output:
\n

b.txt

\n\ +
\n
\n
\n\n\n
\n

Autodoc

\n\ +
\n
\nRule all[source]
\n\
\n\n
\n

\n\
\n
\n
\nRule basic[source]
\n\ + >\nRule basic[source]\n\

Here is some documentation.

\n
\n
Input:
\n

A\ \ file

\n
\n
Output:
\n\ @@ -75,8 +76,9 @@ index: "\n \n\n
\n
numpy\n
\n
\n
\n\
\n\n\n
\n

\n\
\n
\n
\nRule follows_basic\nRule follows_basic[source]
\n

Docs rhymes with socks…

\n
\n \n\n
\n
15

\n\

\n\n
\n
\n\n\n
\n

\n
\n
\n
\nRule also_follows_basic\nRule also_follows_basic[source]
\n

Docs rhymes with fox…

\n
\n\ @@ -102,9 +104,9 @@ index: "\n \n\n
\n
9.1

\n\

\n\n
\n
\n\n\n
\n

\n
\n
\n
\nCheckpoint gen_random\nCheckpoint gen_random[source]
\n

Generates a random number (between 1 and 3) of empty files.

\n\ @@ -113,15 +115,16 @@ index: "\n \n\n
\n
val1

\n\

\n
\n
\n\n\n
\n

\n
\n
\n
\nRule the_end[source]
\n
\n\ - \n
\n

\n
\n
\n
\n\ - Rule basic_google_style\nRule the_end[source]
\n
\n\n
\n
\n
\n
\n
\nRule basic_google_style[source]
\n

This is a basic Snakemake rule with Google style docstrings.

\n\ @@ -147,9 +150,9 @@ index: "\n \n\n
\n

\n
\n

We can also autodoc single\ \ files.

\n

… And single rules

\n
\n\nRule\ - \ other\nRule other[source]¶\n\

This rule lies within another snakemake file. Looks familiar though!

\n\ @@ -159,15 +162,15 @@ index: "\n \n\n
\n

an output file

\n
\n
\n
\n\n
\n\

\n
\n

… or a list of rules

\n
\n
\nRule other2Rule other2[source]
\n\

This is other2…

\n
\n\n
\n

\n
\n
\n
\nRule other3\nRule other3[source]
\n\

This is other3…

\n
\n\n
\n