diff --git a/src/variables.jl b/src/variables.jl
index bff48c7d4c369b798bacd83ac00505c30ceb1921..a2c75c6a5443e16c36e1d27e222666d747125cc1 100644
--- a/src/variables.jl
+++ b/src/variables.jl
@@ -32,8 +32,9 @@ symbol_to_func = Dict{Symbol, Function}()
 for (func_symbol, (block_symbol, description)) in all_variables_symbols
     as_string = "    $func_symbol($block_symbol)\n\n$description\n\nThis represents a variable within the sequence. Variables can be set during the construction of a [`BuildingBlock`](@ref) or used to create constraints after the fact."
     new_func = @eval begin
-        $as_string
         function $func_symbol end
+        @doc $as_string $func_symbol
+        $func_symbol
     end
     symbol_to_func[func_symbol] = new_func
 end