Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revamped plotting + abstractplotting #93

Merged
merged 293 commits into from
Jun 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
293 commits
Select commit Hold shift + click to select a range
32bc311
add video output
SimonDanisch Apr 23, 2018
b9c3bb7
translation + mesh + contour fixes
SimonDanisch Apr 25, 2018
5b649d6
add gui
SimonDanisch Apr 27, 2018
05844de
add some new examples
SimonDanisch Apr 27, 2018
50ebcf1
add buttons + playbutton + button(f, ...)
SimonDanisch Apr 27, 2018
90e06b6
respect scene area
SimonDanisch Apr 27, 2018
5813222
add kw_arg overload to colorlegend
SimonDanisch Apr 27, 2018
49d4697
respect framerate from ffmpeg a bit more
SimonDanisch Apr 27, 2018
618d9d3
prepare for a more consistent scene subscene model
SimonDanisch Apr 27, 2018
50b78fb
export more functions
SimonDanisch Apr 27, 2018
5860d35
add transform for scale/rotation/translation
SimonDanisch Apr 27, 2018
a098a9e
perf improvements
SimonDanisch Apr 28, 2018
ea268e4
better rotation speed
SimonDanisch Apr 28, 2018
9444260
more efficient picking
SimonDanisch Apr 28, 2018
7231b72
updateable slider
SimonDanisch Apr 28, 2018
34666f7
export/import more
SimonDanisch May 11, 2018
1f27f27
add attribute conversion shortcuts
SimonDanisch May 11, 2018
11d9f3a
account for transformation being a signal
SimonDanisch May 11, 2018
82b9685
pass through all kw_args
SimonDanisch May 11, 2018
5ba95fb
move argument conversion to own file
SimonDanisch May 11, 2018
d5deeae
introduce some basic logging
SimonDanisch May 11, 2018
402f572
use short notation for attribute conversion
SimonDanisch May 11, 2018
976ce93
fix quaternions
SimonDanisch May 11, 2018
fa3bbe9
more translations
SimonDanisch May 11, 2018
ecbba3b
improvements
SimonDanisch May 11, 2018
7787372
integrate GLVisualize + GLAbstraction into Makie
SimonDanisch May 11, 2018
2fcf936
refactor into abstractplots
SimonDanisch May 14, 2018
fbe868c
fix lookat lookation
SimonDanisch May 14, 2018
f7fdf9f
refactor
SimonDanisch May 16, 2018
5adf558
move help
SimonDanisch May 16, 2018
fb0f166
- introductory paragraphs talking about help
anthony-wang May 17, 2018
b39897c
refactor
SimonDanisch May 18, 2018
b08e000
- Preliminary implementation of handling mapping functions to Types a…
anthony-wang May 18, 2018
9d2218e
- Implement to_func and to_type to convert functions to Type and vice…
anthony-wang May 19, 2018
31835c3
- include documentation.jl in Makie.jl module
anthony-wang May 19, 2018
a055b10
make compilable
anthony-wang May 21, 2018
e6b5ff1
add function argument batch tests
anthony-wang May 21, 2018
ddfef4d
Add descriptions to function arguments
anthony-wang May 22, 2018
e01b10d
Documenting the argument conversion functions in argument_conversion.jl
anthony-wang May 22, 2018
579bf42
- Fix documentation generation error with theme
anthony-wang May 23, 2018
373b688
- Fix help functions
anthony-wang May 23, 2018
2c63cf6
- Document convert_argument functions in argument_conversion.jl
anthony-wang May 23, 2018
6f2cf2d
- Fix argument conversion for the case where Pairs of points don't ha…
anthony-wang May 23, 2018
4584c57
Add preliminary automated documentation generation backends
anthony-wang May 23, 2018
26dfa3f
further refactor
SimonDanisch May 24, 2018
7bf188c
make it compile
SimonDanisch May 24, 2018
6c47286
- Split help functions into internal functions ("_help") and external…
anthony-wang May 25, 2018
a453cf7
- Implement example_database() function to search database for matchi…
anthony-wang May 25, 2018
406cefa
- Print docstrings and example_database() in help functions
anthony-wang May 25, 2018
171af48
- Include library.jl in generate_docs.jl
anthony-wang May 25, 2018
a3b9c15
- Delete current .md files from docs/src directory
anthony-wang May 25, 2018
fa0f913
- Factor out regex match string in make.jl makefile for Documenter
anthony-wang May 25, 2018
f145cbc
Revert "- Delete current .md files from docs/src directory"
anthony-wang May 26, 2018
433f572
- Export example_database function in Makie
anthony-wang May 27, 2018
fc16923
make drawing work
SimonDanisch May 28, 2018
256a838
fix backend
SimonDanisch May 28, 2018
4e1bb74
fix nonboolean error
SimonDanisch May 28, 2018
1409515
Merge remote-tracking branch 'origin/sd/newdesign' into aw/documentation
anthony-wang May 28, 2018
1fd65fa
- Extend example_database function to handle input of functions and t…
anthony-wang May 29, 2018
81d9d66
get text to draw
SimonDanisch May 29, 2018
69d2f30
make plotting work
SimonDanisch May 30, 2018
43dcb07
Filter out fxaa from attributes in help function
anthony-wang May 30, 2018
29b48be
Fix list numbering in index.md
anthony-wang May 30, 2018
9befabb
Fix formatting in docstring
anthony-wang May 30, 2018
344fefd
Fix to_type function
anthony-wang May 30, 2018
1ce11fd
Upload test logo for documentation
anthony-wang May 30, 2018
c9044db
Minor documentation edits in index.md
anthony-wang May 30, 2018
010e4e4
Make print_code function not print so many blank lines
anthony-wang May 30, 2018
f0389c1
Print plot attribute values as symbols if applicable (by using show)
anthony-wang May 30, 2018
a2694d3
Don't print all plot examples when using help function -- just say th…
anthony-wang May 30, 2018
20b6ef6
fix cairo and some other primitives
SimonDanisch May 31, 2018
30b5b25
Let example_database handle also (an arbitrary number of) function ha…
anthony-wang May 31, 2018
9d5e7e9
- Refactor example_database function into a core find_indices function
anthony-wang May 31, 2018
fd79d1f
Short rewrite of functions.md
anthony-wang May 31, 2018
223e5b6
Rewrite docstrings of atomics plotting functions
anthony-wang May 31, 2018
187bc26
Formatting of index.md
anthony-wang May 31, 2018
ee36195
println one extra blank line
anthony-wang May 31, 2018
73261be
Fix small typo in output.md
anthony-wang Jun 1, 2018
888479d
- Add print_source and _print_source functions to pretty-print code f…
anthony-wang Jun 1, 2018
0fd0780
Extend to_string to also handle strings as input
anthony-wang Jun 1, 2018
31f482a
- Start implementing gallery pages for listing all tags and example code
anthony-wang Jun 1, 2018
a5def39
Fix minor typo
anthony-wang Jun 2, 2018
8a35349
Code cleanup
anthony-wang Jun 2, 2018
c7525b9
Add handling of to_type(::Type)
anthony-wang Jun 2, 2018
084662c
Add list of atomics functions
anthony-wang Jun 2, 2018
57d8505
Automatic generation of atomic functions overview page
anthony-wang Jun 2, 2018
62159ef
Automatic generation of detailed overviews of atomic functions
anthony-wang Jun 2, 2018
6aec6ba
improve cairo backend!
SimonDanisch Jun 3, 2018
5cf47ad
Generator for example gallery of all tags - include all plot examples
anthony-wang Jun 3, 2018
62e91d3
Small changes in make.jl for Documenter
anthony-wang Jun 3, 2018
895798f
make.jl - comment out some pages for testing makedocs, and add some p…
anthony-wang Jun 3, 2018
29305cc
Example gallery for tags - include 1 random plot example
anthony-wang Jun 3, 2018
966eab1
Documenter selectors and runners - alternative implementation (WIP)
anthony-wang Jun 3, 2018
c479e45
Change overloading of Base.show
anthony-wang Jun 3, 2018
a304946
_print_source -> better handling of bad language flavor in input
anthony-wang Jun 3, 2018
fac5687
Testing Documenter search & embedding of example code in functions.md…
anthony-wang Jun 3, 2018
c5309ed
Add allowed types of meshes (WIP) -> figure out where to place this d…
anthony-wang Jun 3, 2018
af488b4
Documentation for function signatures handled by Makie
anthony-wang Jun 3, 2018
98e433d
WIP: handle edge case of different argument types in find_indices()
anthony-wang Jun 3, 2018
9872417
Wordcloud test with Vega
anthony-wang Jun 3, 2018
cde5dcd
WIP: Code snippets etc for testing stuff
anthony-wang Jun 3, 2018
6da0374
Add wordcloud page
anthony-wang Jun 3, 2018
4ba8dbd
Add help_functions.md documentation page
anthony-wang Jun 3, 2018
5082dd2
Add linking test for Documenter
anthony-wang Jun 3, 2018
5cb0b6e
fix output
SimonDanisch Jun 3, 2018
0ac7a3a
fix get_texture!
SimonDanisch Jun 3, 2018
d81dde3
fix get_texture order
SimonDanisch Jun 3, 2018
75fb807
remove debug
SimonDanisch Jun 3, 2018
60a50db
Update tags_wordcloud.md
anthony-wang Jun 3, 2018
4025b3a
Delete test.png
anthony-wang Jun 3, 2018
581882f
Merge branch 'sd/abstract' into aw/documentation and resolve merge co…
anthony-wang Jun 3, 2018
d363be0
Update Makie logo (credit: @LeMinaw in Makie issue #73)
anthony-wang Jun 3, 2018
37473d5
display system
SimonDanisch Jun 5, 2018
9d00084
Merge branch 'sd/abstract' of github.com:JuliaPlots/Makie.jl into sd/…
SimonDanisch Jun 5, 2018
24035c3
Automation testing of example library including plots
anthony-wang Jun 5, 2018
89a0c9c
Manual testing of examples library
anthony-wang Jun 5, 2018
d192fd9
Add back missing assets used in example plots
anthony-wang Jun 5, 2018
10a00a2
Merge remote-tracking branch 'origin/sd/abstract' into aw/documentation
anthony-wang Jun 5, 2018
97e487a
move center to abstractplotting + fix insertscene
SimonDanisch Jun 5, 2018
04c44d1
Merge remote-tracking branch 'origin/sd/abstract' into aw/documentation
anthony-wang Jun 5, 2018
ff75b3a
work on text boundingbox
SimonDanisch Jun 6, 2018
b120ecc
Add missing asset
anthony-wang Jun 6, 2018
ce4e955
Updated library.jl with non-working examples' error messages
anthony-wang Jun 6, 2018
cf295a7
add image scatter example
SimonDanisch Jun 6, 2018
bce0a06
Merge branch 'aw/documentation' into sd/abstract
SimonDanisch Jun 6, 2018
987253e
fix example database
SimonDanisch Jun 6, 2018
39fd32e
fix help
SimonDanisch Jun 6, 2018
34a23bb
update required packages
SimonDanisch Jun 6, 2018
4c131e8
Merge pull request #90 from JuliaPlots/sd/abstract
anthony-wang Jun 6, 2018
1fc822e
Add overloading Base.show for type Array{CellEntry,1}
anthony-wang Jun 7, 2018
ac986be
Add printing of "```example" code block to _print_source function
anthony-wang Jun 7, 2018
daa3e01
Add auto-generation of docs with with all example library source code…
anthony-wang Jun 7, 2018
4c2cdf0
Improve docstrings
anthony-wang Jun 8, 2018
fd6d2e9
Rename linking header test markdown page
anthony-wang Jun 8, 2018
5b0e5f9
fix segfault
SimonDanisch Jun 8, 2018
eb72d48
Merge remote-tracking branch 'origin/sd/abstract' into aw/documentation
anthony-wang Jun 9, 2018
39291f2
`Color` -> `Colors`
anthony-wang Jun 10, 2018
a5451f5
Merge remote-tracking branch 'origin/sd/abstract' into aw/documentation
anthony-wang Jun 10, 2018
e95be0b
Update some docs pages
anthony-wang Jun 10, 2018
3c984bf
Minor change to help function
anthony-wang Jun 10, 2018
f1cd394
Example library - fixes to make plottable, and hide all non-working e…
anthony-wang Jun 10, 2018
62fa378
Improve auto-generation of documentation
anthony-wang Jun 10, 2018
5518466
Rename documentation pages sitename
anthony-wang Jun 10, 2018
0775f56
export GLNormalUVMesh
SimonDanisch Jun 11, 2018
d4ef545
use logo as image
SimonDanisch Jun 11, 2018
65fb13d
refactor make
SimonDanisch Jun 11, 2018
c366d1a
add gitignore for generated files
SimonDanisch Jun 11, 2018
5f3c75a
fix video recording
SimonDanisch Jun 11, 2018
4498bef
Merge remote-tracking branch 'origin/sd/abstract' into aw/documentation
anthony-wang Jun 11, 2018
86204d3
print path for videos
SimonDanisch Jun 11, 2018
4105d28
Merge remote-tracking branch 'origin/sd/abstract' into aw/documentation
anthony-wang Jun 11, 2018
deeb6d8
Prettify example gallery
anthony-wang Jun 11, 2018
eeb04de
Trying to fix video export
anthony-wang Jun 11, 2018
daadd50
Extend to_string function
anthony-wang Jun 11, 2018
73b9928
fix video output
SimonDanisch Jun 11, 2018
b3f6eb6
create THE media!
SimonDanisch Jun 11, 2018
1c7a361
fix group bug
SimonDanisch Jun 12, 2018
160c72b
remove imports
SimonDanisch Jun 12, 2018
753e53a
fix image, remove println
SimonDanisch Jun 12, 2018
85fdd35
Improve and fix some examples in library.jl
anthony-wang Jun 12, 2018
5e05d54
Merge remote-tracking branch 'origin/sd/abstract' into aw/documentation
anthony-wang Jun 12, 2018
8d81cf9
remove imports
SimonDanisch Jun 12, 2018
e165791
add logo function
SimonDanisch Jun 12, 2018
fd48ad9
fix contours
SimonDanisch Jun 12, 2018
170d02b
clean up samples
SimonDanisch Jun 12, 2018
61084ab
Merge branch 'aw/documentation' into sd/abstract
SimonDanisch Jun 12, 2018
b28ffc5
fix gif
SimonDanisch Jun 12, 2018
861b00a
Refactored generation of plots using generate_plots.jl instead of rel…
anthony-wang Jun 12, 2018
6930405
Handle embedding video in Markdown pages for Documenter
anthony-wang Jun 12, 2018
fb4642d
generate_thumbnail function to generate thumbnails for example gallery
anthony-wang Jun 12, 2018
0708811
Switch to MD generation using pre-generated plots from generate_plots.jl
anthony-wang Jun 12, 2018
16c7e60
remove using statements
SimonDanisch Jun 12, 2018
40ab1af
add using makie to toplevel
SimonDanisch Jun 12, 2018
4f01745
fix + add examples
SimonDanisch Jun 12, 2018
e017ecc
move examples to library
SimonDanisch Jun 12, 2018
93b103e
savely import Contour
SimonDanisch Jun 12, 2018
ec3cb8b
Remove unused code
anthony-wang Jun 12, 2018
f92688b
Merge remote-tracking branch 'origin/sd/abstract' into aw/documentation
anthony-wang Jun 12, 2018
becbf09
Disable printing using statements unless explicitely in library.jl
anthony-wang Jun 12, 2018
f1fe81b
Fix some examples in library, standardize N (usually # of steps) for …
anthony-wang Jun 13, 2018
2069971
Specify IO type in help function + add clarification docstring
anthony-wang Jun 13, 2018
5225024
Move documentation about general func signatures and usage to functio…
anthony-wang Jun 13, 2018
871128b
Move help functions to AbstractPlotting
anthony-wang Jun 13, 2018
0e7e615
Make make.jl work with documentation in AbstractPlotting
anthony-wang Jun 13, 2018
9ba5bbe
remove deps
SimonDanisch Jun 13, 2018
555b0c8
make text work for utf8 + opengl
SimonDanisch Jun 13, 2018
4064de5
open should be equal to run
SimonDanisch Jun 13, 2018
5e926fb
Merge branch 'sd/abstract' of https://github.com/JuliaPlots/Makie.jl …
SimonDanisch Jun 13, 2018
74db7aa
Add thumbnail generation for videos
anthony-wang Jun 13, 2018
6c5f78f
Improve docstring for "save" in video_io.jl
anthony-wang Jun 13, 2018
080412c
Generate .png thumbnails for videos, not .jpg
anthony-wang Jun 13, 2018
450c976
Fix examples in library + add my first example!
anthony-wang Jun 13, 2018
8ab0073
Library: undo some changes in plotting to scene
anthony-wang Jun 13, 2018
a5e5375
Merge remote-tracking branch 'origin/sd/abstract' into aw/documentation
anthony-wang Jun 13, 2018
0edc6ea
fix gif export when imagemagick is loaded
SimonDanisch Jun 14, 2018
2c29a81
Update gitignore to ignore jpg
anthony-wang Jun 14, 2018
b284012
Add embed_thumbnail function to insert embed code for plot thumbnails
anthony-wang Jun 14, 2018
ede0f82
ImageMagick -> export .jpg thumbnails instead of .png due to https://…
anthony-wang Jun 14, 2018
2026a8c
Small formatting fix in documentation
anthony-wang Jun 14, 2018
b00c127
Code cleanup and factor out many paths used in Documenter building
anthony-wang Jun 14, 2018
96d0662
add examples
SimonDanisch Jun 15, 2018
d0e1690
remove unused files
SimonDanisch Jun 15, 2018
e2790a5
print string as debug
SimonDanisch Jun 15, 2018
67ff5ee
export more names
SimonDanisch Jun 15, 2018
63fac1f
access args indirectly
SimonDanisch Jun 15, 2018
0fd4bff
transfer volume slice recipe
SimonDanisch Jun 15, 2018
cca2edb
add + fix examples
SimonDanisch Jun 15, 2018
fb204b6
Merge branch 'aw/documentation' into sd/abstract
SimonDanisch Jun 15, 2018
f1b563d
remove dups, add mouse scatter
SimonDanisch Jun 15, 2018
83c13bc
fix markers
SimonDanisch Jun 15, 2018
1fb62b8
remove samples moved to library
SimonDanisch Jun 15, 2018
4925c8d
fix + improve generate docs
SimonDanisch Jun 15, 2018
41588ee
show error
SimonDanisch Jun 15, 2018
36dde76
move function to generate_plots
SimonDanisch Jun 15, 2018
60a66a5
remove unused boundingbox
SimonDanisch Jun 16, 2018
911610d
fix mesh examples
SimonDanisch Jun 16, 2018
f3a4749
add fem examples @ChrisRackauckas @ysimillides
SimonDanisch Jun 16, 2018
39d59a4
correct path
SimonDanisch Jun 16, 2018
a0a5e82
fix textured mesh
SimonDanisch Jun 16, 2018
f1f3941
further port examples
SimonDanisch Jun 16, 2018
e714729
remove unfinished do
SimonDanisch Jun 16, 2018
79ac12c
add contour to examples
SimonDanisch Jun 16, 2018
0f145c7
image scatter + contour3d
SimonDanisch Jun 16, 2018
3977cd7
fix contour3d
SimonDanisch Jun 16, 2018
693585e
improve example
SimonDanisch Jun 17, 2018
53a9204
improve comment
SimonDanisch Jun 17, 2018
d148e52
refactor to filter results
SimonDanisch Jun 18, 2018
cae5cd6
fix syntax
SimonDanisch Jun 18, 2018
08a6b6f
fix contour
SimonDanisch Jun 18, 2018
ac3fd51
ignore gifs
SimonDanisch Jun 18, 2018
0aab668
change to splat
SimonDanisch Jun 18, 2018
7bfafce
add color per particle from cmap
SimonDanisch Jun 18, 2018
ce126ab
add gitlab
SimonDanisch Jun 18, 2018
c91afee
clean up + fix tests
SimonDanisch Jun 18, 2018
3796437
add DISPLAY env
SimonDanisch Jun 18, 2018
7708b46
remove clfft
SimonDanisch Jun 18, 2018
ef8e68b
clean up + more output
SimonDanisch Jun 18, 2018
db74640
make use of more consistent scatter
SimonDanisch Jun 18, 2018
6299af8
add ffmpeg
SimonDanisch Jun 18, 2018
b75aa80
dont export DISPLAY
SimonDanisch Jun 19, 2018
df2a1f0
fix and add fem poly example
SimonDanisch Jun 19, 2018
2efbbc3
add MeshIO
SimonDanisch Jun 20, 2018
607216d
dont use fontconfig no more
SimonDanisch Jun 20, 2018
b627db6
remove unused ci
SimonDanisch Jun 20, 2018
beb1a65
remove failing examples
SimonDanisch Jun 20, 2018
dbf6776
try to slim down makie
SimonDanisch Jun 20, 2018
991be2f
fix poly
SimonDanisch Jun 20, 2018
3a40038
add fem example
SimonDanisch Jun 20, 2018
c23279a
dont need fontconfig anymore
SimonDanisch Jun 20, 2018
f06e61c
checkout first
SimonDanisch Jun 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
*.jl.*.cov
*.jl.mem
precompile.jl
build
src/glbackend/.cache
26 changes: 26 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
variables:
JULIA_PKGDIR: "$CI_PROJECT_DIR/.julia/"
package: 'Makie'

.test_template: &test_definition
before_script:
- apt-get -qq update
# glfw
- apt-get install -y cmake libxrandr-dev libxinerama-dev libxcursor-dev mesa-utils
# cairo etc
- apt-get install -y gettext libpango1.0-0 libcairo2 libmagickwand-6.q16-2
- apt-get install -y ffmpeg

script:
- glxinfo | grep version
- julia -e 'Pkg.init();Pkg.clone("https://github.com/JuliaPlots/AbstractPlotting.jl.git")'
- julia -e 'Pkg.checkout("FreeTypeAbstraction"); Pkg.checkout("FreeTypeAbstraction", "sd/06")'
# actual testing
- julia -e "symlink(\"$CI_PROJECT_DIR\", Pkg.dir(\"$package\"));
Pkg.resolve();
Pkg.build(\"$package\");
Pkg.test(\"$package\")"

test:0.6:
image: juliagpu/julia:v0.6-opengl
<<: *test_definition
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

16 changes: 10 additions & 6 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
julia 0.6

Quaternions
GLVisualize
StaticArrays 0.6.6
GeometryTypes 0.4.4
GeometryTypes 0.4.5
Reactive 0.6.0
GLAbstraction 0.6.0
GLWindow 0.7.1
AbstractNumbers 0.1.1
Colors
ColorVectorSpace
Contour
FileIO
Images
Expand All @@ -18,10 +17,15 @@ Hiccup
Media
Juno
ModernGL
GLFW 1.4.1
Fontconfig
GLFW 2.0.0-alpha
FreeType
FreeTypeAbstraction
IntervalSets
Primes

Cairo
Showoff
PlotUtils

@windows ImageMagick
@linux ImageMagick
Expand Down
47 changes: 0 additions & 47 deletions appveyor.yml

This file was deleted.

9 changes: 0 additions & 9 deletions deps/build.jl

This file was deleted.

8 changes: 8 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
build
examples-database.md
examples-for-tags.md
functions-autogen.md
atomics_examples/
*.png
*.jpg
*.mp4
*.gif
110 changes: 110 additions & 0 deletions docs/documenter_extension.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@

using Documenter: Selectors, Expanders, Markdown
using Documenter.Markdown: Link, Paragraph
struct DatabaseLookup <: Expanders.ExpanderPipeline end

Selectors.order(::Type{DatabaseLookup}) = 0.5
Selectors.matcher(::Type{DatabaseLookup}, node, page, doc) = false

const regex_pattern = r"example_database\(([\"a-zA-Z_0-9. ]+)\)"
const atomics = (
heatmap,
image,
lines,
linesegments,
mesh,
meshscatter,
scatter,
surface,
text,
Makie.volume
)

match_kw(x::String) = ismatch(regex_pattern, x)
match_kw(x::Paragraph) = any(match_kw, x.content)
match_kw(x::Any) = false
Selectors.matcher(::Type{DatabaseLookup}, node, page, doc) = match_kw(node)

# ============================================= Simon's implementation
function look_up_source(database_key)
entries = find(x-> x.title == database_key, database)
# current implementation finds titles, but we can also search for tags too
isempty(entries) && error("No entry found for database reference $database_key")
length(entries) > 1 && error("Multiple entries found for database reference $database_key")
sprint() do io
print_code(
io, database, entries[1],
scope_start = "",
scope_end = "",
indent = "",
resolution = (entry)-> "resolution = (500, 500)",
outputfile = (entry, ending)-> Pkg.dir("Makie", "docs", "media", string(entry.unique_name, ending))
)
end
end
function Selectors.runner(::Type{DatabaseLookup}, x, page, doc)
matched = nothing
for elem in x.content
if isa(elem, AbstractString)
matched = match(regex_pattern, elem)
matched != nothing && break
end
end
matched == nothing && error("No match: $x")
# The sandboxed module -- either a new one or a cached one from this page.
database_keys = filter(x-> !(x in ("", " ")), split(matched[1], '"'))
content = map(database_keys) do database_key
Markdown.Code("julia", look_up_source(database_key))
end
# Evaluate the code block. We redirect stdout/stderr to `buffer`.
page.mapping[x] = Markdown.MD(content)
end

"""
embed_video(relapath::AbstractString)

Generates a MD-formatted string for embedding video into Markdown files
(since `Documenter.jl` doesn't support directly embedding mp4's).
"""
function embed_video(relapath::AbstractString)
return str = """
```@raw html
<video controls autoplay>
<source src="$(relapath)" type="video/mp4">
Your browser does not support mp4. Please use a modern browser like Chrome or Firefox.
</video>
```
"""
end


"""
embed_thumbnail(func::Function)

Insert thumbnails matching a search tag.
"""
function embed_thumbnail(io::IO, func::Function)
indices = find_indices(func)
# namesdict = Dict(database[idx].unique_name => database[idx].title for idx in indices)
for idx in indices
uname = database[idx].unique_name
title = database[idx].title
# TODO: currently exporting video thumbnails as .jpg because of ImageMagick issue#120
testpath1 = joinpath(mediapath, "thumb-$uname.png")
testpath2 = joinpath(mediapath, "thumb-$uname.jpg")
if isfile(testpath1)
embedpath = relpath(testpath1, atomicspath)
println(io, "![]($(embedpath))")
# [![Alt text](/path/to/img.jpg)](http://example.net/)
# println(io, "[![$title]($(embedpath))](@ref)")
elseif isfile(testpath2)
embedpath = relpath(testpath2, atomicspath)
println(io, "![]($(embedpath))")
# println(io, "[![$title]($(embedpath))](@ref)")
else
warn("thumbnail for index $idx with uname $uname not found")
embedpath = "not_found"
end
embedpath = []
end
end
Loading