From 652b19cd0ff9b28b756d491c1299c7326839ccdf Mon Sep 17 00:00:00 2001 From: aviatesk Date: Sun, 5 Jan 2020 15:18:41 +0900 Subject: [PATCH 1/5] fixes #232 --- src/WeaveMarkdown/latex.jl | 10 +--------- src/WeaveMarkdown/markdown.jl | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/WeaveMarkdown/latex.jl b/src/WeaveMarkdown/latex.jl index 45fcf64..585726d 100644 --- a/src/WeaveMarkdown/latex.jl +++ b/src/WeaveMarkdown/latex.jl @@ -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 diff --git a/src/WeaveMarkdown/markdown.jl b/src/WeaveMarkdown/markdown.jl index 5a70fa8..d16d7ca 100644 --- a/src/WeaveMarkdown/markdown.jl +++ b/src/WeaveMarkdown/markdown.jl @@ -1,8 +1,21 @@ -#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: **overwrite** `Markdown.latex` function + 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 From 6ca6c51ea625db51cd760ae598e3fbead34be76c Mon Sep 17 00:00:00 2001 From: aviatesk Date: Sun, 5 Jan 2020 15:21:02 +0900 Subject: [PATCH 2/5] rm REQUIRE --- REQUIRE | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 REQUIRE diff --git a/REQUIRE b/REQUIRE deleted file mode 100644 index 1e4c869..0000000 --- a/REQUIRE +++ /dev/null @@ -1,7 +0,0 @@ -julia 1.0 -JSON -Highlights 0.3.0 -Mustache -YAML -Compat 0.25.0 -Requires From d0ecc30f5287bc3c6949a2470f7ae92bcc75737d Mon Sep 17 00:00:00 2001 From: aviatesk Date: Sun, 5 Jan 2020 16:11:19 +0900 Subject: [PATCH 3/5] bump version --- Project.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 446f973..c1052a4 100644 --- a/Project.toml +++ b/Project.toml @@ -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"] From e18c5f35e3c2b3b196868bae6ce062d170b20268 Mon Sep 17 00:00:00 2001 From: aviatesk Date: Tue, 7 Jan 2020 23:51:55 +0900 Subject: [PATCH 4/5] update comment --- src/WeaveMarkdown/markdown.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/WeaveMarkdown/markdown.jl b/src/WeaveMarkdown/markdown.jl index d16d7ca..67fc575 100644 --- a/src/WeaveMarkdown/markdown.jl +++ b/src/WeaveMarkdown/markdown.jl @@ -4,7 +4,9 @@ using Markdown import Markdown: @trigger, @breaking, Code, MD, withstream, startswith, LaTeX function __init__() - # NOTE: **overwrite** `Markdown.latex` function + # 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"] From d4ce8cdb6bd70ace4435e261421d891318445e48 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Wed, 4 Mar 2020 02:05:04 +0900 Subject: [PATCH 5/5] update travis --- .travis.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e7159a..054ade6 100644 --- a/.travis.yml +++ b/.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()));