# Documenter.jl: @autodocs for specific source files

**URL:** <https://discourse.julialang.org/t/documenter-jl-autodocs-for-specific-source-files/8784>\
**Category:** General Usage\
**Tags:** documenter\
**Created:** [February 2, 2018, 5:37pm UTC](https://discourse.julialang.org/t/documenter-jl-autodocs-for-specific-source-files/8784 "2018-02-02T17:37:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [February 2, 2018, 5:37pm UTC](https://discourse.julialang.org/t/documenter-jl-autodocs-for-specific-source-files/8784/1 "2018-02-02T17:37:19Z")

</div>

From Documenter.jl’s documentation of [`@autodocs`](https://juliadocs.github.io/Documenter.jl/stable/man/syntax/#@autodocs-block-1):

> […], a **Pages** vector may be included in @autodocs to filter  
> docstrings based on the source file in which they are defined:
> 
> ````
> ```@autodocs
> Modules = [Foo]
> Pages = ["a.jl", "b.jl"]
> ```
> 
> ````

However, it also says

> Note that page matching is done using the end of the provided strings  
> and so a.jl will be matched by **any source file that ends in a.jl** , i.e.  
> src/a.jl or src/foo/a.jl.

How can I restrict the `@autodocs` block to specific source files?

My package’s source code is organized as

```
src/
    foo/a.jl
    foo/b.jl
    ignore/a.jl
    ignore/b.jl
    other.jl

```

How to make the `@autodocs` block only consider files `src/foo/a.jl` and `src/foo/b.jl` but not `src/ignore/a.jl` and `src/ignore/b.jl`?

Unfortunately, `Pages = ["foo/a.jl", "foo/b.jl"]` didn’t do it for me.

Thanks in advance.

x-ref: [https://stackoverflow.com/questions/48587995/documenter-jl-autodocs-for-specific-source-files](https://stackoverflow.com/questions/48587995/documenter-jl-autodocs-for-specific-source-files)  
x-ref: [https://github.com/JuliaDocs/Documenter.jl/issues/630](https://github.com/JuliaDocs/Documenter.jl/issues/630)

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [February 2, 2018, 7:15pm UTC](https://discourse.julialang.org/t/documenter-jl-autodocs-for-specific-source-files/8784/2 "2018-02-02T19:15:47Z")

</div>

Found [https://github.com/JuliaDocs/Documenter.jl/blob/master/src/Expanders.jl#L353](https://github.com/JuliaDocs/Documenter.jl/blob/master/src/Expanders.jl#L353),

```julia
for p in pages
    if endswith(path, p)

```

This should at least be true for `Pages = ["foo/a.jl", "foo/b.jl"]`. Still, it doesn’t work for me.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [February 5, 2018, 12:52pm UTC](https://discourse.julialang.org/t/documenter-jl-autodocs-for-specific-source-files/8784/3 "2018-02-05T12:52:13Z")

</div>

Turns out that this is a Windows issue due to absence of normalization of path separators (see linked github issue).

On Linux `Pages = ["foo/a.jl", "foo/b.jl"]` should work.

On Windows `Pages = ["foo\\a.jl", "foo\\b.jl"]` should work.
