Compare commits

...

26 Commits

Author SHA1 Message Date
Sebastian Pfitzner 77793c775c
Merge pull request #481 from dlfivefifty/patch-2
Mention Quarto in Related Packages
2024-04-16 12:50:53 +02:00
Sheehan Olver ad0885ce00
Update README.md 2024-04-16 11:43:11 +01:00
Sebastian Pfitzner e10aaefd94
Merge pull request #469 from laborg/master
Update RelocatableFolders dependency
2023-02-10 10:39:25 +01:00
Sebastian Pfitzner 8ad4e876d3
Merge pull request #448 from xgdgsc/patch-1
display example needs to be fixed
2023-02-10 10:32:25 +01:00
Sebastian Pfitzner af2a6e14c9
Merge pull request #462 from NicholasWMRitchie/nwmr
Force deletion of the temporary figure path to address Issue #440
2023-02-10 10:32:01 +01:00
Sebastian Pfitzner 20aaefec0a
Merge pull request #465 from newptcai/font-size
Removed hard coded font size for PDF
2023-02-10 10:29:31 +01:00
Gerhard Aigner 2a78676d41 update relocatablefolders.jl dependency 2023-02-10 09:04:49 +01:00
Gerhard Aigner 59332c1768 relax dataframe displayed row counting 2023-02-10 09:02:10 +01:00
Sebastian Pfitzner db28a69d94
Merge pull request #468 from dlfivefifty/patch-1
Mention Literate.jl in README.md
2023-01-18 16:55:11 +01:00
Sheehan Olver 0b96591f39
Mention Literate.jl in README.md 2023-01-18 14:52:44 +00:00
Sebastian Pfitzner a38cec95db
0.10.11 2022-12-12 10:02:01 +01:00
Sebastian Pfitzner 562f8e4ab3
v0.10.12 2022-12-12 09:17:50 +01:00
Sebastian Pfitzner 9f666b3bb5
Merge pull request #466 from KristofferC/kc/require
avoid warning when using Weave in a sysimage
2022-12-12 09:17:27 +01:00
KristofferC a63577f69c avoid warning when using Weave in a sysimage 2022-12-07 11:14:48 +01:00
Xing Shi Cai 7e0f5641c2 Removed hard coded font size for PDF 2022-10-19 14:37:58 +08:00
Nicholas W. M. Ritchie b022a54458 Add isnothing(fig_path) check 2022-07-13 09:51:59 -04:00
Nicholas W. M. Ritchie b669a14038 Force deletion of the temporary figure path to address Issue #440 2022-07-13 09:35:48 -04:00
Sebastian Pfitzner b7941c2811
Merge pull request #457 from ExpandingMan/em/highlightup
bumped highlights version
2022-05-19 16:09:14 +02:00
ExpandingMan d40e95a4bb bumped highlights version 2022-05-19 09:43:14 -04:00
xgdgsc df47ea191f
HTML( 2022-02-14 15:33:21 +08:00
Sebastian Pfitzner 381de22c7d
Merge pull request #428 from JunoLab/compathelper/new_version/2021-06-22-00-09-55-226-3473194155
CompatHelper: add new compat entry for "RelocatableFolders" at version "0.1"
2021-06-22 10:05:31 +02:00
github-actions[bot] 06b259a7b0 CompatHelper: add new compat entry for "RelocatableFolders" at version "0.1" 2021-06-22 00:09:55 +00:00
Sebastian Pfitzner 749c0c262c
v0.10.10 2021-06-21 09:49:07 +02:00
Sebastian Pfitzner 696db1d82b
Merge pull request #426 from MichaelHatherly/mh/package-compiler-friendly-assets
Make assets `PackageCompiler`-friendly
2021-06-21 09:48:51 +02:00
Mike d4c65729e4
Use `RelocatableFolders` for assets folders. 2021-06-18 09:50:38 +01:00
Mike 1dfb8d76d6
Make assets `PackageCompiler`-friendly
A possible solution to relocatablilty issues with the hardcoded paths.

Embeds the asset folder contents into the precompiled files. When the
original folder isn't available (due to relocation) creates a
scratchspace containing the original folder contents as uses that
instead.
2021-06-12 09:21:20 +01:00
8 changed files with 21 additions and 13 deletions

View File

@ -1,6 +1,6 @@
name = "Weave"
uuid = "44d3d7a6-8a23-5bf8-98c5-b353f8df5ec9"
version = "0.10.9"
version = "0.10.12"
[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
@ -12,15 +12,17 @@ Mustache = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
RelocatableFolders = "05181044-ff0b-4ac5-8273-598c1e38db00"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
[compat]
Highlights = "0.3.1, 0.4"
Highlights = "0.3.1, 0.4, 0.5"
JSON = "0.21"
Mustache = "0.4.1, 0.5, 1"
Plots = "0.28, 0.29, 1.0"
RelocatableFolders = "0.1,0.2,0.3,1"
Requires = "1.0"
YAML = "0.3, 0.4"
julia = "1.2"

View File

@ -97,3 +97,8 @@ Thanks for the important additions, fixes and comments.
- [DiffEqTutorials.jl](https://github.com/JuliaDiffEq/DiffEqTutorials.jl) uses Weave to output tutorials (`.jmd` documents) to html, pdf and Jupyter notebooks.
- [TuringTutorials](https://github.com/TuringLang/TuringTutorials) uses Weave to convert notebooks to html.
## Related packages
- [Literate.jl](https://github.com/fredrikekre/Literate.jl) can be used to generate Markdown and Jupyter notebooks directly from Julia source files with markdown in comments.
- [Quarto](https://quarto.org) can generate Jupyter notebooks, HTML, or PDF directly from a Markdown format containing Julia code blocks, and also works with R and Python.

View File

@ -130,7 +130,7 @@ e.g. to include a Plots figure in markdown you can use:
```
or to produce any HTML output:
```
! display("text/html", "Header from julia");
! display("text/html", HTML("Header from julia"));
```
### Script Format

View File

@ -1,14 +1,13 @@
module Weave
using Highlights, Mustache, Requires, Pkg, REPL
using Highlights, Mustache, Requires, Pkg, REPL, RelocatableFolders, Base64
# directories
const PKG_DIR = normpath(@__DIR__, "..")
const TEMPLATE_DIR = normpath(PKG_DIR, "templates")
const STYLESHEET_DIR = normpath(PKG_DIR, "stylesheets")
const TEMPLATE_DIR = @path joinpath(PKG_DIR, "templates")
const STYLESHEET_DIR = @path joinpath(PKG_DIR, "stylesheets")
# keeps paths of sample documents for easy try
const EXAMPLE_FOLDER = normpath(PKG_DIR, "examples")
const EXAMPLE_FOLDER = @path joinpath(PKG_DIR, "examples")
# constant names
const WEAVE_OPTION_NAME = "weave_options"
@ -244,12 +243,12 @@ function specific_options!(weave_options, doctype)
end
get_out_path(doc, out_path, ext::Nothing = nothing) = get_out_path(doc, out_path, doc.format.extension)
function get_out_path(doc, out_path, ext)
function get_out_path(doc, out_path, ext)
if (out_path === :doc) || (out_path === :pwd)
abspath(get_cwd(doc, out_path), string(doc.basename, '.', ext))
elseif isempty(splitext(out_path)[2]) # directory given
abspath(get_cwd(doc, out_path), string(doc.basename, '.', ext))
else
else
# out_path is given, but if extension is explitly provided override this will override the extension
abspath(string(splitext(out_path)[1], '.', ext))
end

View File

@ -1,6 +1,6 @@
module WeavePlots
using Base64, ..Plots, ..Weave
using ..Base64, ..Plots, ..Weave
# Pre-execute hooks to set the plot size for the chunk

View File

@ -90,6 +90,8 @@ function run_doc(
@info "Weaved all chunks" progress=1 _id=PROGRESS_ID
cd_back()
popdisplay(report) # ensure display pops out even if internal error occurs
# Temporary fig_path is not automatically removed because it contains files so...
!isnothing(fig_path) && startswith(fig_path, "jl_") && rm(normpath(cwd, fig_path), force=true, recursive=true)
end
return doc

View File

@ -61,7 +61,7 @@ function write_doc(docformat::Pandoc2PDF, doc, rendered, out_path)
cmd = `pandoc -f markdown+raw_tex -s --pdf-engine=xelatex --highlight-style=tango
$filt $citeproc $(docformat.pandoc_options)
--include-in-header=$(docformat.header_template)
-V fontsize=12pt -o $(out)`
-o $(out)`
proc = open(cmd, "r+")
println(proc.in, rendered)
close(proc.in)

View File

@ -10,7 +10,7 @@ DataFrame(a=rand(10))
```
"""; doctype = "md2html")
@test isdefined(doc.chunks[1], :rich_output)
@test count("<tr>", doc.chunks[1].rich_output) == 12 # additonal 2 for name and type row
@test count("<tr", doc.chunks[1].rich_output) == 12 # additonal 2 for name and type row
# limit
n = 100000