Skip to content

Commit 8121952

Browse files
committed
feat: readme filter now handles links with anchors
1 parent d9be363 commit 8121952

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ You can configure quartodoc alongside the rest of your Quarto site in
4747
the
4848
[`_quarto.yml`](https://quarto.org/docs/projects/quarto-projects.html)
4949
file you are already using for Quarto. To [configure
50-
quartodoc](basic-docs.qmd#site-configuration), you need to add a
51-
`quartodoc` section to the top level your `_quarto.yml` file. Below is a
52-
minimal example of a configuration that documents the `quartodoc`
53-
package:
50+
quartodoc](https://machow.github.io/quartodoc/get-started/basic-docs.html#site-configuration),
51+
you need to add a `quartodoc` section to the top level your
52+
`_quarto.yml` file. Below is a minimal example of a configuration that
53+
documents the `quartodoc` package:
5454

5555
``` yaml
5656
project:

docs/_filters/replace-readme-links.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ function Link(link)
1010
-- e.g. ./overview.qmd -> {replace_rel_path}/get-started/overview.html
1111
-- e.g. /index.qmd -> {replace_base_domain}/index.html
1212
-- e.g. https://example.com -> https://example.com
13-
if link.target:match("%.qmd$") then
14-
link.target = link.target:gsub("%.qmd$", ".html")
13+
if link.target:match("%.qmd$") or link.target:match("%.qmd#.*$") then
14+
link.target = link.target:gsub("%.qmd", ".html")
1515
if link.target:match("^%./") then
1616
link.target = link.target:gsub("^%./", replace_base_domain .. replace_rel_path .. "/")
1717
end

docs/get-started/overview.qmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ If you haven't already, you'll need to [install Quarto](https://quarto.org/docs/
7070

7171
Getting started with quartodoc takes two steps: configuring quartodoc, then generating documentation pages for your library.
7272

73-
You can configure quartodoc alongside the rest of your Quarto site in the [`_quarto.yml`](https://quarto.org/docs/projects/quarto-projects.html) file you are already using for Quarto. To [configure quartodoc](basic-docs.qmd#site-configuration), you need to add a `quartodoc` section to the top level your `_quarto.yml` file. Below is a minimal example of a configuration that documents the `quartodoc` package:
73+
You can configure quartodoc alongside the rest of your Quarto site in the [`_quarto.yml`](https://quarto.org/docs/projects/quarto-projects.html) file you are already using for Quarto. To [configure quartodoc](./basic-docs.qmd#site-configuration), you need to add a `quartodoc` section to the top level your `_quarto.yml` file. Below is a minimal example of a configuration that documents the `quartodoc` package:
7474

7575
```yaml
7676
project:
@@ -161,5 +161,5 @@ Go [to the next page](basic-docs.qmd) to learn how to configure quartodoc sites,
161161

162162
* [Examples page](/examples/index.qmd): sites using quartodoc.
163163
* [Tutorials page](/tutorials/index.qmd): screencasts of building a quartodoc site.
164-
* [Docstring issues and examples](docstring-examples.qmd): common issues when formatting docstrings.
165-
* [Programming, the big picture](dev-big-picture.qmd): the nitty gritty of how quartodoc works, and how to extend it.
164+
* [Docstring issues and examples](./docstring-examples.qmd): common issues when formatting docstrings.
165+
* [Programming, the big picture](./dev-big-picture.qmd): the nitty gritty of how quartodoc works, and how to extend it.

0 commit comments

Comments
 (0)