Skip to content

Commit

Permalink
Add docs with Documenter. (JuliaLang#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Morrison authored and fredrikekre committed Nov 16, 2018
1 parent 1fcd546 commit 66607a6
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.jl.cov
*.jl.*.cov
*.jl.mem
/docs/build/
/docs/Manifest.toml
16 changes: 14 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ os:
julia:
- 0.6
- 0.7
- 1.0
- nightly

# # Uncomment the following lines to allow failures on nightly julia
Expand All @@ -23,5 +24,16 @@ notifications:
# - julia -e 'Pkg.clone(pwd()); Pkg.build("Example"); Pkg.test("Example"; coverage=true)';

after_success:
- julia -e 'cd(Pkg.dir("Example")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())';
# - julia -e 'cd(Pkg.dir("Example")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())';
- julia -e 'if VERSION >= v"0.7.0-" using Pkg end; cd(Pkg.dir("Example")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())';
# - julia -e 'if VERSION >= v"0.7.0-" using Pkg end; cd(Pkg.dir("Example")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())';

jobs:
include:
- stage: "Documentation"
julia: 1.0
os: linux
script:
- julia --project=docs/ -e 'using Pkg; Pkg.instantiate();
Pkg.develop(PackageSpec(path=pwd()))'
- julia --project=docs/ docs/make.jl
after_success: skip
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Example Julia package repo.

[![Example](http://pkg.julialang.org/badges/Example_0.6.svg)](http://pkg.julialang.org/?pkg=Example)
[![Example](http://pkg.julialang.org/badges/Example_0.7.svg)](http://pkg.julialang.org/?pkg=Example)
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaLang.github.io/Example.jl/stable)
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaLang.github.io/Example.jl/dev)

Linux and macOS: [![Build Status](https://travis-ci.org/JuliaLang/Example.jl.svg?branch=master)](https://travis-ci.org/JuliaLang/Example.jl)

Expand Down
5 changes: 5 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Documenter = "~0.20"
7 changes: 7 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Documenter, Example

makedocs(modules = [Example], sitename = "Example.jl")

deploydocs(
repo = "github.com/JuliaLang/Example.jl.git",
)
7 changes: 7 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Example

Example Julia package repo.

```@autodocs
Modules = [Example]
```
11 changes: 11 additions & 0 deletions src/Example.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
module Example
export hello, domath

"""
hello(who::String)
Return "Hello, `who`".
"""
hello(who::String) = "Hello, $who"

"""
domath(x::Number)
Return `x + 5`.
"""
domath(x::Number) = x + 5

end

0 comments on commit 66607a6

Please sign in to comment.