Skip to content

Commit

Permalink
feat: adds support for pandoc-crossref
Browse files Browse the repository at this point in the history
  • Loading branch information
filmil committed Feb 2, 2025
1 parent 84e8355 commit c4d4f19
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 22 deletions.
17 changes: 3 additions & 14 deletions build/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,9 @@
#
# This file has been licensed under Apache 2.0 license. Please see the LICENSE
# file at the root of the repository.

load("@bazel//tools/build_defs/repo:utils.bzl", "maybe")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

load(
"@io_bazel_rules_docker//repositories:repositories.bzl",
container_repositories = "repositories",
)
container_repositories()
load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps")

container_deps()
load(
"@io_bazel_rules_docker//container:container.bzl",
"container_pull",
)

def bazel_ebook_dependencies():
pass
2 changes: 1 addition & 1 deletion build/pandoc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def _pandoc_html(ctx, format,
filter_files = filter.files.to_list()
for file in filter_files:
filters += [file]
filter_paths += [file.path]
filters_paths += [file.path]

resource_paths = [file.dirname for file in markdowns + figures]
dir_reference = markdowns[0]
Expand Down
18 changes: 18 additions & 0 deletions build/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,21 @@ def bazel_ebook_repositories():
shallow_since = "1734826764 -0800",
)

maybe(
http_archive,
name = "pandoc_crossref",
urls = [
"https://github.com/lierdakil/pandoc-crossref/releases/download/v0.3.18.1a/pandoc-crossref-Linux-X64.tar.xz",
],
sha256 = "ef74b6682f447e8705105963624076e0410b964b2ae16c8072b2a3e241a044f2",
build_file_content = """
package(default_visibility = ["//visibility:public"])
filegroup(
name = "pandoc_crossref",
srcs = [
"pandoc-crossref",
],
)
""",
)

3 changes: 3 additions & 0 deletions ebook-example/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ pandoc_chunked_html(
],
title = "This is a test title",
toc = True,
filters = [
"@pandoc_crossref//:pandoc_crossref",
],
)

# This packages the files, but ignores the dir paths, which are important.
Expand Down
8 changes: 1 addition & 7 deletions ebook-example/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ local_repository(
name = "bazel_ebook",
path = "..",
)
#git_repository(
#name = "bazel_ebook",
#remote = "https://github.com/filmil/bazel-ebook",
#commit = "09181e87bb1e2ffb2988180438f0f6bb464061c5",
#shallow_since = "1634887024 -0700",
#)


git_repository(
name = "bazel_rules_bid",
Expand All @@ -64,6 +59,5 @@ load(
"@bazel_ebook//build:repositories.bzl",
"bazel_ebook_repositories",
)

bazel_ebook_repositories()

0 comments on commit c4d4f19

Please sign in to comment.