Commit Graph

3071 Commits

Author SHA1 Message Date
Eric Huss
8385e750ec Merge pull request #2951 from ehuss/fa-improvements
Font Awesome fixes and improvements
2025-11-20 00:24:35 +00:00
Eric Huss
8571d70b52 Update the documentation for Font Awesome
This updates the documentation to try to improve the Font Awesome
support.
2025-11-19 16:15:53 -08:00
Eric Huss
4b5ea14ee1 Support new font-awesome class names
In version 6, Font Awesome changed so that the class names look like
`fa-solid fa-cat` instead of `fas fa-cat`. This updates so that it
handles this new style.
2025-11-19 16:04:34 -08:00
Eric Huss
c53379e3ac Add a test using full fontawesome type names
In version 6, Font Awesome changed so that the class names look like
`fa-solid fa-cat` instead of `fas fa-cat`. mdBook is not handling the
new style.
2025-11-19 15:56:54 -08:00
Eric Huss
6bf7fadc29 Merge pull request #2943 from ehuss/config-changelog
Add some more 0.5 Config API changes
v0.5.0
2025-11-17 23:27:24 +00:00
Eric Huss
d193775a3b Add some more 0.5 Config API changes
I forgot these in https://github.com/rust-lang/mdBook/pull/2942
2025-11-17 15:21:42 -08:00
Eric Huss
8e4bc4aecd Merge pull request #2942 from ehuss/fix-env-config
Add error handling to env config handling
2025-11-17 22:48:19 +00:00
Eric Huss
2afad43bdd Add error handling to env config handling
This adds several changes to how environment variables are handled to
more closely align with how configs are handled, and to fix an issue
with replacing entire tables. The changes are:

- Top-level tables like `MDBOOK_BOOK` now *replace* the contents of the
  `book` table instead of merging it. This adds consistency with how all
  the other environment objects work.
- Fixed allowing top-level replacement of `MDBOOK_BOOK` and
  `MDBOOK_OUTPUT`. This was inadvertently recently broken.
- Added ability to replace top-level `MDBOOK_RUST`. I don't recall why
  that wasn't included.
- Reject invalid keys like `MDBOOK_FOO`.
- Reject unknown keys, like `MDBOOK_BOOK='{"xyz": 123}'`
- Reject invalid types, like `MDBOOK_BOOK='{"title": 123}'`
2025-11-17 14:38:58 -08:00
Eric Huss
5445458d1a Add tests for various environment config issues
These currently aren't working as expected.
2025-11-17 12:47:01 -08:00
Eric Huss
ef476a7329 Merge pull request #2940 from ehuss/bump-version
Update to 0.5.0
2025-11-17 19:17:23 +00:00
Eric Huss
262afdc2f8 Update to 0.5.0
This is the stable release of 0.5.0. No changes have been made since
0.5.0-beta.2.
2025-11-17 08:57:52 -08:00
Eric Huss
fff6087f36 Merge pull request #2929 from ehuss/bump-version
Update to 0.5.0-beta.2.
v0.5.0-beta.2
2025-11-08 02:08:05 +00:00
Eric Huss
922f0d8ad4 Update to 0.5.0-beta.2.
I expect this to be the last pre-release before 0.5.
2025-11-07 18:00:52 -08:00
Eric Huss
ab1325b213 Merge pull request #2928 from ehuss/update-dependencies-no-fork
Disable update-dependencies on forks
2025-11-07 18:11:59 +00:00
Eric Huss
63b159741b Disable update-dependencies on forks
This disables the update-dependencies cron job in forks. It's not
uncommon for people to leave GitHub Actions enabled in a fork (which in
my experience seems to be the default?), and this unfortunately means
that this job will run in all those forks which is probably not what
people want.
2025-11-07 10:06:38 -08:00
Eric Huss
4a9a517f27 Merge pull request #2927 from ehuss/fix-unbalanced-html-in-header
Handle unclosed HTML tags inside a markdown element
2025-11-06 15:38:21 +00:00
Eric Huss
700839f77f Handle unclosed HTML tags inside a markdown element
This fixes an issue where it was panicking due to an unbalanced HTML tag
when exiting a markdown element. The problem was that the tag stack was
left non-empty when processing was finished due to `end_tag` being out
of sync with the pulldown-cmark event tags.

There really should be better validation that the stack is in sync and
balanced, but this should address the main culprit of the interplay of
raw HTML tags and pulldown-cmark events.
2025-11-06 07:31:45 -08:00
Eric Huss
152132458e Move end tag handling to a function
This is to reduce the size of the processing function.
2025-11-06 07:25:55 -08:00
Eric Huss
054da77b6a Add test for unbalanced html in a header
This is unexpectedly panicking.
2025-11-06 07:25:53 -08:00
Eric Huss
9a5e8dbb0a Merge pull request #2926 from ehuss/fix-fa-icons
Fix missing font-awesome icons in the guide
2025-11-06 14:53:56 +00:00
Eric Huss
63c45cd879 Fix missing font-awesome icons in the guide
After the switch in https://github.com/rust-lang/mdBook/pull/1330, some
of the icons were renamed.
2025-11-06 06:48:03 -08:00
Eric Huss
bc7ca458b6 Merge pull request #2923 from LikeLakers2/hide-resize-handle-on-noscript
Hide the sidebar resize indicator when JS isn't available
2025-11-06 03:41:26 +00:00
MichiRecRoom
07fb33f5da Hide the sidebar resize handle when scripting isn't available 2025-11-05 19:11:09 -08:00
Eric Huss
7d1566860c Merge pull request #2924 from ehuss/html-end-tags
Add better handling for unbalanced HTML tags
2025-11-06 03:02:40 +00:00
Eric Huss
f0117ec3df Add a comment about synchronizing the event stack 2025-11-05 11:45:46 -08:00
Eric Huss
22065ebc79 Give a warning for unclosed HTML tags
This changes the internal error message to a warning to let the user
know that the HTML tags are unbalanced. In the future this will be a
denyable lint.

