Skip to content
Open
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
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ARG CARGO_TARGET
ARG MDBOOK_MERMAID_VERSION
ARG MDBOOK_TOC_VERSION
ARG MDBOOK_ADMONISH_VERSION
ARG MDBOOK_EXTERNAL_LINKS_VERSION

ENV CARGO_TARGET_DIR="/usr/local/cargo-target"

Expand All @@ -33,6 +34,9 @@ RUN --mount=type=cache,sharing=locked,target=/usr/local/cargo-target \
RUN --mount=type=cache,sharing=locked,target=/usr/local/cargo-target \
cargo install mdbook-admonish --version "${MDBOOK_ADMONISH_VERSION}" --target "${CARGO_TARGET}" && \
strip "$(which mdbook-admonish)"
RUN --mount=type=cache,sharing=locked,target=/usr/local/cargo-target \
cargo install mdbook-external-links --version "${MDBOOK_EXTERNAL_LINKS_VERSION}" --target "${CARGO_TARGET}" && \
strip "$(which mdbook-external-links)"

FROM ${BASE_IMAGE}

Expand All @@ -41,6 +45,7 @@ COPY --from=builder /usr/local/cargo/bin/mdbook /usr/bin/mdbook
COPY --from=builder /usr/local/cargo/bin/mdbook-mermaid /usr/bin/mdbook-mermaid
COPY --from=builder /usr/local/cargo/bin/mdbook-toc /usr/bin/mdbook-toc
COPY --from=builder /usr/local/cargo/bin/mdbook-admonish /usr/bin/mdbook-admonish
COPY --from=builder /usr/local/cargo/bin/mdbook-external-links /usr/bin/mdbook-external-links

WORKDIR /book
ENTRYPOINT [ "/usr/bin/mdbook" ]
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ DOCKER_VERSION := $(shell cat ./deps/Cargo.toml | grep 'mdbook = ' | awk '{print
MDBOOK_MERMAID_VERSION := $(shell cat ./deps/Cargo.toml | grep 'mdbook-mermaid = ' | awk '{print $$3}' | tr -d '"')
MDBOOK_TOC_VERSION := $(shell cat ./deps/Cargo.toml | grep 'mdbook-toc = ' | awk '{print $$3}' | tr -d '"')
MDBOOK_ADMONISH_VERSION := $(shell cat ./deps/Cargo.toml | grep 'mdbook-admonish = ' | awk '{print $$3}' | tr -d '"')
MDBOOK_EXTERNAL_LINKS_VERSION := $(shell cat ./deps/Cargo.toml | grep 'mdbook-external-links = ' | awk '{print $$3}' | tr -d '"')
DOCKER_TAG := v${DOCKER_VERSION}
GITHUB_REF_NAME ?= local
DOCKER_SCOPE := mdbook-${GITHUB_REF_NAME}
Expand Down
25 changes: 25 additions & 0 deletions deps/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions deps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ mdbook = "0.4.40"
mdbook-admonish = "1.17.0"
mdbook-mermaid = "0.13.0"
mdbook-toc = "0.14.2"
mdbook-external-links = "0.1.1"
2 changes: 2 additions & 0 deletions example/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ renderer = ["html"]
command = "mdbook-admonish"
assets_version = "3.0.2" # do not edit: managed by `mdbook-admonish install`

[preprocessor.external-links]

[output.html]
additional-js = ["mermaid.min.js", "mermaid-init.js"]
additional-css = ["mdbook-admonish.css", "/book/mdbook-admonish.css"]
1 change: 1 addition & 0 deletions example/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
- [mdbook-mermaid](./mdbook-mermaid.md)
- [mdbook-toc](./mdbook-toc.md)
- [mdbook-admonish](./mdbook-admonish.md)
- [mdbook-external-links](./mdbook-external-links.md)
20 changes: 20 additions & 0 deletions example/src/mdbook-external-links.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# mdbook-toc

[jonahgoldwastaken/mdbook-external-links: Open external links inside your mdBooks in a different tab.](https://github.com/jonahgoldwastaken/mdbook-external-links)

> Note: Any link starting with http(s) is considered "external"

## Installation

`book.toml`

```toml
[preprocessor.external-links]
```


## Example

```md
[Open IANA's example domain in a new tab](https://example.com)
```