Skip to content

Commit

Permalink
add docs :D
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarusA committed Jan 1, 2024
1 parent 0db570f commit ea27d4c
Show file tree
Hide file tree
Showing 15 changed files with 916 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ build
*.DS_Store
*.mp4
*tmp
docs
docs/docs_site
docs/src/.vitepress/dist
docs/src/.vitepress/cache
Expand Down
96 changes: 96 additions & 0 deletions docs/gen_mds.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
using Literate
using Pkg

get_example_path(p) = joinpath(@__DIR__,"..", "examples", p)
OUTPUT = joinpath(@__DIR__, "src", "examples")

folders = readdir(joinpath(@__DIR__, "..", "examples"))
setdiff!(folders, [".DS_Store"])
setdiff!(folders, ["geo", "rpr", "aog", "datavis"])

function get_files(folders)
srcsfiles = []
for f in folders
p = joinpath(@__DIR__,"..", "examples", f)
if isdir(p)
names = readdir(p)
setdiff!(names, [".DS_Store",
"world_energy.jl",
"gapminder.jl",
"vertical_feature_mask.jl",
"submarine_cables.jl",
"timeseries_proj.jl",
"earthquakes_proj.jl",
"rasters.jl",
])

fpaths = "$(f)/" .* names
srcsfiles = vcat(srcsfiles, fpaths...)
else
srcsfiles = vcat(srcsfiles, f)
end
end
return srcsfiles
end

src_folders = get_files(folders)
srcsfiles = get_files(src_folders)

for p in srcsfiles
Literate.markdown(get_example_path(p), joinpath(OUTPUT, dirname(p));
documenter=true, credit=false)
end

# using Pkg

# ENV["MODERNGL_DEBUGGING"] = "true"; Pkg.build("ModernGL")
# using Literate, ProgressMeter
# using GLMakie
# if !GLMakie.ModernGL.enable_opengl_debugging
# # can't error, since we can't enable debugging for users
# @warn("TESTING WITHOUT OPENGL DEBUGGING")
# end
# get_example_path(p) = joinpath(@__DIR__, "examples", p)
# OUTPUT = joinpath(@__DIR__, "src", "examples", "generated")

# folders = readdir(joinpath(@__DIR__, "examples"))
# setdiff!(folders, [".DS_Store"])
# #setdiff!(folders, ["bars"])
# setdiff!(folders, ["cheat_sheets", "aog"])

# #folders = ["aog"]

# function get_files()
# srcsfiles = []
# for f in folders
# names = readdir(joinpath(@__DIR__, "examples", f))
# setdiff!(names, [".DS_Store", "density_ridges.jl",
# "world_energy.jl", "gapminder.jl",
# "vertical_feature_mask.jl",
# "submarine_cables.jl",
# "timeseries_proj.jl",
# "boxplots_collection.jl",
# "collection_violins.jl",
# "earthquakes_proj.jl",
# "rasters.jl",
# "makie_contributors.jl"])

# fpaths = "$(f)/" .* names
# srcsfiles = vcat(srcsfiles, fpaths...)
# end
# return srcsfiles
# end

# srcsfiles = get_files()

# mkdir("test-record")
# cd("test-record")
# using Makie
# @showprogress for p in srcsfiles
# path = joinpath(@__DIR__, "examples", p)
# println(p)
# fig = Base.evalfile(path)
# fig = Makie.current_figure()
# name = splitext(basename(p))[1]
# save(name * ".png", fig)
# end
Loading

0 comments on commit ea27d4c

Please sign in to comment.