This is a very primitive approach of just ignoring the end tag. Ideally
it should recover using the standard HTML parsing algorithm, since there
is a chance that there will be a cascade of errors under certain
unbalanced situations.
2025-11-05 11:42:43 -08:00
Eric Huss
5905bf1d85 Factor out Token::TagToken to combat rightwards drift 2025-11-05 11:33:58 -08:00
Eric Huss
1646e4923a Add a test for HTML tags out of sync 2025-11-05 11:19:42 -08:00
Eric Huss
1e190137c3 Add a check for unclosed elements on the stack
This checks for any unclosed elements when processing is finished. This
is intended to detect invalid HTML in the source, or bugs in the tree
builder. Raw HTML elements generate a warning (which in the future will
be a configurable lint). All other sync errors are internal errors as
they are not expected, and it would be helpful to know if they ever
happen.
2025-11-05 11:14:39 -08:00
Eric Huss
4417f8cb0a Add a test for unclosed HTML tags 2025-11-05 10:45:46 -08:00
Eric Huss
cc7f8be496 Merge pull request #2922 from ehuss/header-id-lowercase
Lowercase heading IDs
2025-11-05 00:14:42 +00:00
Eric Huss
051fc9f01d Add a comment about the intent of HTML id generation 2025-11-04 16:05:36 -08:00
Eric Huss
d0bde467e0 Lowercase heading IDs
This switches from ASCII lowercase to Unicode lowercase when generating
heading IDs. This brings mdbook more in line with other tools and sites
when they generate heading IDs. The generation still isn't 100% the same
as other tools and sites, but it is usually the same in most cases.

Closes https://github.com/rust-lang/mdBook/issues/1059
2025-11-04 16:05:31 -08:00
Eric Huss
475951c9ee Merge pull request #2921 from ehuss/header-id-changelog
Add note to changelog about a change in heading ID generation
2025-11-04 23:06:17 +00:00
Eric Huss
5b2cc1735b Add note to changelog about a change in heading ID generation
I didn't fully appreciate that this changed in
https://github.com/rust-lang/mdBook/pull/2844 which changed how text
content was collected from heading tags.
2025-11-04 14:56:08 -08:00
Eric Huss
1c00395230 Merge pull request #2920 from rust-lang/renovate/cargo-semver-checks-0.x
Update cargo-semver-checks to v0.45.0
2025-11-02 04:10:45 +00:00
renovate[bot]
9799326590 Update cargo-semver-checks to v0.45.0 2025-11-01 20:40:49 +00:00
Eric Huss
2546c8cc60 Merge pull request #2916 from rust-lang/update-dependencies
Update cargo dependencies
2025-11-01 04:14:37 +00:00
Eric Huss
33c9b4063e Merge pull request #2919 from rust-lang/renovate/node-24.x
Update dependency node to v24
2025-11-01 04:14:10 +00:00
Eric Huss
f66fd92f32 Merge pull request #2918 from rust-lang/renovate/actions-setup-node-6.x
Update actions/setup-node action to v6
2025-11-01 04:13:51 +00:00
Eric Huss
541e16335b Merge pull request #2917 from rust-lang/renovate/browser-ui-test-0.x
Update dependency browser-ui-test to v0.22.3
2025-11-01 04:13:28 +00:00
renovate[bot]
6cc40cb5f7 Update dependency node to v24 2025-11-01 00:33:10 +00:00
renovate[bot]
37f8a79d4d Update actions/setup-node action to v6 2025-11-01 00:33:06 +00:00
renovate[bot]
385246a9ef Update dependency browser-ui-test to v0.22.3 2025-11-01 00:33:02 +00:00
github-actions[bot]
7619f9a91c Update cargo dependencies
```
name          old req compatible latest new req
====          ======= ========== ====== =======
clap          4.5.50  4.5.51     4.5.51 4.5.51
clap_complete 4.5.59  4.5.60     4.5.60 4.5.60
ignore        0.4.24  0.4.25     0.4.25 0.4.25
snapbox       0.6.22  0.6.23     0.6.23 0.6.23
```
2025-11-01 00:32:23 +00:00
Eric Huss
f27c3aea4c Merge pull request #2915 from ehuss/fontawesome-warning
Add a warning when a Font Awesome font is missing
2025-10-31 02:38:29 +00:00
Eric Huss
b3bd103742 Add a warning when a Font Awesome font is missing
With the migration to Font Awesome 6, I'm running into books where the
icon names are missing or have changed. This adds a warning to help
identify those situations.
2025-10-30 19:30:01 -07:00
Eric Huss
7e5fa3565b Add a fontawesome test for a missing icon
This is a test for when an icon is missing.
2025-10-30 19:27:40 -07:00
Eric Huss
6d9f49cbc5 Update fontawesome test to make it clear the intent
This example was intended to demonstrate that it only translates if
there are no child elements.
2025-10-30 19:24:49 -07:00
Eric Huss
8670bcc540 Merge pull request #2914 from ehuss/fix-print-relative
Fix print page links for internal links to non-chapters
2025-10-31 01:44:04 +00:00