Eric Huss
af3012b0f2
Update pulldown-cmark to 0.11
2024-05-16 14:17:19 -07:00
expikr
c2eb375f69
Fix spacers in summary with folding.
...
The spacer was incorrectly being included in the previous fold.
2024-05-13 14:10:42 -07:00
Eric Huss
83444650a3
Merge pull request #2376 from ehuss/clippy-fixes
...
Apply a few minor clippy fixes
2024-05-13 19:18:52 +00:00
Eric Huss
5bc87d5c17
Apply a few minor clippy fixes
2024-05-13 12:13:50 -07:00
Eric Huss
7a58c415de
Remove cargo-clippy unknown feature
2024-05-13 12:07:49 -07:00
Eric Huss
d28cf53009
Rename curly-quotes to smart-punctuation.
2024-02-25 13:42:44 -08:00
Eric Huss
42e635bb9e
Update pulldown_cmark to 0.10
2024-02-05 14:11:27 -08:00
klensy
e3ad9d097e
reduce useless regex allocs
...
from 474mb to 215mb
==40876== Total: 474,156,323 bytes in 1,521,025 blocks
==40876== At t-gmax: 13,872,954 bytes in 4,655 blocks
==40876== At t-end: 488,516 bytes in 884 blocks
==40876== Reads: 820,933,434 bytes
==40876== Writes: 514,838,350 bytes
to
==57763== Total: 215,292,393 bytes in 1,161,048 blocks
==57763== At t-gmax: 13,872,954 bytes in 4,655 blocks
==57763== At t-end: 1,210,783 bytes in 1,274 blocks
==57763== Reads: 598,542,892 bytes
==57763== Writes: 229,841,910 bytes
2024-01-14 15:17:31 +03:00
klensy
573b6522f9
remove useless alloc
...
on rust reference book this reduces total allocs from 490mb to 474mb:
==23272== Total: 490,538,699 bytes in 1,760,117 blocks
==23272== At t-gmax: 13,872,954 bytes in 4,655 blocks
==23272== At t-end: 488,516 bytes in 884 blocks
==23272== Reads: 830,509,060 bytes
==23272== Writes: 522,290,614 bytes
to
==40876== Total: 474,156,323 bytes in 1,521,025 blocks
==40876== At t-gmax: 13,872,954 bytes in 4,655 blocks
==40876== At t-end: 488,516 bytes in 884 blocks
==40876== Reads: 820,933,434 bytes
==40876== Writes: 514,838,350 bytes
2024-01-14 15:17:07 +03:00
Ning Sun
a42eafc316
feat: upgrade handlebars to 5.0
2024-01-04 20:16:34 +08:00
klensy
88be4ac417
remove useless string clone
2023-12-16 13:29:24 +03:00
Jonathan Hult
91af1c3b54
Remove warning check for theme directory as ./src/theme
...
This was causing an unnecessary warning if &src_dir was the same as ctx.root
2023-12-09 16:53:57 -06:00
cN3rd
7717b9dcf2
Support text_direction attribute in HTML output
2023-09-02 07:50:21 -07:00
Eric Huss
c9cfe22fd6
Apply some code style changes.
2023-05-28 14:04:58 -07:00
Jannik Obermann
7df1d8c838
Support hidden lines in languages other than Rust
...
Co-Authored-By: thecodewarrior <5467669+thecodewarrior@users.noreply.github.com>
2023-05-28 14:04:54 -07:00
Eric Huss
1db52ff531
Fix search for custom heading attributes
2023-05-28 12:03:03 -07:00
Eric Huss
34e5ef22a0
Don't include empty class attribute.
2023-05-28 11:33:00 -07:00
ImUrX
c8a5adcee9
fix more mistakes
2023-05-28 10:47:14 -07:00
ImUrX
ecdb411711
fix mistakes
2023-05-28 10:47:14 -07:00
ImUrX
a4e206168d
Add working heading extension
2023-05-28 10:47:13 -07:00
Eric Huss
45a8575b95
Apply clippy::needless_borrow
2023-05-13 09:44:11 -07:00
Eric Huss
01047846a9
Don't copy the stock fonts if the user has overridden fonts.css.
...
This wasn't behaving as I was really intending.
2023-05-13 09:05:25 -07:00
Eric Huss
75a6d65e5a
Don't warn on copy-fonts=true (the default) when fonts.css is overridden.
2023-05-13 08:51:04 -07:00
Tetsuya Morimoto
04016f3be6
Refactor the warning message related to copy_fonts so that a user simply configures it
2023-04-28 12:46:49 +09:00
Eric Huss
c2d973997a
Make fonts part of the theme.
2023-01-15 11:42:46 -08:00
Eric Huss
f32bd6f945
Show the currently selected theme.
2022-11-21 15:27:39 -08:00
David
75857fbf73
feat: use once_cell instead of lazy_static ( #1894 )
2022-09-22 15:05:39 -07:00
Martin Geisler
3958260353
Simplify the use of Option::and_then
...
I found a few places where `Option::and_then` could be simplified (in
my opinion) with `?` or with `match`.
2022-09-11 00:46:26 +02:00
Dylan DPC
66bf85b14f
Require Rust 2021 edition
...
This allows us to clean up and simplify the code.
2022-09-09 16:00:35 +02:00
Eric Huss
fff067b2a8
Merge pull request #1836 from mgeisler/trim-trailing-whitespace
...
Avoid empty last line in editable code blocks
2022-08-10 19:55:06 -07:00
Martin Geisler
217546c2a0
Trim trailing whitespace in Rust code blocks
...
Before, a code block would always end with a final newline. The
newline was added unconditionally by `hide_lines`.
When the code block is syntax highlighted by highlight.js, this is not
a problem, no empty line is added for a final trailing `\n` character.
However, when the code block is editable and thus handled by the ACE
editor, a trailing newline _is_ significant. I believe this issue is
most closely described by https://github.com/ajaxorg/ace/issues/2083
in the upstream repository.
The effect of the way ACE handles newlines is that a code block like
<pre>
Some code
</pre>
will create an editor with _two_ lines, not just one.
By trimming trailing whitespace, we ensure that we don’t accidentally
create more lines in the ACE editor than necessary.
2022-08-10 03:11:08 +02:00
mitchmindtree
13035baeae
Workaround rust nightly borrowcheck error ( #1860 )
...
Surprisingly, this fixes the error filed at #1860 !
This seems suspicious, perhaps indicative of a bug in Rust's non-lexical
lifetime handling?
The lifetimes in the `handlebars::Renderable::render` method signature
are quite complicated, and its unclear to me whether or not Rust is
catching some new safety edge-case that wasn't previously handled
correctly...
Possibly related to `drop` order, which I *think* is related to the
order of binding statements?
2022-07-22 15:15:12 +10:00
Joseph Priou
f92911b8aa
Revert "remove __non_exhaustive members, add non_exhaustive attribute instead"
2022-07-09 17:43:17 +02:00
Fauconfan
11781f0c1b
remove __non_exhaustive members, add non_exhaustive attribute instead
2022-07-09 15:05:06 +02:00
ISSOtm
fa5f32c7fd
Make link to first chapter active in index page
...
Makes both pages more consistent, and also the previous test pass
Co-authored-by: Eric Huss <eric@huss.org>
2022-06-29 23:51:18 +02:00
ISSOtm
8571883923
Mark the first chapter as "index", even if not the first book item
2022-06-29 08:35:41 +02:00
Eric Huss
4cf005d4bd
Merge pull request #1832 from ISSOtm/clippy
...
Fix Clippy lints
2022-06-27 14:28:39 -07:00
Eric Huss
b38792c166
Merge pull request #1833 from mattheww/2022-06_searchindex
...
Omit words longer than 80 characters from the search index
2022-06-27 14:17:40 -07:00
ISSOtm
248863addf
Fix Clippy lints
...
Also remove `allow(clippy::*)`s where possible
2022-06-27 23:08:45 +02:00
Matthew Woodcraft
1f8c090a5f
When creating the search index, omit words longer than 80 characters
...
This avoids creating deeply nested objects in searchindex.json
2022-06-26 12:22:52 +01:00
Dylan DPC
a5f861bf2b
Revert "Omit words longer than 80 characters from the search index"
2022-06-22 13:31:16 +02:00
Matthew Woodcraft
d65ce55453
When creating the search index, omit words longer than 80 characters
...
This avoids creating deeply nested objects in searchindex.json
2022-05-22 14:00:20 +01:00
Eric Huss
37d756ae75
Adjust overlap of code buttons with code blocks.
2022-05-16 19:27:46 -07:00
klensy
af6237015a
init regexes via lazy_static, don't recompute it
2022-05-06 10:05:52 +03:00
klensy
f3332fb0da
Use serde's derive feature instead of directly importing serde_derive
2022-05-05 09:33:51 +03:00
Clark
a60571321a
bail! in render() if specified theme directory does not exist
2022-04-26 20:20:44 +08:00
Eric Huss
ceff050bb4
Don't try to render summary links as markdown.
2022-04-14 20:35:39 -07:00
Eric Huss
a5fddfa468
Merge pull request #1749 from tommilligan/unique-search-anchors
...
search: fix anchor ids for duplicate headers
2022-03-28 12:44:20 -07:00
Eric Huss
675c8c3f4e
Add book title to 404 page title.
2022-03-27 17:17:20 -07:00
rsapkf
97cb77bbdd
Add proper title to 404 page
2022-03-27 17:01:11 -07:00