Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re 135: separate indexing and linking by heading depths to keep rewriting id based links #139

Conversation

about-code
Copy link
Owner

Relates to #135.

In #135 and #136 we introduced a new option linking.headingDepths. The previous implementation would exclude headings at a depth not covered by the config from indexing. As a consequence there were no links created anymore for term-based auto linking - as expected - but as a side effect any explicit id-based cross-links [foo](#heading-id) would also not get their paths resolved anymore - which might be unexpected AND unwanted.

For example as a writer I may want the system to create less links out of term-based auto linking while still be able to decide when to have an explicit id-based cross-link.

To accomodate for such scenario this PR introduces an additional option indexing.headingDepths which by default will index headings at depths [1,2,3,4,5,6], so they can still be used in id-based cross-linking and linking.headingDepths will now only affect term-based auto linking. For reasons of backwards compatibility the default here is [2,3,4,5,6] so there won't be auto links for page titles by default.

`indexing.headingDepths` affects term-based link creation as well as path
resolution for existing links using heading ids to refer to a section in
another document. `linking.headingDepths` is the option to actually control
term-based link creation (effectively) based on previously indexed headings.

This commit only adds `indexing.headingDepths`. `linking.headingDepths` was
introduced in 95708c7 of PR #136.
Reordered test-suite to run tests for basic functionality before tests
which are likely to depend on those functionality.
@about-code about-code changed the title 135 separate indexing and linking by heading depths to keep rewriting id based links Re 135: separate indexing and linking by heading depths to keep rewriting id based links Dec 24, 2020
@about-code about-code merged commit 37c7b1e into master Dec 24, 2020
@about-code about-code deleted the 135-separate-indexing-and-linking-by-headingDepths-to-keep-rewriting-id-based-links branch December 24, 2020 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant