├── assets ├── html │ ├── style.css │ ├── documenter.js │ ├── search.js │ └── documenter.css ├── mkdocs │ ├── Documenter.css │ └── mathjaxhelper.js └── latex │ └── documenter.sty ├── .codecov.yml ├── test ├── REQUIRE ├── examples │ ├── src │ │ ├── hidden │ │ │ ├── y.md │ │ │ ├── z.md │ │ │ ├── x.md │ │ │ └── index.md │ │ ├── man │ │ │ ├── data.csv │ │ │ └── tutorial.md │ │ ├── assets │ │ │ ├── custom.js │ │ │ ├── search.js │ │ │ └── custom.css │ │ ├── hidden.md │ │ ├── lib │ │ │ ├── crlf.md │ │ │ ├── autodocs.md │ │ │ └── functions.md │ │ └── index.md │ ├── pages │ │ ├── b.jl │ │ ├── c.jl │ │ ├── e.jl │ │ ├── a.jl │ │ └── d.jl │ ├── mkdocs.yml │ ├── make.jl │ └── tests.jl ├── missingdocs │ ├── src │ │ ├── none │ │ │ └── index.md │ │ └── exports │ │ │ └── index.md │ └── make.jl ├── errors │ ├── deploydocs.jl │ ├── make.jl │ └── src │ │ └── index.md ├── coverage.jl ├── runtests.jl ├── navnode.jl ├── formats │ ├── markdown.jl │ └── latex.jl ├── utilities.jl ├── mdflatten.jl ├── docsystem.jl └── dom.jl ├── docs ├── src │ ├── man │ │ ├── internals.md │ │ ├── examples.md │ │ ├── contributing.md │ │ ├── latex.md │ │ ├── doctests.md │ │ ├── hosting.md │ │ ├── guide.md │ │ └── syntax.md │ ├── assets │ │ └── logo.png │ ├── lib │ │ ├── internals │ │ │ ├── anchors.md │ │ │ ├── builder.md │ │ │ ├── dom.md │ │ │ ├── formats.md │ │ │ ├── walkers.md │ │ │ ├── docchecks.md │ │ │ ├── docsystem.md │ │ │ ├── documents.md │ │ │ ├── expanders.md │ │ │ ├── generator.md │ │ │ ├── selectors.md │ │ │ ├── utilities.md │ │ │ ├── mdflatten.md │ │ │ ├── cross-references.md │ │ │ └── writers.md │ │ ├── internals.md │ │ └── public.md │ └── index.md └── make.jl ├── REQUIRE ├── .gitignore ├── .travis.yml ├── appveyor.yml ├── src ├── Deps.jl ├── Formats.jl ├── Writers │ ├── Writers.jl │ └── MarkdownWriter.jl ├── Walkers.jl ├── Generator.jl ├── Utilities │ ├── MDFlatten.jl │ └── DOM.jl ├── Anchors.jl ├── Selectors.jl ├── Builder.jl ├── CrossReferences.jl ├── DocSystem.jl └── Documents.jl ├── LICENSE.md └── README.md /assets/html/style.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.codecov.yml: -------------------------------------------------------------------------------- 1 | comment: false 2 | -------------------------------------------------------------------------------- /test/REQUIRE: -------------------------------------------------------------------------------- 1 | BaseTestNext 2 | -------------------------------------------------------------------------------- /test/examples/src/hidden/y.md: -------------------------------------------------------------------------------- 1 | # Hidden 2 2 | -------------------------------------------------------------------------------- /test/examples/src/hidden/z.md: -------------------------------------------------------------------------------- 1 | # Hidden 3 2 | -------------------------------------------------------------------------------- /docs/src/man/internals.md: -------------------------------------------------------------------------------- 1 | # Package Internals 2 | 3 | -------------------------------------------------------------------------------- /test/examples/src/man/data.csv: -------------------------------------------------------------------------------- 1 | csv,data,file 2 | 1,2,3 3 | -------------------------------------------------------------------------------- /test/examples/src/assets/custom.js: -------------------------------------------------------------------------------- 1 | // custom javascript 2 | -------------------------------------------------------------------------------- /REQUIRE: -------------------------------------------------------------------------------- 1 | julia 0.4 2 | Compat 0.8 3 | DocStringExtensions 0.2 4 | -------------------------------------------------------------------------------- /test/examples/src/hidden.md: -------------------------------------------------------------------------------- 1 | # Hidden (toplevel) 2 | 3 | ## Section 4 | -------------------------------------------------------------------------------- /test/examples/src/assets/search.js: -------------------------------------------------------------------------------- 1 | // overrides Documenter's search.js 2 | -------------------------------------------------------------------------------- /test/missingdocs/src/none/index.md: -------------------------------------------------------------------------------- 1 | # MissingDocs None 2 | 3 | ```@docs 4 | ``` 5 | -------------------------------------------------------------------------------- /test/examples/src/hidden/x.md: -------------------------------------------------------------------------------- 1 | # Hidden 1 2 | 3 | ## First heading 4 | ## Second heading 5 | -------------------------------------------------------------------------------- /docs/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dpsanders/Documenter.jl/master/docs/src/assets/logo.png -------------------------------------------------------------------------------- /docs/src/lib/internals/anchors.md: -------------------------------------------------------------------------------- 1 | # Anchors 2 | 3 | ```@autodocs 4 | Modules = [Documenter.Anchors] 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/src/lib/internals/builder.md: -------------------------------------------------------------------------------- 1 | # Builder 2 | 3 | ```@autodocs 4 | Modules = [Documenter.Builder] 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/src/lib/internals/dom.md: -------------------------------------------------------------------------------- 1 | # DOM 2 | 3 | ```@autodocs 4 | Modules = [Documenter.Utilities.DOM] 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/src/lib/internals/formats.md: -------------------------------------------------------------------------------- 1 | # Formats 2 | 3 | ```@autodocs 4 | Modules = [Documenter.Formats] 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/src/lib/internals/walkers.md: -------------------------------------------------------------------------------- 1 | # Walkers 2 | 3 | ```@autodocs 4 | Modules = [Documenter.Walkers] 5 | ``` 6 | -------------------------------------------------------------------------------- /test/missingdocs/src/exports/index.md: -------------------------------------------------------------------------------- 1 | # MissingDocs Exports 2 | 3 | ```@docs 4 | Main.MissingDocs.f 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/src/lib/internals/docchecks.md: -------------------------------------------------------------------------------- 1 | # DocChecks 2 | 3 | ```@autodocs 4 | Modules = [Documenter.DocChecks] 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/src/lib/internals/docsystem.md: -------------------------------------------------------------------------------- 1 | # DocSystem 2 | 3 | ```@autodocs 4 | Modules = [Documenter.DocSystem] 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/src/lib/internals/documents.md: -------------------------------------------------------------------------------- 1 | # Documents 2 | 3 | ```@autodocs 4 | Modules = [Documenter.Documents] 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/src/lib/internals/expanders.md: -------------------------------------------------------------------------------- 1 | # Expanders 2 | 3 | ```@autodocs 4 | Modules = [Documenter.Expanders] 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/src/lib/internals/generator.md: -------------------------------------------------------------------------------- 1 | # Generator 2 | 3 | ```@autodocs 4 | Modules = [Documenter.Generator] 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/src/lib/internals/selectors.md: -------------------------------------------------------------------------------- 1 | # Selectors 2 | 3 | ```@autodocs 4 | Modules = [Documenter.Selectors] 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/src/lib/internals/utilities.md: -------------------------------------------------------------------------------- 1 | # Utilities 2 | 3 | ```@autodocs 4 | Modules = [Documenter.Utilities] 5 | ``` 6 | -------------------------------------------------------------------------------- /test/examples/src/assets/custom.css: -------------------------------------------------------------------------------- 1 | /* custom.css */ 2 | 3 | center.raw-html-block { 4 | color: red; 5 | } 6 | -------------------------------------------------------------------------------- /docs/src/lib/internals/mdflatten.md: -------------------------------------------------------------------------------- 1 | # MDFlatten 2 | 3 | ```@autodocs 4 | Modules = [Documenter.Utilities.MDFlatten] 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/src/lib/internals/cross-references.md: -------------------------------------------------------------------------------- 1 | # CrossReferences 2 | 3 | ```@autodocs 4 | Modules = [Documenter.CrossReferences] 5 | ``` 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.jl.cov 2 | *.jl.*.cov 3 | *.jl.mem 4 | 5 | test/examples/builds/ 6 | test/missingdocs/build/ 7 | test/errors/build/ 8 | docs/build/ 9 | docs/site/ 10 | -------------------------------------------------------------------------------- /test/examples/src/lib/crlf.md: -------------------------------------------------------------------------------- 1 | !!! warning 2 | 3 | This file contains windows line endings. Do not edit. 4 | 5 | ```jldoctest 6 | a = 1 7 | b = 2 8 | a + b 9 | 10 | # output 11 | 12 | 3 13 | ``` 14 | -------------------------------------------------------------------------------- /test/errors/deploydocs.jl: -------------------------------------------------------------------------------- 1 | @test_throws ErrorException deploydocs( 2 | repo = "github.com/JuliaDocs/Documenter.jl.git", 3 | julia = 0.5, # must be a string 4 | target = "build", 5 | deps = nothing, 6 | make = nothing, 7 | ) 8 | -------------------------------------------------------------------------------- /docs/src/lib/internals/writers.md: -------------------------------------------------------------------------------- 1 | # Writers 2 | 3 | ```@autodocs 4 | Modules = [ 5 | Documenter.Writers, 6 | Documenter.Writers.MarkdownWriter, 7 | Documenter.Writers.HTMLWriter, 8 | Documenter.Writers.LaTeXWriter, 9 | ] 10 | ``` 11 | -------------------------------------------------------------------------------- /test/examples/src/hidden/index.md: -------------------------------------------------------------------------------- 1 | # Hidden pages 2 | 3 | Pages can be hidden with the [`hide`](@ref) function. 4 | 5 | ## List of hidden pages 6 | 7 | - [Hidden page 1](x.md) 8 | - [Hidden page 2](y.md) 9 | - [Hidden page 3](z.md) 10 | 11 | ## Docs for `hide` 12 | 13 | ```@docs 14 | hide 15 | ``` 16 | -------------------------------------------------------------------------------- /test/examples/pages/b.jl: -------------------------------------------------------------------------------- 1 | 2 | """ 3 | `f` from page `b.jl`. 4 | 5 | Links: 6 | 7 | - [`ccall`](@ref) 8 | - [`while`](@ref) 9 | - [`@time`](@ref) 10 | - [`T`](@ref) 11 | - [`f`](@ref) 12 | - [`f(::Any)`](@ref) 13 | - [`f(::Any, ::Any)`](@ref) 14 | - [`f(::Any, ::Any, ::Any)`](@ref) 15 | 16 | """ 17 | f(x, y) = x + y 18 | -------------------------------------------------------------------------------- /test/examples/pages/c.jl: -------------------------------------------------------------------------------- 1 | 2 | """ 3 | `f` from page `c.jl`. 4 | 5 | Links: 6 | 7 | - [`ccall`](@ref) 8 | - [`while`](@ref) 9 | - [`@time`](@ref) 10 | - [`T`](@ref) 11 | - [`f`](@ref) 12 | - [`f(::Any)`](@ref) 13 | - [`f(::Any, ::Any)`](@ref) 14 | - [`f(::Any, ::Any, ::Any)`](@ref) 15 | 16 | """ 17 | f(x, y, z) = x + y + z 18 | -------------------------------------------------------------------------------- /test/errors/make.jl: -------------------------------------------------------------------------------- 1 | module ErrorsModule 2 | 3 | """ 4 | ```jldoctest 5 | julia> a = 1 6 | 2 7 | 8 | ``` 9 | 10 | ```jldoctest 11 | ``` 12 | """ 13 | func(x) = x 14 | 15 | end 16 | 17 | using Documenter 18 | 19 | makedocs(modules = [ErrorsModule]) 20 | 21 | @test_throws ErrorException makedocs(modules = [ErrorsModule], strict = true) 22 | -------------------------------------------------------------------------------- /test/coverage.jl: -------------------------------------------------------------------------------- 1 | # Only run coverage from linux nightly build on travis. 2 | get(ENV, "TRAVIS_OS_NAME", "") == "linux" || exit() 3 | get(ENV, "TRAVIS_JULIA_VERSION", "") == "nightly" || exit() 4 | 5 | Pkg.add("Coverage") 6 | using Coverage 7 | 8 | cd(joinpath(dirname(@__FILE__), "..")) do 9 | Codecov.submit(Codecov.process_folder()) 10 | end 11 | -------------------------------------------------------------------------------- /test/examples/pages/e.jl: -------------------------------------------------------------------------------- 1 | module E 2 | 3 | export f_1, f_2, f_3 4 | 5 | "f_1" 6 | f_1(x) = x 7 | 8 | "f_2" 9 | f_2(x) = x 10 | 11 | "f_3" 12 | f_3(x) = x 13 | 14 | 15 | "g_1" 16 | g_1(x) = x 17 | 18 | "g_2" 19 | g_2(x) = x 20 | 21 | "g_3" 22 | g_3(x) = x 23 | 24 | export T_1 25 | 26 | "T_1" 27 | type T_1 end 28 | 29 | "T_2" 30 | type T_2 end 31 | 32 | end 33 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: julia 2 | 3 | os: 4 | - linux 5 | - osx 6 | 7 | julia: 8 | - 0.4 9 | - 0.5 10 | - nightly 11 | 12 | notifications: 13 | email: false 14 | 15 | # https://github.com/travis-ci/travis-ci/issues/4942 workaround 16 | git: 17 | depth: 99999 18 | 19 | after_success: 20 | - julia -e 'cd(Pkg.dir("Documenter", "test")); include("coverage.jl")' 21 | -------------------------------------------------------------------------------- /assets/mkdocs/Documenter.css: -------------------------------------------------------------------------------- 1 | div.wy-menu-vertical ul.current li.toctree-l3 a { 2 | font-weight: bold; 3 | } 4 | 5 | a.documenter-source { 6 | float: right; 7 | } 8 | 9 | .documenter-methodtable pre { 10 | margin-left: 0px; 11 | margin-right: 0px; 12 | margin-top: 0px; 13 | padding: 0px; 14 | } 15 | 16 | .documenter-methodtable pre.documenter-inline { 17 | display: inline; 18 | } 19 | -------------------------------------------------------------------------------- /test/examples/pages/a.jl: -------------------------------------------------------------------------------- 1 | 2 | """ 3 | `f` from page `a.jl`. 4 | 5 | Links: 6 | 7 | - [`ccall`](@ref) 8 | - [`while`](@ref) 9 | - [`@time(x)`](@ref) 10 | - [`T(x)`](@ref) 11 | - [`T(x, y)`](@ref) 12 | - [`f(::Integer)`](@ref) 13 | - [`f(::Any)`](@ref) 14 | - [`f(::Any, ::Any)`](@ref) 15 | - [`f(x, y, z)`](@ref) 16 | 17 | [^footnote]: 18 | 19 | Footnote contents. [^footnote] 20 | 21 | """ 22 | f(x) = x 23 | -------------------------------------------------------------------------------- /docs/src/lib/internals.md: -------------------------------------------------------------------------------- 1 | # Internal Documentation 2 | 3 | This page lists all the documented internals of the `Documenter` module and submodules. 4 | 5 | ## Contents 6 | 7 | ```@contents 8 | Pages = [joinpath("internals", f) for f in readdir("internals")] 9 | ``` 10 | 11 | ## Index 12 | 13 | A list of all internal documentation sorted by module. 14 | 15 | ```@index 16 | Pages = [joinpath("internals", f) for f in readdir("internals")] 17 | ``` 18 | -------------------------------------------------------------------------------- /test/missingdocs/make.jl: -------------------------------------------------------------------------------- 1 | module MissingDocs 2 | export f 3 | 4 | "exported" 5 | f(x) = x 6 | 7 | "unexported" 8 | g(x) = x 9 | end 10 | 11 | using Documenter 12 | 13 | for sym in [:none, :exports] 14 | makedocs( 15 | root = dirname(@__FILE__), 16 | source = joinpath("src", string(sym)), 17 | build = joinpath("build", string(sym)), 18 | modules = MissingDocs, 19 | checkdocs = sym, 20 | format = :html, 21 | sitename = "MissingDocs Checks", 22 | ) 23 | end 24 | -------------------------------------------------------------------------------- /docs/src/lib/public.md: -------------------------------------------------------------------------------- 1 | # Public Documentation 2 | 3 | Documentation for `Documenter.jl`'s public interface. 4 | 5 | See [Internal Documentation](@ref) for internal package docs covering all submodules. 6 | 7 | ## Contents 8 | 9 | ```@contents 10 | Pages = ["public.md"] 11 | ``` 12 | 13 | ## Index 14 | 15 | ```@index 16 | Pages = ["public.md"] 17 | ``` 18 | 19 | ## Public Interface 20 | 21 | ```@docs 22 | Documenter 23 | makedocs 24 | hide 25 | deploydocs 26 | Documenter.generate 27 | Travis 28 | Travis.genkeys 29 | Deps 30 | Deps.pip 31 | ``` 32 | -------------------------------------------------------------------------------- /assets/mkdocs/mathjaxhelper.js: -------------------------------------------------------------------------------- 1 | MathJax.Hub.Config({ 2 | "tex2jax": { 3 | inlineMath: [['$','$'], ['\\(','\\)']], 4 | processEscapes: true 5 | } 6 | }); 7 | MathJax.Hub.Config({ 8 | config: ["MMLorHTML.js"], 9 | jax: [ 10 | "input/TeX", 11 | "output/HTML-CSS", 12 | "output/NativeMML" 13 | ], 14 | extensions: [ 15 | "MathMenu.js", 16 | "MathZoom.js", 17 | "TeX/AMSmath.js", 18 | "TeX/AMSsymbols.js", 19 | "TeX/autobold.js", 20 | "TeX/autoload-all.js" 21 | ] 22 | }); 23 | MathJax.Hub.Config({ 24 | TeX: { equationNumbers: { autoNumber: "AMS" } } 25 | }); 26 | -------------------------------------------------------------------------------- /test/examples/mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: Documenter.jl 2 | repo_url: https://github.com/JuliaDocs/Documenter.jl 3 | site_description: Julia package documentation generator. 4 | site_author: Michael Hatherly 5 | 6 | theme: material 7 | 8 | extra: 9 | palette: 10 | primary: 'indigo' 11 | accent: 'blue' 12 | 13 | extra_css: 14 | - assets/Documenter.css 15 | 16 | markdown_extensions: 17 | - codehilite 18 | - extra 19 | - tables 20 | - fenced_code 21 | 22 | extra_javascript: 23 | - https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML 24 | - assets/mathjaxhelper.js 25 | 26 | docs_dir: 'build' 27 | 28 | pages: 29 | - Home: index.md 30 | - Manual: 31 | - Tutorial: man/tutorial.md 32 | - Library: 33 | - Functions: lib/functions.md 34 | - AutoDocs: lib/autodocs.md 35 | -------------------------------------------------------------------------------- /test/examples/pages/d.jl: -------------------------------------------------------------------------------- 1 | 2 | """ 3 | `T` from page `d.jl`. 4 | 5 | Links: 6 | 7 | - [`ccall`](@ref) 8 | - [`while`](@ref) 9 | - [`@time`](@ref) 10 | - [`T`](@ref) 11 | - [`f`](@ref) 12 | - [`f(x)`](@ref) 13 | - [`f(x, y)`](@ref) 14 | - [`f(::Any, ::Any, ::Any)`](@ref) 15 | 16 | """ 17 | type T end 18 | 19 | 20 | """ 21 | `T` from page `d.jl`. 22 | 23 | Links: 24 | 25 | - [`ccall`](@ref) 26 | - [`while`](@ref) 27 | - [`@time`](@ref) 28 | - [`T(x)`](@ref) 29 | - [`T(x, y)`](@ref) 30 | - [`T(x, y, z)`](@ref) 31 | - [`f`](@ref) 32 | - [`f(x)`](@ref) 33 | - [`f(x, y)`](@ref) 34 | - [`f(::Any, ::Any, ::Any)`](@ref) 35 | 36 | """ 37 | T(x) = T() 38 | 39 | """ 40 | `T` from page `d.jl`. 41 | 42 | Links: 43 | 44 | - [`ccall`](@ref) 45 | - [`while`](@ref) 46 | - [`@time`](@ref) 47 | - [`T()`](@ref) 48 | - [`T(x)`](@ref) 49 | - [`T(x, y)`](@ref) 50 | - [`T(x, y, z)`](@ref) 51 | - [`f`](@ref) 52 | - [`f(x)`](@ref) 53 | - [`f(x, y)`](@ref) 54 | - [`f(::Any, ::Any, ::Any)`](@ref) 55 | 56 | """ 57 | T(x, y) = T() 58 | -------------------------------------------------------------------------------- /test/examples/src/lib/autodocs.md: -------------------------------------------------------------------------------- 1 | # `@autodocs` tests 2 | 3 | ```@meta 4 | CurrentModule = Main 5 | ``` 6 | 7 | ## Public 8 | 9 | Should include docs for 10 | 11 | * [`AutoDocs.Pages.E.f_1`](@ref) 12 | * [`AutoDocs.Pages.E.f_2`](@ref) 13 | * [`AutoDocs.Pages.E.f_3`](@ref) 14 | 15 | in that order. 16 | 17 | ```@autodocs 18 | Modules = [AutoDocs.Pages.E] 19 | Private = false 20 | Order = [:function] 21 | ``` 22 | 23 | ## Private 24 | 25 | Should include docs for 26 | 27 | * [`AutoDocs.Pages.E.g_1`](@ref) 28 | * [`AutoDocs.Pages.E.g_2`](@ref) 29 | * [`AutoDocs.Pages.E.g_3`](@ref) 30 | 31 | in that order. 32 | 33 | ```@autodocs 34 | Modules = [AutoDocs.Pages.E] 35 | Public = false 36 | Order = [:function] 37 | ``` 38 | 39 | ## Ordering of Public and Private 40 | 41 | Should include docs for 42 | 43 | * [`AutoDocs.Pages.E.T_1`](@ref) 44 | * [`AutoDocs.Pages.E.T_2`](@ref) 45 | 46 | in that order. 47 | 48 | ```@autodocs 49 | Modules = [AutoDocs.Pages.E] 50 | Order = [:type] 51 | ``` 52 | 53 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | matrix: 3 | - JULIAVERSION: "julialang/bin/winnt/x64/0.4/julia-0.4-latest-win64.exe" 4 | - JULIAVERSION: "julialang/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe" 5 | - JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe" 6 | 7 | notifications: 8 | - provider: Email 9 | on_build_success: false 10 | on_build_failure: false 11 | on_build_status_changed: false 12 | 13 | install: 14 | # Download most recent Julia Windows binary 15 | - ps: (new-object net.webclient).DownloadFile( 16 | $("http://s3.amazonaws.com/"+$env:JULIAVERSION), 17 | "C:\projects\julia-binary.exe") 18 | # Run installer silently, output to C:\projects\julia 19 | - C:\projects\julia-binary.exe /S /D=C:\projects\julia 20 | 21 | build_script: 22 | # Need to convert from shallow to complete for Pkg.clone to work 23 | - IF EXIST .git\shallow (git fetch --unshallow) 24 | - C:\projects\julia\bin\julia -e "versioninfo(); 25 | Pkg.clone(pwd(), \"Documenter\"); Pkg.build(\"Documenter\")" 26 | 27 | test_script: 28 | - C:\projects\julia\bin\julia -e "Pkg.test(\"Documenter\")" 29 | -------------------------------------------------------------------------------- /src/Deps.jl: -------------------------------------------------------------------------------- 1 | """ 2 | Exported module that provides build and deploy dependencies and related functions. 3 | 4 | Currently only [`pip`](@ref) is implemented. 5 | """ 6 | module Deps 7 | 8 | export pip 9 | 10 | using DocStringExtensions 11 | 12 | """ 13 | $(SIGNATURES) 14 | 15 | Installs (as non-root user) all python packages listed in `deps`. 16 | 17 | # Examples 18 | 19 | ```julia 20 | using Documenter 21 | 22 | makedocs( 23 | # ... 24 | ) 25 | 26 | deploydocs( 27 | deps = Deps.pip("pygments", "mkdocs", "mkdocs-material"), 28 | # ... 29 | ) 30 | ``` 31 | """ 32 | pip(deps...) = () -> run(`pip install --user $(deps...)`) 33 | 34 | 35 | function localbin() 36 | is_linux() ? joinpath(homedir(), ".local", "bin") : 37 | is_apple() ? joinpath(homedir(), "Library", "Python", "2.7", "bin") : "" 38 | end 39 | 40 | function updatepath!(p = localbin()) 41 | if contains(ENV["PATH"], p) 42 | ENV["PATH"] 43 | else 44 | ENV["PATH"] = "$p:$(ENV["PATH"])" 45 | end 46 | end 47 | 48 | if isdefined(:OS_NAME) && !isdefined(:is_linux) && !isdefined(:is_apple) # compat 49 | is_linux() = OS_NAME === :Linux 50 | is_apple() = OS_NAME === :Apple || OS_NAME === :Darwin 51 | end 52 | 53 | end 54 | -------------------------------------------------------------------------------- /test/errors/src/index.md: -------------------------------------------------------------------------------- 1 | 2 | ```@docs 3 | missing_doc 4 | ``` 5 | 6 | ```@docs 7 | parse error 8 | ``` 9 | 10 | ```@meta 11 | CurrentModule = NonExistantModule 12 | ``` 13 | 14 | ```@autodocs 15 | Modules = [NonExistantModule] 16 | ``` 17 | 18 | ```@eval 19 | NonExistantModule 20 | ``` 21 | 22 | ```@docs 23 | # comment in a @docs block 24 | ``` 25 | 26 | [`foo(x::Foo)`](@ref) creates an [`UndefVarError`](@ref) when `eval`d 27 | for the type signature, since `Foo` is not defined. 28 | 29 | Numeric literals don't have bindings: [`1`](@ref). Nor [`"strings"`](@ref). 30 | [`:symbols`] do, however. 31 | 32 | Some syntax errors in references will fail with an `ParseError`: [`foo+*bar`](@ref). 33 | Others, like [`foo(x`](@ref) will give an `:incomplete` expression. 34 | 35 | This is the footnote [^1]. And [^another] [^another]. 36 | 37 | [^1]: one 38 | 39 | [^nested]: a nested footnote 40 | 41 | [^another_one]: 42 | 43 | Things! [^1]. [^2]. 44 | 45 | [^nested] 46 | 47 | [^nested]: 48 | 49 | Duplicate [^1] nested footnote. 50 | 51 | ```@docs 52 | ErrorsModule.func 53 | ``` 54 | 55 | ```jldoctest 56 | julia> b = 1 57 | 2 58 | 59 | julia> x 60 | 61 | julia> x 62 | ERROR: UndefVarError: x not defined 63 | 64 | julia> x 65 | ``` 66 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The Documenter.jl package is licensed under the MIT "Expat" License: 2 | 3 | > Copyright (c) 2016: Michael Hatherly. 4 | > 5 | > Permission is hereby granted, free of charge, to any person obtaining a copy 6 | > of this software and associated documentation files (the "Software"), to deal 7 | > in the Software without restriction, including without limitation the rights 8 | > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | > copies of the Software, and to permit persons to whom the Software is 10 | > furnished to do so, subject to the following conditions: 11 | > 12 | > The above copyright notice and this permission notice shall be included in all 13 | > copies or substantial portions of the Software. 14 | > 15 | > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | > SOFTWARE. 22 | > 23 | -------------------------------------------------------------------------------- /src/Formats.jl: -------------------------------------------------------------------------------- 1 | """ 2 | Filetypes used to decide which rendering methods in [`Documenter.Writers`](@ref) are called. 3 | 4 | The only supported format is currently `Markdown`. 5 | """ 6 | module Formats 7 | 8 | import ..Documenter 9 | 10 | using Compat, DocStringExtensions 11 | 12 | """ 13 | Represents the output format. Possible values are `Markdown`, `LaTeX`, and `HTML`. 14 | """ 15 | @enum( 16 | Format, 17 | Markdown, 18 | LaTeX, 19 | HTML, 20 | ) 21 | 22 | """ 23 | $(SIGNATURES) 24 | 25 | Converts a [`Format`](@ref) value to a `MIME` type. 26 | """ 27 | function mimetype(f::Symbol) 28 | f ≡ :markdown ? MIME"text/plain"() : 29 | f ≡ :latex ? MIME"text/latex"() : 30 | f ≡ :html ? MIME"text/html"() : 31 | error("unexpected format.") 32 | end 33 | 34 | function extension(f::Symbol, file) 35 | path, _ = splitext(file) 36 | string(path, extension(f)) 37 | end 38 | 39 | function extension(f::Symbol) 40 | f ≡ :markdown ? ".md" : 41 | f ≡ :latex ? ".tex" : 42 | f ≡ :html ? ".html" : 43 | error("unexpected format.") 44 | end 45 | 46 | # `fmt` -- convert a format spec to a vector of symbols. 47 | const DEPRECATION_MAPPING = Dict( 48 | Markdown => :markdown, 49 | LaTeX => :latex, 50 | HTML => :html, 51 | ) 52 | function _fmt(f::Format) 53 | local s = DEPRECATION_MAPPING[f] 54 | Base.depwarn("`$(f)` is deprecated use `:$(s)` for `format = ...`.", :fmt) 55 | return s 56 | end 57 | fmt(f::Format) = [_fmt(f)] 58 | fmt(v::Vector{Format}) = map(_fmt, v) 59 | fmt(s::Symbol) = [s] 60 | fmt(v::Vector{Symbol}) = v 61 | 62 | end 63 | -------------------------------------------------------------------------------- /assets/latex/documenter.sty: -------------------------------------------------------------------------------- 1 | % font settings 2 | \usepackage{fontspec, newunicodechar, polyglossia} 3 | 4 | \setsansfont{Lato}[Scale=MatchLowercase, Ligatures=TeX] 5 | \setmonofont{Fantasque Sans Mono}[Scale=MatchLowercase] 6 | \renewcommand{\familydefault}{\sfdefault} 7 | % 8 | 9 | % colours 10 | \usepackage{xcolor} 11 | 12 | \definecolor{light-blue}{HTML}{6b85dd} 13 | \definecolor{dark-blue}{HTML}{4266d5} 14 | \definecolor{light-red}{HTML}{d66661} 15 | \definecolor{dark-red}{HTML}{c93d39} 16 | \definecolor{light-green}{HTML}{6bab5b} 17 | \definecolor{dark-green}{HTML}{3b972e} 18 | \definecolor{light-purple}{HTML}{aa7dc0} 19 | \definecolor{dark-purple}{HTML}{945bb0} 20 | % 21 | 22 | % maths 23 | \usepackage{amsmath, amssymb} 24 | % 25 | 26 | % listings 27 | \usepackage{listings, minted} 28 | 29 | \lstset{ 30 | basicstyle = \small\ttfamily, 31 | breaklines = true, 32 | columns = fullflexible, 33 | frame = leftline, 34 | keepspaces = true, 35 | showstringspaces = false, 36 | xleftmargin = 3pt, 37 | } 38 | 39 | \setminted{ 40 | breaklines = true, 41 | fontsize = \small, 42 | frame = leftline, 43 | } 44 | % 45 | 46 | % tables 47 | \usepackage{tabulary} 48 | % 49 | 50 | % hyperref 51 | \usepackage{hyperref} 52 | \hypersetup{ 53 | pdfpagelabels, 54 | bookmarks, 55 | hyperindex, 56 | unicode = true, 57 | linkcolor = dark-blue, 58 | urlcolor = dark-purple, 59 | colorlinks = true, 60 | } 61 | % 62 | 63 | % table of contents 64 | \maxtocdepth{subsection} 65 | % 66 | 67 | % paragraphs 68 | \setlength{\parindent}{0pt} 69 | \nonzeroparskip 70 | % 71 | 72 | % adjust margins 73 | \setulmarginsandblock{1.5in}{1in}{*} 74 | \setlrmarginsandblock{1.5in}{1in}{*} 75 | \setheaderspaces{1in}{*}{*} 76 | \checkandfixthelayout 77 | % 78 | -------------------------------------------------------------------------------- /docs/make.jl: -------------------------------------------------------------------------------- 1 | using Documenter 2 | 3 | makedocs( 4 | modules = [Documenter], 5 | clean = false, 6 | format = :html, 7 | sitename = "Documenter.jl", 8 | authors = "Michael Hatherly, Morten Piibeleht, and contributors.", 9 | linkcheck = !("skiplinks" in ARGS), 10 | pages = Any[ # Compat: `Any` for 0.4 compat 11 | "Home" => "index.md", 12 | "Manual" => Any[ 13 | "Guide" => "man/guide.md", 14 | "man/examples.md", 15 | "man/syntax.md", 16 | "man/doctests.md", 17 | "man/hosting.md", 18 | "man/latex.md", 19 | "man/internals.md", 20 | "man/contributing.md", 21 | ], 22 | "Library" => Any[ 23 | "Public" => "lib/public.md", 24 | hide("Internals" => "lib/internals.md", Any[ 25 | "lib/internals/anchors.md", 26 | "lib/internals/builder.md", 27 | "lib/internals/cross-references.md", 28 | "lib/internals/docchecks.md", 29 | "lib/internals/docsystem.md", 30 | "lib/internals/documents.md", 31 | "lib/internals/dom.md", 32 | "lib/internals/expanders.md", 33 | "lib/internals/formats.md", 34 | "lib/internals/generator.md", 35 | "lib/internals/mdflatten.md", 36 | "lib/internals/selectors.md", 37 | "lib/internals/utilities.md", 38 | "lib/internals/walkers.md", 39 | "lib/internals/writers.md", 40 | ]) 41 | ] 42 | ] 43 | ) 44 | 45 | deploydocs( 46 | repo = "github.com/JuliaDocs/Documenter.jl.git", 47 | target = "build", 48 | deps = nothing, 49 | make = nothing, 50 | ) 51 | -------------------------------------------------------------------------------- /test/runtests.jl: -------------------------------------------------------------------------------- 1 | # Build the real docs first. 2 | include("../docs/make.jl") 3 | 4 | # Build the example docs 5 | include("examples/make.jl") 6 | 7 | # Test missing docs 8 | include("missingdocs/make.jl") 9 | 10 | # Primary @testset 11 | 12 | if VERSION >= v"0.5.0-dev+7720" 13 | using Base.Test 14 | else 15 | using BaseTestNext 16 | const Test = BaseTestNext 17 | end 18 | 19 | # Error reporting. 20 | println("="^50) 21 | info("The following errors are expected output.") 22 | include(joinpath("errors", "make.jl")) 23 | info("END of expected error output.") 24 | println("="^50) 25 | 26 | @testset "Documenter" begin 27 | # Unit tests for module internals. 28 | include("utilities.jl") 29 | 30 | # NavNode tests. 31 | include("navnode.jl") 32 | 33 | # DocSystem unit tests. 34 | include("docsystem.jl") 35 | 36 | # DOM Tests. 37 | include("dom.jl") 38 | 39 | # MDFlatten tests. 40 | include("mdflatten.jl") 41 | 42 | # Mock package docs. 43 | include("examples/tests.jl") 44 | 45 | # Documenter package docs with other formats. 46 | include("formats/markdown.jl") 47 | include("formats/latex.jl") 48 | 49 | # Deployment 50 | include("errors/deploydocs.jl") 51 | end 52 | 53 | # Additional tests 54 | 55 | ## `Markdown.MD` to `DOM.Node` conversion tests. 56 | module MarkdownToNode 57 | import Documenter.DocSystem 58 | import Documenter.Writers.HTMLWriter: mdconvert 59 | 60 | # Exhaustive Conversion from Markdown to Nodes. 61 | for mod in Base.Docs.modules 62 | for (binding, multidoc) in DocSystem.getmeta(mod) 63 | for (typesig, docstr) in multidoc.docs 64 | md = DocSystem.parsedoc(docstr) 65 | string(mdconvert(md)) 66 | end 67 | end 68 | end 69 | end 70 | -------------------------------------------------------------------------------- /docs/src/index.md: -------------------------------------------------------------------------------- 1 | # Documenter.jl 2 | 3 | *A documentation generator for Julia.* 4 | 5 | A package for building documentation from docstrings and markdown files. 6 | 7 | !!! note 8 | 9 | Please read through the 10 | [Documentation](http://docs.julialang.org/en/latest/manual/documentation/) section 11 | of the main Julia manual if this is your first time using Julia's documentation system. 12 | Once you've read through how to write documentation for your code then come back here. 13 | 14 | ## Package Features 15 | 16 | - Write all your documentation in [Markdown](https://en.wikipedia.org/wiki/Markdown). 17 | - Minimal configuration. 18 | - Supports Julia `0.4` and `0.5-dev`. 19 | - Doctests Julia code blocks. 20 | - Cross references for docs and section headers. 21 | - [``\LaTeX`` syntax](@ref latex_syntax) support. 22 | - Checks for missing docstrings and incorrect cross references. 23 | - Generates tables of contents and docstring indexes. 24 | - Use `git push` to automatically build and deploy docs from Travis to GitHub Pages. 25 | 26 | The [Package Guide](@ref) provides a tutorial explaining how to get started using Documenter. 27 | 28 | Some examples of packages using Documenter can be found on the [Examples](@ref) page. 29 | 30 | See the [Index](@ref main-index) for the complete list of documented functions and types. 31 | 32 | ## Manual Outline 33 | 34 | ```@contents 35 | Pages = [ 36 | "man/guide.md", 37 | "man/examples.md", 38 | "man/syntax.md", 39 | "man/doctests.md", 40 | "man/hosting.md", 41 | "man/latex.md", 42 | "man/contributing.md", 43 | ] 44 | Depth = 1 45 | ``` 46 | 47 | ## Library Outline 48 | 49 | ```@contents 50 | Pages = ["lib/public.md", "lib/internals.md"] 51 | ``` 52 | 53 | ### [Index](@id main-index) 54 | 55 | ```@index 56 | Pages = ["lib/public.md"] 57 | ``` 58 | -------------------------------------------------------------------------------- /test/navnode.jl: -------------------------------------------------------------------------------- 1 | module NavNodeTests 2 | 3 | if VERSION >= v"0.5.0-dev+7720" 4 | using Base.Test 5 | else 6 | using BaseTestNext 7 | const Test = BaseTestNext 8 | end 9 | 10 | using Compat 11 | import Documenter: Documents, Builder 12 | import Documenter.Documents: NavNode 13 | 14 | type FakeDocumentInternal 15 | pages :: Dict{Compat.String, Void} 16 | navlist :: Vector{NavNode} 17 | FakeDocumentInternal() = new(Dict(), []) 18 | end 19 | type FakeDocument 20 | internal :: FakeDocumentInternal 21 | FakeDocument() = new(FakeDocumentInternal()) 22 | end 23 | 24 | @testset "NavNode" begin 25 | @test fieldtype(FakeDocumentInternal, :navlist) == fieldtype(Documents.Internal, :navlist) 26 | 27 | pages = [ 28 | "page1.md", 29 | "Page2" => "page2.md", 30 | "Section" => [ 31 | "page3.md", 32 | "Page4" => "page4.md", 33 | "Subsection" => [ 34 | "page5.md", 35 | ], 36 | ], 37 | "page6.md", 38 | ] 39 | doc = FakeDocument() 40 | doc.internal.pages = Dict(map(i -> "page$i.md" => nothing, 1:8)) 41 | navtree = Builder.walk_navpages(pages, nothing, doc) 42 | navlist = doc.internal.navlist 43 | 44 | @test length(navlist) == 6 45 | for (i,navnode) in enumerate(navlist) 46 | @test get(navnode.page) == "page$i.md" 47 | end 48 | 49 | @test isa(navtree, Vector{NavNode}) 50 | @test length(navtree) == 4 51 | @test navtree[1] === navlist[1] 52 | @test navtree[2] === navlist[2] 53 | @test navtree[4] === navlist[6] 54 | 55 | section = navtree[3] 56 | @test get(section.title_override) == "Section" 57 | @test isnull(section.page) 58 | @test length(section.children) == 3 59 | 60 | navpath = Documents.navpath(navlist[5]) 61 | @test length(navpath) == 3 62 | @test navpath[1] === section 63 | @test navpath[3] === navlist[5] 64 | end 65 | 66 | end 67 | -------------------------------------------------------------------------------- /test/formats/markdown.jl: -------------------------------------------------------------------------------- 1 | module MarkdownFormatTests 2 | 3 | if VERSION >= v"0.5.0-dev+7720" 4 | using Base.Test 5 | else 6 | using BaseTestNext 7 | const Test = BaseTestNext 8 | end 9 | 10 | using Documenter 11 | 12 | # Documenter package docs 13 | info("Building Documenter's docs with Markdown.") 14 | const Documenter_root = normpath(joinpath(dirname(@__FILE__), "..", "..", "docs")) 15 | doc = makedocs( 16 | debug = true, 17 | root = Documenter_root, 18 | modules = Documenter, 19 | clean = false, 20 | ) 21 | 22 | @testset "Markdown" begin 23 | @test isa(doc, Documenter.Documents.Document) 24 | 25 | let build_dir = joinpath(Documenter_root, "build"), 26 | source_dir = joinpath(Documenter_root, "src") 27 | 28 | @test isdir(build_dir) 29 | @test isdir(joinpath(build_dir, "assets")) 30 | @test isdir(joinpath(build_dir, "lib")) 31 | @test isdir(joinpath(build_dir, "man")) 32 | 33 | @test isfile(joinpath(build_dir, "index.md")) 34 | @test isfile(joinpath(build_dir, "assets", "mathjaxhelper.js")) 35 | @test isfile(joinpath(build_dir, "assets", "Documenter.css")) 36 | end 37 | 38 | @test doc.user.root == Documenter_root 39 | @test doc.user.source == "src" 40 | @test doc.user.build == "build" 41 | @test doc.user.clean == false 42 | 43 | rm(joinpath(Documenter_root, "build"); recursive = true) 44 | 45 | mktempdir() do root 46 | let path = joinpath(root, "docs") 47 | Documenter.generate("DocumenterTestPackage", dir = path) 48 | @test isdir(path) 49 | @test isfile(joinpath(path, "mkdocs.yml")) 50 | @test isfile(joinpath(path, ".gitignore")) 51 | @test isfile(joinpath(path, "make.jl")) 52 | @test isdir(joinpath(path, "src")) 53 | @test isfile(joinpath(path, "src", "index.md")) 54 | end 55 | end 56 | 57 | @test_throws ErrorException Documenter.generate("Documenter") 58 | @test_throws ErrorException Documenter.generate(randstring()) 59 | end 60 | 61 | end 62 | -------------------------------------------------------------------------------- /test/formats/latex.jl: -------------------------------------------------------------------------------- 1 | module LaTeXFormatTests 2 | 3 | if VERSION >= v"0.5.0-dev+7720" 4 | using Base.Test 5 | else 6 | using BaseTestNext 7 | const Test = BaseTestNext 8 | end 9 | 10 | using Documenter 11 | 12 | # Documenter package docs 13 | info("Building Documenter's docs with LaTeX.") 14 | const Documenter_root = normpath(joinpath(dirname(@__FILE__), "..", "..", "docs")) 15 | doc = makedocs( 16 | debug = true, 17 | root = Documenter_root, 18 | modules = [Documenter], 19 | clean = false, 20 | format = :latex, 21 | sitename = "Documenter.jl", 22 | authors = "Michael Hatherly, Morten Piibeleht, and contributors.", 23 | pages = Any[ # Compat: `Any` for 0.4 compat 24 | "Home" => "index.md", 25 | "Manual" => Any[ 26 | "Guide" => "man/guide.md", 27 | "man/examples.md", 28 | "man/syntax.md", 29 | "man/doctests.md", 30 | "man/hosting.md", 31 | "man/latex.md", 32 | "man/internals.md", 33 | "man/contributing.md", 34 | ], 35 | "Library" => Any[ 36 | "Public" => "lib/public.md", 37 | "Internals" => Any[ 38 | "Internals" => "lib/internals.md", 39 | "lib/internals/anchors.md", 40 | "lib/internals/builder.md", 41 | "lib/internals/cross-references.md", 42 | "lib/internals/docchecks.md", 43 | "lib/internals/docsystem.md", 44 | "lib/internals/documents.md", 45 | "lib/internals/dom.md", 46 | "lib/internals/expanders.md", 47 | "lib/internals/formats.md", 48 | "lib/internals/generator.md", 49 | "lib/internals/mdflatten.md", 50 | "lib/internals/selectors.md", 51 | "lib/internals/utilities.md", 52 | "lib/internals/walkers.md", 53 | "lib/internals/writers.md", 54 | ] 55 | ] 56 | ] 57 | ) 58 | 59 | @testset "LaTeX" begin 60 | @test isa(doc, Documenter.Documents.Document) 61 | end 62 | 63 | end 64 | -------------------------------------------------------------------------------- /assets/html/documenter.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Part of Documenter.jl 3 | * https://github.com/JuliaDocs/Documenter.jl 4 | * 5 | * License: MIT 6 | */ 7 | 8 | requirejs.config({ 9 | paths: { 10 | 'jquery': 'https://code.jquery.com/jquery-3.1.0.js?', 11 | 'jqueryui': 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.0/jquery-ui.min', 12 | 'mathjax': 'https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML', 13 | 'highlight': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/highlight.min', 14 | 'highlight-julia': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/languages/julia.min', 15 | }, 16 | shim: { 17 | 'mathjax' : { 18 | exports: "MathJax" 19 | }, 20 | 'highlight-julia': ['highlight'] 21 | } 22 | }); 23 | 24 | // Load MathJax 25 | require(['mathjax'], function(MathJax) { 26 | MathJax.Hub.Config({ 27 | "tex2jax": { 28 | inlineMath: [['$','$'], ['\\(','\\)']], 29 | processEscapes: true 30 | } 31 | }); 32 | MathJax.Hub.Config({ 33 | config: ["MMLorHTML.js"], 34 | jax: [ 35 | "input/TeX", 36 | "output/HTML-CSS", 37 | "output/NativeMML" 38 | ], 39 | extensions: [ 40 | "MathMenu.js", 41 | "MathZoom.js", 42 | "TeX/AMSmath.js", 43 | "TeX/AMSsymbols.js", 44 | "TeX/autobold.js", 45 | "TeX/autoload-all.js" 46 | ] 47 | }); 48 | MathJax.Hub.Config({ 49 | TeX: { equationNumbers: { autoNumber: "AMS" } } 50 | }); 51 | }) 52 | 53 | require(['jquery', 'highlight', 'highlight-julia'], function($, hljs) { 54 | $(document).ready(function() { 55 | if (typeof DOC_VERSIONS !== 'undefined') { 56 | var version_selector = $("#version-selector"); 57 | DOC_VERSIONS.forEach(function(each) { 58 | var option = $(""); 59 | version_selector.append(option); 60 | }); 61 | } 62 | hljs.initHighlighting(); 63 | }) 64 | 65 | }) 66 | -------------------------------------------------------------------------------- /test/utilities.jl: -------------------------------------------------------------------------------- 1 | module UtilitiesTests 2 | 3 | if VERSION >= v"0.5.0-dev+7720" 4 | using Base.Test 5 | else 6 | using BaseTestNext 7 | const Test = BaseTestNext 8 | end 9 | 10 | import Documenter 11 | 12 | module UnitTests 13 | module SubModule end 14 | 15 | # Does `submodules` collect *all* the submodules? 16 | module A 17 | module B 18 | module C 19 | module D end 20 | end 21 | end 22 | end 23 | 24 | type T end 25 | 26 | "Documenter unit tests." 27 | Base.length(::T) = 1 28 | end 29 | 30 | @testset "Utilities" begin 31 | let doc = @doc(length) 32 | a = Documenter.Utilities.filterdocs(doc, Set{Module}()) 33 | b = Documenter.Utilities.filterdocs(doc, Set{Module}([UnitTests])) 34 | c = Documenter.Utilities.filterdocs(doc, Set{Module}([Base])) 35 | d = Documenter.Utilities.filterdocs(doc, Set{Module}([UtilitiesTests])) 36 | 37 | @test !isnull(a) 38 | @test get(a) === doc 39 | @test !isnull(b) 40 | @test contains(stringmime("text/plain", get(b)), "Documenter unit tests.") 41 | @test !isnull(c) 42 | @test !contains(stringmime("text/plain", get(c)), "Documenter unit tests.") 43 | @test isnull(d) 44 | end 45 | 46 | # Documenter.Utilities.issubmodule 47 | @test Documenter.Utilities.issubmodule(Main, Main) === true 48 | @test Documenter.Utilities.issubmodule(UnitTests, UnitTests) === true 49 | @test Documenter.Utilities.issubmodule(UnitTests.SubModule, Main) === true 50 | @test Documenter.Utilities.issubmodule(UnitTests.SubModule, UnitTests) === true 51 | @test Documenter.Utilities.issubmodule(UnitTests.SubModule, Base) === false 52 | @test Documenter.Utilities.issubmodule(UnitTests, UnitTests.SubModule) === false 53 | 54 | @test UnitTests.A in Documenter.Utilities.submodules(UnitTests.A) 55 | @test UnitTests.A.B in Documenter.Utilities.submodules(UnitTests.A) 56 | @test UnitTests.A.B.C in Documenter.Utilities.submodules(UnitTests.A) 57 | @test UnitTests.A.B.C.D in Documenter.Utilities.submodules(UnitTests.A) 58 | end 59 | 60 | end 61 | -------------------------------------------------------------------------------- /test/examples/src/index.md: -------------------------------------------------------------------------------- 1 | # Documentation 2 | 3 | ## Index Page 4 | 5 | ```@contents 6 | Pages = ["index.md"] 7 | Depth = 5 8 | ``` 9 | 10 | ## Functions Contents 11 | 12 | ```@contents 13 | Pages = ["lib/functions.md"] 14 | Depth = 3 15 | ``` 16 | 17 | ## Tutorial Contents 18 | 19 | ```@contents 20 | Pages = ["man/tutorial.md"] 21 | ``` 22 | 23 | ## Index 24 | 25 | ```@index 26 | ``` 27 | 28 | ### Embedded `@ref` links headers: [`ccall`](@ref) 29 | 30 | [#60](@ref) [#61](@ref) 31 | 32 | ```@repl 33 | zeros(5, 5) 34 | zeros(50, 50) 35 | ``` 36 | 37 | ```@meta 38 | DocTestSetup = quote 39 | using Base 40 | x = -3:0.01:3 41 | y = -4:0.02:5 42 | z = [Float64((xi^2 + yi^2)) for xi in x, yi in y] 43 | end 44 | ``` 45 | 46 | ```jldoctest 47 | julia> [1.0, 2.0, 3.0] 48 | 3-element Array{Float64,1}: 49 | 1.0 50 | 2.0 51 | 3.0 52 | 53 | ``` 54 | 55 | ```jldoctest 56 | julia> println(" "^5) 57 | 58 | julia> "\nfoo\n\nbar\n\n\nbaz" 59 | "\nfoo\n\nbar\n\n\nbaz" 60 | 61 | julia> println(ans) 62 | 63 | foo 64 | 65 | bar 66 | 67 | 68 | baz 69 | ``` 70 | 71 | ```jldoctest 72 | julia> info("...") 73 | INFO: ... 74 | 75 | ``` 76 | 77 | * `one` two three 78 | * four `five` six 79 | 80 | * ``` 81 | one 82 | ``` 83 | 84 | ## Raw Blocks 85 | 86 | ```@raw html 87 |
one
two
< > & ' "
" 74 | @test string(img[:src => "source"]) == "