Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
enable-pull-request-comment: true
enable-commit-comment: false
enable-commit-status: true
overwrites-pull-request-comment: false
overwrites-pull-request-comment: true
timeout-minutes: 1

- name: Show QuartoNotebookRunner server log
Expand Down
9 changes: 8 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[deps]
AlgebraOfGraphics = "cbdf2221-f076-402e-a563-3d30da359d67"
ArchGDAL = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DataFramesMeta = "1313f7d8-7da2-5740-9ea0-a2ca25f37964"
DimensionalData = "0703355e-b756-11e9-17c0-8b28908087d0"
FlexiJoins = "e37f2e79-19fa-4eb7-8510-b63b51fe0a37"
GeoDataFrames = "62cb38b5-d8d2-4862-a48e-6a340996859f"
Expand All @@ -12,13 +15,17 @@ GeoJSON = "61d90e0f-e114-555e-ac52-39dfb47a3ef9"
GeoMakie = "db073c08-6b98-4ee5-b6a4-5efafb3259c6"
GeometryOps = "3251bfac-6a57-4b6d-aa61-ac1fef2975ab"
LibGEOS = "a90b1aa1-3769-5649-ba7e-abc5a9d163eb"
LightOSM = "d1922b25-af4e-4ba3-84af-fe9bea896051"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
MakieCore = "20f20a25-4f0e-4fdf-b5d1-57303727442b"
NaturalEarth = "436b0209-26ab-4e65-94a9-6526d86fea76"
OSMToolset = "a1c25ae6-0f93-4b3a-bddf-c248cb99b9fa"
OpenStreetMapX = "86cd37e6-c0ff-550b-95fe-21d72c8d4fc9"
Proj = "c94c279d-25a6-4763-9509-64d165bea63e"
Query = "1a8c2f83-1ff3-5112-b086-8aa67b057ba1"
Rasters = "a3a2b9e3-a471-40c9-b274-f788e487c689"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
TidierData = "fe2206b3-d496-4ee9-a338-6a095c4ece80"
Tyler = "e170d443-b9d6-418a-9ee8-061e966341ef"

[compat]
Expand Down
6 changes: 6 additions & 0 deletions _extensions/jjallaire/code-visibility/_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
title: Code Visibility
author: fast.ai
version: 1.0.0
contributes:
filters:
- code-visibility.lua
51 changes: 51 additions & 0 deletions _extensions/jjallaire/code-visibility/code-visibility.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@



-- remove any lines with the hide_line directive.
function CodeBlock(el)
if el.classes:includes('cell-code') then
el.text = filter_lines(el.text, function(line)
return not line:match("#| ?hide_line%s*$")
end)
return el
end
end

-- apply filter_stream directive to cells
function Div(el)
if el.classes:includes("cell") then
local filters = el.attributes["filter_stream"]
if filters then
-- process cell-code
return pandoc.walk_block(el, {
CodeBlock = function(el)
-- CodeBlock that isn't `cell-code` is output
if not el.classes:includes("cell-code") then
for filter in filters:gmatch("[^%s,]+") do
el.text = filter_lines(el.text, function(line)
return not line:find(filter, 1, true)
end)
end
return el
end
end
})

end

end

end

function filter_lines(text, filter)
local lines = pandoc.List()
local code = text .. "\n"
for line in code:gmatch("([^\r\n]*)[\r\n]") do
if filter(line) then
lines:insert(line)
end
end
return table.concat(lines, "\n")
end


3 changes: 3 additions & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ project:
output-dir: docs
execute-dir: project

filters:
- code-visibility

book:
title: "Geocomputation with Julia"
page-footer: "Geocomputation with Julia was written by Maarten Pronk, Rafael Schouten, Anshul Singhvi, and Felix Cremer."
Expand Down
Loading
Loading