# Incrementally creating docstrings

**URL:** https://discourse.julialang.org/t/incrementally-creating-docstrings/122115
**Category:** General Usage
**Tags:** documentation, docstring
**Created:** [November 1, 2024, 7:56am UTC](https://discourse.julialang.org/t/incrementally-creating-docstrings/122115 "2024-11-01T07:56:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![GHTaarn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ghtaarn/32/216007_2.png) [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)
#### Post date: [November 1, 2024, 7:56am UTC](https://discourse.julialang.org/t/incrementally-creating-docstrings/122115/1 "2024-11-01T07:56:35Z")

</div>

I am in a situation where I would like to construct a docstring piece by piece rather than doing it in just one statement. I tried:

```julia
module A
varname = 0
@doc "Apple" varname
@doc "$(@doc varname) Orange" varname
end

```

but this produces a warning about overwriting the docstring.  
Is there a more elegant way to do this?  
My best idea until now is some thing like:

```julia
module A
varname = 0
docstring_for_varname = "Apple"
docstring_for_varname *= " Orange"
@doc docstring_for_varname varname
end

```
