mirror of https://github.com/mpastell/Weave.jl
commit
79a3d73882
13
.travis.yml
13
.travis.yml
|
@ -1,13 +1,18 @@
|
|||
|
||||
language: julia
|
||||
|
||||
julia:
|
||||
- 1.0
|
||||
- 1.1
|
||||
- 1.3
|
||||
- 1.4
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- julia: 1.1
|
||||
- julia: 1.4
|
||||
- julia: nightly
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
script:
|
||||
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
|
||||
- julia --check-bounds=yes -e 'using Pkg; Pkg.build()'
|
||||
|
@ -17,7 +22,7 @@ after_success:
|
|||
jobs:
|
||||
include:
|
||||
- stage: "Documentation"
|
||||
julia: 1.0
|
||||
julia: 1.3
|
||||
os: linux
|
||||
script:
|
||||
- julia --project=doc/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd()));
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name = "Weave"
|
||||
uuid = "44d3d7a6-8a23-5bf8-98c5-b353f8df5ec9"
|
||||
version = "0.9.1"
|
||||
version = "0.9.2"
|
||||
|
||||
[deps]
|
||||
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
|
||||
|
@ -17,19 +17,19 @@ Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
|
|||
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
|
||||
|
||||
[compat]
|
||||
julia = "1"
|
||||
Highlights = ">=0.3.1"
|
||||
Mustache = ">=0.4.1"
|
||||
Plots = ">=0.19.0"
|
||||
YAML = ">=0.3.0"
|
||||
julia = "1"
|
||||
|
||||
[extras]
|
||||
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
|
||||
Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d"
|
||||
Gadfly = "c91e804a-d5a3-530f-b6f0-dfbca275c004"
|
||||
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
|
||||
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
|
||||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
|
||||
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
|
||||
|
||||
[targets]
|
||||
test = ["Test", "Plots", "Gadfly", "Cairo", "Conda", "IJulia"]
|
||||
|
|
7
REQUIRE
7
REQUIRE
|
@ -1,7 +0,0 @@
|
|||
julia 1.0
|
||||
JSON
|
||||
Highlights 0.3.0
|
||||
Mustache
|
||||
YAML
|
||||
Compat 0.25.0
|
||||
Requires
|
|
@ -1,14 +1,6 @@
|
|||
import Markdown: latex, latexinline
|
||||
|
||||
function latex(io::IO, tex::Markdown.LaTeX)
|
||||
math_envs = ["align", "equation", "eqnarray"]
|
||||
use_dollars = !any([occursin("\\begin{$me", tex.formula) for me in math_envs])
|
||||
use_dollars && write(io, "\\[")
|
||||
write(io, string("\n", tex.formula, "\n"))
|
||||
use_dollars && write(io, "\\]\n")
|
||||
end
|
||||
|
||||
#Remove comments that can occur inside a line
|
||||
# Remove comments that can occur inside a line
|
||||
function latexinline(io, comment::WeaveMarkdown.Comment)
|
||||
write(io, "")
|
||||
end
|
||||
|
|
|
@ -1,8 +1,23 @@
|
|||
#This module extends the julia markdown parser to improve compatibility with Jupyter, Pandoc etc.
|
||||
# This module extends the julia markdown parser to improve compatibility with Jupyter, Pandoc etc.
|
||||
module WeaveMarkdown
|
||||
using Markdown
|
||||
import Markdown: @trigger, @breaking, Code, MD, withstream, startswith, LaTeX
|
||||
|
||||
function __init__()
|
||||
# NOTE:
|
||||
# overwriting `Markdown.latex` function should be done here in order to allow
|
||||
# incremental precompilations
|
||||
Markdown.eval(quote
|
||||
function latex(io::IO, tex::Markdown.LaTeX)
|
||||
math_envs = ["align", "equation", "eqnarray"]
|
||||
use_dollars = !any([occursin("\\begin{$me", tex.formula) for me in math_envs])
|
||||
use_dollars && write(io, "\\[")
|
||||
write(io, string("\n", tex.formula, "\n"))
|
||||
use_dollars && write(io, "\\]\n")
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
mutable struct Comment
|
||||
text::String
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue