Browse Source

add an example of a plot

pull/16/head
Fredrik Ekre 8 years ago
parent
commit
1bc8a8e223
  1. 5
      .travis.yml
  2. 4
      docs/make.jl
  3. 10
      examples/example.jl

5
.travis.yml

@ -10,6 +10,7 @@ julia:
matrix: matrix:
allow_failures: allow_failures:
- julia: nightly - julia: nightly
- julia: 0.7
branches: branches:
only: only:
- master - master
@ -20,7 +21,9 @@ jobs:
julia: 0.6 julia: 0.6
os: linux os: linux
script: script:
- julia -e 'Pkg.clone(pwd()); Pkg.build("Literate"); Pkg.add("Documenter"); cd(Pkg.dir("Literate")); include("docs/make.jl")' - julia -e 'Pkg.clone(pwd()); Pkg.build("Literate")'
- julia -e 'Pkg.add("Documenter"); Pkg.add("Plots"); Pkg.build("Plots")'
- julia -e 'cd(Pkg.dir("Literate")); include("docs/make.jl")'
notifications: notifications:
email: false email: false
git: git:

4
docs/make.jl

@ -1,6 +1,10 @@
using Documenter using Documenter
using Literate using Literate
# import these to make sure they precompile here instead of when generating output
import Plots
import GR
# generate examples # generate examples
EXAMPLE = joinpath(@__DIR__, "..", "examples", "example.jl") EXAMPLE = joinpath(@__DIR__, "..", "examples", "example.jl")
OUTPUT = joinpath(@__DIR__, "src/generated") OUTPUT = joinpath(@__DIR__, "src/generated")

10
examples/example.jl

@ -59,6 +59,16 @@ end
foo() foo()
# Both Documenter's `@example` block and notebooks can display images. Here is an example
# where we generate a simple plot using the
# [Plots.jl](https://github.com/JuliaPlots/Plots.jl) package
using Plots
x = linspace(0, 6π, 1000)
y1 = sin.(x)
y2 = cos.(x)
plot(x, [y1, y2])
# ### Custom processing # ### Custom processing
# #
# It is possible to give Literate custom pre- and post-processing functions. # It is possible to give Literate custom pre- and post-processing functions.

Loading…
Cancel
Save